Home » Topics » General » Multilevel modeling (Problems with svy:melogit command while using weights)
Multilevel modeling [message #24792] |
Tue, 12 July 2022 00:20 |
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.
|
|
|
|
Re: Multilevel modeling [message #24838 is a reply to message #24818] |
Mon, 18 July 2022 21:08 |
w@dhs
Messages: 8 Registered: December 2019
|
Member |
|
|
Thank you so much. It helps. However, I still have two more questions related to the Philippines and Nepal data.
I am aware that there are some previous responses related to the Philippines. However, I still need to have some clarification. Please kindly see the file attached.
Very much appreciated.
Sincerely
w
[Updated on: Mon, 18 July 2022 21:09] Report message to a moderator
|
|
|
Re: Multilevel modeling [message #24865 is a reply to message #24838] |
Thu, 21 July 2022 12:31 |
Janet-DHS
Messages: 852 Registered: April 2022
|
Senior Member |
|
|
Following is a response from DHS Senior Sampling Specialist, Mahmoud Elkasabi:
Regarding the Philippines, you need to change tabulate (99) to tabulate (118) or to any number that is larger than 117 so all values/labels get printed.
Regarding Nepal, it looks like your problem is related to the melogit not to the clusters weight. Unfortunately, we cannot advise on that. However, I see from the error that it is related to the region codes; I would advise you to check the region variable.
|
|
|
Goto Forum:
Current Time: Fri Oct 4 10:49:32 Coordinated Universal Time 2024
|