Question: (Closed) Bootstrap On Correlation Coefficients In R
0
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

set.seed(1)
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.4k views
written 6.1 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.1 years ago • written 6.1 years ago by Ben2.0k

closing because the question fails to produce relation to biology.

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