Re: Weight in Indonesia DHS 2012 for un insurance coverage (None) [message #22315 is a reply to message #22100] |
Thu, 25 February 2021 14:27 |
Bridgette-DHS
Messages: 3199 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS Specialists, Trevor Croft and Tom Pullum:
Sorry for the delay. Note that the mean of a 0/1 variable is the proportion of cases with code 1. If you use 100 in place of 1, you get the percentage of cases with 1 (or 100). You can match the table with the following Stata code:
gen SS=0
gen Employer=0
gen Private=0
gen Other=0
gen None=0
replace SS=100 if v481c==1
replace Employer=100 if v481b==1
replace Private=100 if v481d==1
replace Other=100 if v481x==1
replace None=100 if v481c~=1 & v481b~=1 & v481d~=1 & v481x~=1
foreach var in SS Employer Private Other None {
mean `var' [iw=v005/1000000]
mean `var' [iw=v005/1000000], over(v013)
}
You can also get a match with the following command, and better-looking output:
tabstat SS Employer Private Other None [aw=v005/1000000], statistics(mean) by(v013) format(%6.1f)
The "foreach" loop includes "mean" and "iweight". The "tabstat" command includes "statistics(mean)" and "aweight". In general we avoid aweights, and we can't really say why the tabstat command only gives a match with aweights. For that reason, we would recommend that you use "mean" rather than "tabstat".
|
|
|