[R-sig-ME] Multilevel Probability Question

Chuck Cleland ccleland at optonline.net
Tue Jun 12 14:51:42 CEST 2007


Martin Henry H. Stevens wrote:
> If you aren't stratifying by school, then isn't it just the  
> probability of drawing 120 teachers out of 2000?
> -Hank

  Creating the population described and taking a simple random sample of
120 teachers, it seems it would be very rare for no two teachers to come
from the same school:

pop <- data.frame(TEACHER = 1:2000, SCHOOL = rep(1:400, 5))

table(replicate(1000000, any(table(pop[sample(2000, size = 120,
replace=FALSE),]$SCHOOL) > 1)))

   TRUE
1000000

  There are obviously some samples where every teacher would come from a
different school, but I'm not sure how you might find the specific
probability.

hope this helps,

Chuck

> On Jun 11, 2007, at 4:37 PM, Roberts, J. Kyle wrote:
> 
>> Dear Friends,
>>
>> I sent the following to the multilevel listserv, but thought that  
>> some of you might actually have code to compute this in R.  If you  
>> do, please let me know.
>>
>> I have an odd question. I am trying to compute the probability of  
>> drawing 120 teachers from a sample of 2000 teachers in 400 schools  
>> where no two teachers work at the same school. Assume that there  
>> are 5 teachers at each school, evenly spread. I was trying to do  
>> this with an "n choose k" type
>> situation, but I can't figure out how to include the part about  
>> only 5 teachers can be at any given school. Any ideas? I am not  
>> stratifying on school, just sampling teachers.
>>
>> Thanks,
>>
>> Kyle
>>
>>
>> ***************************************
>> J. Kyle Roberts, Ph.D.
>> Baylor College of Medicine
>> Center for Educational Outreach
>> One Baylor Plaza, MS:  BCM411
>> Houston, TX   77030-3411
>> 713-798-6672 - 713-798-8201 Fax
>> jkrobert at bcm.edu
>> ***************************************
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894




More information about the R-sig-mixed-models mailing list