The sample function has a prob argument that determines the probabilities of each element being sampled, put your proportion of women in there and see if that works for you.
-- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Kirsten Beyer > Sent: Thursday, June 28, 2007 2:00 PM > To: [email protected] > Subject: [R] sampling question > > I am interested in locating a script to implement a sampling > scheme that would basically make it more likely that a > particular observation is chosen based on a weight associated > with the observation. I am trying to select a sample of ~30 > census blocks from each ZIP code area based on the proportion > of women in a ZCTA living in a particular block. I want to > make it more likely that a block will be chosen if the > proportion of women in a patient's age group in a particular > block is high. Any ideas are appreciated! > > ______________________________________________ > [email protected] 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. > ______________________________________________ [email protected] 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.
