Skip to content
Prev 205530 / 398506 Next

bootstrap help

I have a similar question.
I want to generate list of 50 bootstrap samples,
it can be done by:

lapply(1:50,function(i){data[sample(nrow(data),size=nrow(data),replace=TRUE),]})
which is E[y]/E[x].
How can I do it?

'>> data<-data.frame(x=rnorm(49), y=rnorm(49))
These codes will generate mean of column x and mean of column y. 
Is y the corresponding of x? because x and y are pair data.

Thank you.