Skip to main content
. Author manuscript; available in PMC: 2014 Mar 2.
Published in final edited form as: Stata J. 2012 Oct 1;12(4):718–725.
* Set up survey weight and linearized variance estimation (default).
svyset [pweight = V5]
* Estimate the proportion of nonmedical users (subpop) using nasal
* admin (V1615).
svy, subpop(if usehistory == 3 | usehistory == 4 | usehistory == 5): prop V1615
* Request DEFT2 due to weighting (only).
estat effects
* Apply deft2corr, inputting the estimate, linearized SE, average
* total DEFT2, and DEFT2 component due to weights.
deft2corr 0.3627 0.0257 2 1.3528 0
* Estimate logistic regression model for odds of nasal admin.
svy, subpop(if usehistory == 3 | usehistory == 4 | usehistory == 5): logit V1615 ib3.usehistory i.V1151 i.V1 i.V13 i.V17
* Request DEFT2 estimates due to weighting (only).
estat effects
* Apply deft2corr for each parameter estimate, requesting
* exponentiated estimates (adjusted odds ratios).
deft2corr 1.7938 0.5310 2 1.4987 1
deft2corr 2.0390 0.5172 2 1.5098 1