Re: [R] Sampling in R

2009-04-21 Thread Jorge Ivan Velez
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

Re: [R] Sampling in R: Please read my email from attached text.

2009-04-21 Thread David Winsemius
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,

Re: [R] Sampling in R

2009-04-21 Thread Mike Lawrence
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

Re: [R] Sampling in R

2009-04-21 Thread Uwe Ligges
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