Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Sample with weights


From   Nick Winter <[email protected]>
To   [email protected]
Subject   Re: st: Sample with weights
Date   Fri, 30 Sep 2005 14:43:36 -0400

At 02:00 PM 9/30/2005, you wrote:
Willard wrote:
I have a population of company's. I want a sample from this population,
but the probability of a company to be sampled has to be equivalent with
the number of employees (let's call this "size").

I would take an approach like this:

(1) Calculate for each company the probability of inclusion. This is (sample size) * (size of company / total of company sizes). So assuming a sample size of 100:

. sum size
. gen prob = 100 * ( size / r(sum) )

(2) Then select the sample based on these probabilities

. gen u = uniform()

. gen insamp = u < prob

The problem is that this approach generates an *average* sample size of 100, but not exactly 100 in every case. Thoughts?

Nick Winter


________________________________________________________
Nicholas J. G. Winter 607.255.8819 t
Assistant Professor 607.255.4530 f
Department of Government [email protected] e
Cornell University falcon.arts.cornell.edu/nw53 w
308 White Hall
Ithaca, NY 14853-4601

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index