The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » General » Multilevel modeling (Problems with svy:melogit command while using weights)
Multilevel modeling [message #24792] Tue, 12 July 2022 00:20 Go to previous message
w@dhs
Messages: 8
Registered: December 2019
Member
We are following your recent guidelines in'MULTILEVEL MODELING USING DHS SURVEYS: A FRAMEWORK TO APPROXIMATE LEVEL-WEIGHTS' file for weights calculation for domestic violence modules. So, for example,for Maldives, I've tried the following steps.
gen a_c_h=.
quietly levelsof v022, local(lstrata)
quietly foreach ls of local lstrata {
tab v021 if v022==`ls', matrow(T)
scalar stemp=rowsof(T)
replace a_c_h=stemp if v022==`ls'
}

gen A_h = 0
replace A_h =433 if v022 == 1.... to replace A_h = 54 if v022 == 21
gen M_h = 0
replace M_h =51 if v022 == 1....replace M_h = 68 if v022 == 21

gen m_c= 928
gen M = 58277
gen S_h = 25
(*** I have applied wt already so, I skipped this step gen wgt = v005 / 1000000)

gen d_IR = wgt * (M/m_c)
gen f = d_IR / ((A_h/a_c_h) * (M_h/S_h))

local alphas 0 0.1 .25 .50 .75 0.90 1
local i = 1
foreach dom of local alphas{
gen wt2_`i' = (A_h/a_c_h)*(f^`dom')
gen wt1_`i' = d_IR/wt2_`i'
local ++i
}

Then, I tried with the following
svyset v001, weight(wt2_4) strata(v022) , singleunit(centered) || _n, weight(wt1_4)
svy: melogit outcome var i.indpendent var i.independent var i.independent var || v001:

I've got "no observation". So, I re-run the lines "local i=1, ..} separately or all together. Sometimes, I've got the results with only a coefficient without SEs, P-value, and 95% CI results.

But, if I run without svy: in front of melogit, it gives me the result. But when I run post estimation command without svy, the AIC and BIC value are the same for all models (I have 4 models: null model, and using variables of different levels), which does not make sense.
Q1: How can I fix it?

Q2: Also, I used svy:melogit. But, in such case, STATA does not allow to use the post estimation command estat ic, n(#).
The results showed when I omit svy command, again, the AIC and BIC values are the same. W
Any suggestion for fixing it.

Thank you so much.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Trend analysis with different number of 'PSU' and 'Strata'
Next Topic: Variable v034: merging datasets
Goto Forum:
  


Current Time: Mon Dec 9 05:08:43 Coordinated Universal Time 2024