Message-ID: <1262799720740-1008227.post@n4.nabble.com>
Date: 2010-01-06T17:42:00Z
From: luciferyan
Subject: bootstrap help
In-Reply-To: <972282810912071356ud012312v8feab87e98d1aac9@mail.gmail.com>
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),]})
>From these bootstrap samples, I want to work out the Bootstrap estimates,
which is E[y]/E[x].
How can I do it?
'>> data<-data.frame(x=rnorm(49), y=rnorm(49))
>> t(sapply(1:50,function(i){colMeans(data[sample(nrow(data),size=nrow(data),replace=TRUE),])}))'
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.
--
View this message in context: http://n4.nabble.com/bootstrap-help-tp949807p1008227.html
Sent from the R help mailing list archive at Nabble.com.