Dear Seyit,
You might consider the boot package in this situation. Here is an example:
require(boot)
DF<-data.frame(Xvar,Yvar)
temp <- boot(DF, function(DF,d){
S <- DF[d,]
cor(S$Xvar,S$Yvar)
},
R = 5000)
temp$t0
# [1] 0.617
You need to sample pairs rather than sampling individually within Xvar
and Yvar. You also generally sample with replacement. If you sample
without replacement for the length of the data, then you just get the
same set.
On Apr 21, 2009, at 3:54 AM, skayis selcuk wrote:
David Winsemius,
When you shuffle the observations independently, you are performing a
permutation test (though for this you only need to shuffle one side of
the pairs). When you sort the observations you are doing something
ridiculous that has no statistical meaning that I know.
I'm not very familiar with bootstr
Seyit Ali Kayis wrote:
Dear R users,
I need to do sampling without replacement (bootstraps). I have two variables (Xvar, Yvar).
I have a correlation from original data set cor(Xvar, Yvar)=0.6174221. I am doing 5 sampling,
and in each sampling calculating correlations, saving, sorting an
4 matches
Mail list logo