[R] Stratified random sample

Daniel Malter daniel at umd.edu
Thu Jul 17 03:11:36 CEST 2008


create a vector containing 1,2,3

sample one value

remove the sampled value from the initial vector

sample again

now select the observations belonging to the strata indexed by the two
sampled values

-> not difficult. Most certainly, other approaches work too, maybe even
better.

Rolf, is he taking a course of yours? :)

Best
Daniel 


lamack lamack wrote:
> 
> 
> Dear all, I have two vector:
>  strata response1   11   21   32   12   22   3.  ..  ..  .10  110  210  3. 
> ..  ..  .100  1100  2100  3 
> I need to get a stratified random sample of size = 100, such that:
> if I select response = 1 in strata 1 then I need sample 2 or 3 in strata 2
>  
> if I select response = 2 in strata 2 then I need to sample 1 or 3 in
> strata 3
> if I select response = 3 in strata 2 then I need to sample 1 or 2 in
> strata 3
> and so on. Please, how can I do this?
>       Best regards
> _________________________________________________________________
> Cansado de espaço para só 50 fotos? Conheça o Spaces, o site de
> relac[[elided Hotmail spam]]
> 
> 	[[alternative HTML version deleted]]
> 
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: http://www.nabble.com/Stratified-random-sample-tp18499013p18499744.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list