Statalist The Stata Listserver


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

Re: st: Why does one command "lose" observations compared to another command?


From   "Michael S. Hanson" <mshanson@mac.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Why does one command "lose" observations compared to another command?
Date   Sun, 22 Jan 2006 12:57:07 -0500

On Jan 22, 2006, at 11:56 AM, Suzy wrote [slightly edited]:

I have come across a problem that I can't figure out. I don't know why I am "losing" 873 observations with one stata command versus the other - for mean age by race, if age>=18. Both age and race are 100% present in the total dataset - total (N=21004) and for age>=18 (N=11,441).

Any insight into this would be greatly appreciated.


svy, subpop(if age>=18): mean age, over(race)

mean age [pweight = mecwt4] if age>=18, over(race)
Have you examined mecwt4 to confirm that it has all 11441 observations in your restricted sample?

-- Mike

*
* 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–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index