Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: ratio of 2 different surveys estimates? svyset , suest , fpc , nlcom
From
Steven Samuels <[email protected]>
To
[email protected]
Subject
Re: st: ratio of 2 different surveys estimates? svyset , suest , fpc , nlcom
Date
Wed, 19 Jan 2011 15:07:48 -0500
Another way of putting this: When you combine independent surveys, you
must create a new stratum variable in which the individual original
strata in each survey appear. You would do this in your data, for
example by:
****************************
egen stratum =group(year stk)
*****************************
If there were 10 strata in 2006 and 10 in 2007, the new stratum
variable should have 20 levels. Then a single -svyset- statement will
allow joint analysis of the two surveys, as in my example.
Steve
[email protected]
On Jan 18, 2011, at 8:52 PM, Steven Samuels wrote:
I don't understand all your manipulations, Roman, but I think that the
error message provides the key: the same stratum numbers appear in
both years, but with different fpcs,, depending on the year. Renumber
the strata so that this doesn't happen.
*************************
webuse income, clear
gen year = 2006 + (famid>68)
gen stratum = 1 if famid<=34 //2006
replace stratum =2 if inrange(famid,35,68) //2006
replace stratum =3 if inrange(famid, 69, 100) //2007
replace stratum =4 if inrange(famid, 101,135) //2007
gen fpc = .05*(stratum==1) +.10*(stratum==2) +.12*(stratum==3) +.
15*(stratum==4)
svyset famid, strata(stratum) fpc(fpc)
svy: reg inc if year==2006
estimates store y2006
svy: reg inc if year==2007
estimates store y2007
suest y2006 y2007
matrix list e(V) //results from different years are independent
nlcom _b[y2006:_cons]/_b[y2007:_cons]
***********************************************
Steve
Steven J. Samuels
[email protected]
18 Cantine's Island
Saugerties NY 12477
USA
Voice: 845-246-0774
Fax: 206-202-4783
On Jan 18, 2011, at 3:03 AM, Roman Kasal wrote:
I have 2 estemates in 2 surveys with two different FPCs (finite
population corrections). I would like to calculate ratio "nlcom
[r6]_cons/[r7]_cons" but:
"
for year 2006
svyset ico [pw=vahaHMM], strata(stk) fpc(vb1) singleunit(centered)
svy: reg X if year==2006
estimates save r2006
for year 2007
svyset ico [pw=vahaHMM], strata(stk) fpc(vb1) singleunit(centered)
svy: reg Y if year==2007
estimates save r2007
estu use r2006
estimates esample:
est sto r6
estu use r2007
estimates esample:
est sto r7
suest r6 r7
and error:
fpc for all observations within a stratum must be the same
_robust2 failed to compute cross model variance estimate
likely an internal error in suest
"
1) is any way how to easily handle this correctly in STATA? Because two
different FPCs are correct for 2 years. Within 1 year (2006 or 2007) the
FPCs are well set because "svy: reg X if year==2006" is working.
2) do I have to calculate the ratio manually? Do you know any tools or
info about this?
3) when I know the fpc does not differ much, can I use average FPC for
the both surveys for the ratio (not for averages)?
thank you
Roman Kasal
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/