[R] Question: how to make a sample from my data set

Alex99 loyola9988 at yahoo.com
Tue Oct 14 16:04:59 CEST 2008


 Hi everyone,

I have a question about sampling. I have a data set which includes 25
different variables named; symptom1, symptom2,.....,symptom25(25
columns).Each variable(symptom) has 9 patients (9 columns). 
I need to use random sampling to make, 5 different samples from my data.
i.e. using all 25 variables I need to make 10 different samples by changing
the rows(patients) and then I need to show each sample with their mean for
each variable(symptom) which is just adding a row at the end of each symptom
to show the mean.

I used this code:
for(i in 1:5) {temp[i]<-sample(Mydata,5, replace=F)} show(temp)
-- 
View this message in context: http://www.nabble.com/Question%3A-how-to-make-a-sample-from-my-data-set-tp19974192p19974192.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list