Using the "SVY" module and sampling weights of STATA GUATEMALA [message #13566] |
Mon, 20 November 2017 11:47 ![Go to next message Go to previous message](/theme/default/images/down.png) |
MMazariegos
Messages: 1 Registered: November 2017 Location: Mexico
|
Member |
|
|
Good morning,
I am using the DHS 2014-2015 Guatemala Database: GUIR71FL
I just want to be sure if I am using the correct variables to specify the SVY, can you please check the code above?
use "C:\Users\mmazariegos\Desktop\ENSMI 2015\GUKR71FL.DTA"
svyset v021 [pweight = v022], strata(v023) singleunit(centered)
Also, I do not know if I have to do it anything else to be able to calculate proportions of some variable over other. For example, the proportion of stunting over wealth status.
First, I calculate stunting:
*To generate STUNTING*
sum hw70
gen haz= hw70/100
sum haz
replace haz=. if haz<-6
replace haz=. if haz>6
gen stunting= 1 if haz <-2 & (hw1<60 & hw1!=.)
replace stunting= 0 if haz >=-2 & (hw1<60 & hw1!=.)
tab stunting, gen(stunting_cat)
*Stunting by wealth Index*
tab v190
svy:proportion stunting, over(v190) *This is working*
But I want to calculate not only the proportion by wealth status but be able to assess if there are statistical differences using lincom:
svy, subpop(keeptag): mean stuntingcat, over(v190)
lincom [_subpop_1] - [_subpop_2]
lincom [_subpop_1] - [_subpop_3]
lincom [_subpop_2] - [_subpop_3]
With this, I get an error saying "invalid subpop() option"
Thanks in advance,
Monica
|
|
|