[R] random sampling problems?

From: zhijie zhang <epistat_at_gmail.com>
Date: Tue 04 Jul 2006 - 17:56:17 EST


Dear friends,
 suppose my dataset is the following data:

id<-1:9
x<-c(1,2,3,1,2,3,1,2,3)
y<-c(1,1,1,2,2,2,3,3,3)
data<-data.frame(id,x,y)

     id x y
1 1 1 1
2 2 2 1
3 3 3 1
4 4 1 2
5 5 2 2
6 6 3 2
7 7 1 3

8 8 2 3
9 9 3 3
i want to do sampling like this:say the sample size is 3.  First: random sampling from x;
Next ,random sampling from y ;and combing sampled x and sampled y; Finally, output the samples: id x and y. I think i could call it two-dimension sampling. Thanks very much!

-- 
Kind Regards,
Zhi Jie,Zhang ,PHD
Department of Epidemiology
School of Public Health
Fudan University
Tel:86-21-54237149

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jul 04 18:00:21 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 04 Jul 2006 - 20:15:23 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.