Re: [R] help on understanding a code

2009-06-02 Thread Mike Lawrence
You haven't provided us enough information. You should also provide examples where we can access all the called objects; for example, ttest() is not a built-in function, so we have no idea what it is. Same goes for dat and y. On Tue, Jun 2, 2009 at 11:43 AM, Hongyuan Cao wrote: > Dear R user, > >

[R] help on understanding a code

2009-06-02 Thread Hongyuan Cao
Dear R user, I am trying to understand this following code. Basically it's using a permutation method to calculate p value. But I would like to know exactly how the permutation works. #calculates null statistics tt0 <- 0 set.seed(123) B <- 100 for(i in 1:B) { v <- sample(y) tt0 <- c(tt0,ttest(dat