Home » Topics » Water and Sanitation » District-Level WaSH Indicators (District-level Indicators, SEs, and Bootstrapping)
Re: District-Level WaSH Indicators [message #28772 is a reply to message #28738] |
Wed, 06 March 2024 16:18 |
Janet-DHS
Messages: 893 Registered: April 2022
|
Senior Member |
|
|
Following is a response from DHS staff member, Tom Pullum:
The setup for a bootstrap that matches the sample design would be complicated. It's easier to get the estimates with a model that includes svyset--which you are using. I will paste below the lines to do this. Just for an illustration, I use the Mozambique 2011 data, with subpopulation hv024=1 (Niassa). The outcome y is 1 if the source of drinking water is an unprotected well (hv201=32), which is the largest category. The model has no covariates. The lines show how to extract the proportion of households with y=1 in Niassa, as well as the lower and upper bounds of a 95% CI for that proportion. I show how to do this with logit or logistic models. You also get the standard error on the logit or odds scale but I would not recommend the se on the scale of a proportion (also not on the odds scale). CI yes, se no. Hope this helps.
* Open HR file, cases are households
use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\MZHR62FL.DTA" , clear
* Specify outcome and subpopulation
gen y=0
replace y=1 if hv201==32
gen Niassa=0
replace Niassa=1 if hv024==1
* Prepare svyset
svyset hv001 [pweight=hv005], strata(hv023) singleunit(centered)
* Logit model
svy, subpop(Niassa): logit y
matrix T=r(table)
matrix list T
* Extract P, L, and U as saved results
* P, L, and U are the point estimate and the lower and upper bounds
* of a 95% confidence interval for the proportion of households in
* Niassa whose main source of drinking water is an unprotected well.
scalar b=T[1,1]
scalar P=exp(b)/(1+exp(b))
scalar b=T[5,1]
scalar L=exp(b)/(1+exp(b))
scalar b=T[6,1]
scalar U=exp(b)/(1+exp(b))
scalar list P L U
* Equivalent using logistic
svy, subpop(Niassa): logistic y
matrix T=r(table)
matrix list T
scalar odds=T[1,1]
scalar P=odds/(1+odds)
scalar odds=T[5,1]
scalar L=odds/(1+odds)
scalar odds=T[6,1]
scalar U=odds/(1+odds)
scalar list P L U
|
|
|
Goto Forum:
Current Time: Fri Nov 29 06:31:47 Coordinated Universal Time 2024
|