Question: (Closed) Bootstrap On Correlation Coefficients In R
gravatar for suganyasivagurunathan
6.9 years ago by
suganyasivagurunathan20 wrote:

Bootstrapping on a correlation is useful because we know that the distribution of correlations is not normal since it's bounded between -1 and 1. In case of two data frames of equal size ( 100 X 10) in both how can this be done using R ?

First, I know we should find the correlation and get the pair-wise correlation across the two data frames.

How to Bootstrap the data by pulling out pairs with or without replacement. Then show the distribution of bootrapped values and the confidence interval as a histogram?

Maybe for such a sample data

      x <- matrix(rnorm(1000), nrow=100, ncol=10)
      y <- matrix(rnorm(1000), nrow=100, ncol=10).

I found a useful MATLAB code which I have added here Code in MATLABbootstrap correlation coeeficients. Is there something similar in R to obtain a similar plot ? I checked out the documentation in bootstrap package but was unable to understand.

R correlation • 4.9k views
ADD COMMENTlink written 6.9 years ago by suganyasivagurunathan20

Just use random indices to select rows from your data, i.e. where df is your dataframe or matrix: samp <- df[sample(1:nrow(df), 100, replace=T),]. That will take a sample (with replacement) of 100 rows of your data.

ADD REPLYlink modified 6.9 years ago • written 6.9 years ago by Ben2.0k

closing because the question fails to produce relation to biology.

ADD REPLYlink written 6.9 years ago by Michael Dondrup47k

Please edit the original question, to improve it. Do not create a duplicate.

ADD REPLYlink written 6.9 years ago by Michael Dondrup47k
Please log in to add an answer.
The thread is closed. No new answers may be added.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 701 users visited in the last hour