[R] Sample Function

MarcioRibeiro mestat at pop.com.br
Thu Jul 16 17:55:51 CEST 2009


Hi listers,
Suppose I have a dataset with n=10 observations and I want to sample with
replacement.
My new sample is of size m=9.
So, I am using the following code...
newsample<-dataset[sample(m,replace=T),]
The problem is that generates the new sample and the last observation of my
data set is never included.
I can sample the identification like this code...
newsample<-sample(1:n,m,replace=TRUE)
But, after this code I am obtaining a statistic and I have only the
identification of the data observed.
Is there a way that I can sample the data observed to calculate a statistic
of it.
Thanks in advance,
Marcio
-- 
View this message in context: http://www.nabble.com/Sample-Function-tp24519230p24519230.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list