Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Subpop - losing observations - a similar problem


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: Subpop - losing observations - a similar problem
Date   Tue, 11 Sep 2007 09:59:31 -0500

Jamie <[email protected]> asks why the -svy- prefix with the -subpop()- option
dropped observations from the estimation sample:

> I am trying to select a subpopulation for use with svy: mlogit.
> 
> The variable which specifies the subpopulation has 1130 observations  
> with a value of 1, 1792 0s and no missing data. However, when I run  
> the syntax (below), only 1099 observations are included in the analysis
> 
> xi: svy, subpop(varname): x y1 y2, rrr
> 
> Searching on the archives here brought me to a post about 'losing  
> observations'
> 
> Subject   st: Why does one command "lose" observations compared to  
> another command?
> Date   Sun, 22 Jan 2006 11:56:50 -0500 "
> 
> This problem seemed similar to the one I have and the answers  
> suggested that it might be something to do with a weights variable  
> having zeros on it.
> 
> I have checked my probability weight variable which is invoked earlier  
> in the syntax by svyset, and it contains 121 0s, which doesn't quite  
> explain the 131 missing observations.
> 
> When I specify the brr option to include both the probability weight  
> and bootstrap weights (see below), all 1130 observations ARE included  
> in the analysis
> 
> xi: svy brr, subpop(varname): x y1 y2, rrr
> 
> I would really appreciate any help.

The -svy- prefix drops strata that do not contain observations that overlap
with the specified -subpop()- option.  In addition, observations where the
sampling weight variable is zero are also considered outside the
subpopulation.

Suppose stratum 1 is identified in the dataset with the following 10
observations:

obs		pweight		subpop
1		0		1
2		0		1
3		0		1
4		0		1
5		33		0
6		19		0
7		5		0
8		21		0
9		8		0
10		30		0

Then stratum 1 is going to be omitted by -svy- because none of it's
observations overlap with the subpop, 0 values in 'pweight' overrule the value
of the 'subpop' variable.

Since the 28aug2006 executable update in Stata 9, the -svy brr- prefix has
been using the same logic for omitting strata.

--Jeff
[email protected]
*
*   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