can't proceed to multiple membership model
Posted: Wed Aug 22, 2012 4:25 am
Hi.
Using panel data, I am trying to estimate a logistic model (on the probability of a residential move) that varies according to an individual's hhld membership: (single-person household vs. couple/multiple-member hhld) (Kindly see attached file equation.jpg). I have 35 explanatory variables. Since, over time an individual will move to different households, I suspect that the random effects for the single-hhlds will be correlated with the random effects for those who are in multiple-member hhld.
To allow variation according to hhld membership, I created two sets of explanatory variables using the stata codes below. Hence, instead of the original 35 explanatory variables, now I have 70 X's.
foreach x of varlist x1 - x35 {
g `x'_C = `x' if single_multiple == 0
replace `x'_C = 0 if single_multiple == 1
g `x'_S = `x' if single_multiple== 1
replace `x'_S = 0 if single_multiple == 0
}
g Xsingle = multiple == 1
g Xmultiple = multiple == 0
sort individual_id survey_round
runmlwin y Xsingle Xmultiple x1_S - X35_S X1_C - X35_C, level2(individual_id: Xsingle Xmultiple) level1(survey_round:) discrete(distribution(binomial) link(logit) denominator(cons) pql2) nopause
When I estimated the model (using pql2), I get sensible results for the fixed part and the random part of the model. However, I get the following results for the random parts:
Xlone -1.20876
Xmultiple -2.16036
X~3_dummy2_S 0.833651
Xduratio~2_S -0.2658277
Xduratio~3_S -0.7484888
Xduratio~4_S -0.9980441
Xduratio~5_S -1.107969
Xduratio~6_S -1.040654
Xduratio~7_S -1.198664
Xduratio~8_S -1.012838
Xduratio~9_S -1.051786
Xduratio~0_S -1.305826
Xage_S -0.0370093
Xagesq_S 0.0004113
Xsex_S -0.0564445
Xunion_for~S 1.163148
Xcount_d~2_S -0.0704926
Xcount_d~3_S -0.2510984
XYounges~2_S -0.0355757
XYounges~3_S -0.1854347
XYounges~4_S -0.0609936
Xbirth_o~2_S 0.1123636
Xbirth_o~3_S 0.3094418
Xbirth_o~4_S 0.1860407
Xbachelor_S 0.0104119
Xemployed_S 0.0781567
Xdisposabl~S -0.0136075
Xrooms_f~2_S -0.3622691
Xrooms_f~3_S -0.3467808
Xrooms_f~4_S -0.2675135
Xstate_d~2_S 0.0098394
Xstate_d~3_S 0.2527815
Xstate_d~4_S -0.1358728
Xstate_d~5_S 0.011654
Xstate_d~6_S -0.0160611
Xstate_d~7_S 0.5865496
Xstate_d~8_S 0.0413127
Xremote_~2_S 0.1837123
Xremote_~3_S 0.0382212
Xremote_~4_S 0.0971053
X~3_dummy2_C 1.325249
Xduratio~2_C -0.2336334
Xduratio~3_C -0.3403614
Xduratio~4_C -0.4833024
Xduratio~5_C -0.6244527
Xduratio~6_C -0.6558545
Xduratio~7_C -0.763012
Xduratio~8_C -0.5978259
Xduratio~9_C -0.9004535
Xduratio~0_C -1.090067
Xage_C -0.0292599
Xagesq_C 0.0002226
Xsex_C -0.0051237
Xliving_wi~C 0.1740561
Xunion_for~C 2.791115
Xunion_dis~C 1.651798
Xcount_d~2_C 0.1020503
Xcount_d~3_C -0.0524026
XYounges~2_C -0.1085454
XYounges~3_C -0.2272663
XYounges~4_C -0.4325886
Xbirth_o~2_C 0.0589249
Xbirth_o~3_C 0.2571513
Xbirth_o~4_C 0.0725413
Xbachelor_C 0.0805691
Xbachel~er_C 0.0614389
Xemployed_C 0.067457
Xemploye~r_C -0.0838872
Xdisposabl~C 0.0134741
Xrooms_f~2_C -0.1373251
Xrooms_f~3_C -0.0143071
Xrooms_f~4_C 0.2658966
Xstate_d~2_C -0.0605082
Xstate_d~3_C 0.1859525
Xstate_d~4_C -0.2454838
Xstate_d~5_C 0.0804148
Xstate_d~6_C 0.0089504
Xstate_d~7_C 0.0593975
Xstate_d~8_C -0.0818213
Xremote_~2_C 0.1057225
Xremote_~3_C 0.2880648
Xremote_~4_C 0.3106011
var(Xsingle) 0.1495671
cov(Xsingle,Xmultiple) 0.1146221
var(Xsingle) 0.1297719
Since I suspect that other household members within the household might influence the decision of an individual to move, I tried estimating a multiple membership model using the following code:
sort individual_id survey_round
runmlwin y Xsingle Xmultiple x1_S - X35_S X1_C - X35_C, level2(individual_id: Xlone Xmultiple, mmids(individual_id id_mem2 id_mem3 id_mem4 id_mem5 id_mem6) mmweights(weight_mem1 /// weight_mem2 weight_mem3 weight_mem4 weight_mem5 weight_mem6)) level1(survey_round:) discrete(distribution(binomial) link(logit) denominator(cons)) /// mcmc(burnin(1000) chain(10000)) initsprevious nopause mlwinpath(C:\Program Files\MLwiN v2.25\mlwin.exe)
However, mlwin keeps on returning an error message that says: "matrix must be positive definite for inversion". I am not sure what is causing this. The correlation between the two random effects in the previous model is within the unit circle (0.82). I also checked the diagonal elements of the system matrix e(V) and all of them are non-zero and positive (except for the last column which is 0 for var(bcons_1) which seems to be natural since I am using a logistic model).
Thank you very much for your insights.
Using panel data, I am trying to estimate a logistic model (on the probability of a residential move) that varies according to an individual's hhld membership: (single-person household vs. couple/multiple-member hhld) (Kindly see attached file equation.jpg). I have 35 explanatory variables. Since, over time an individual will move to different households, I suspect that the random effects for the single-hhlds will be correlated with the random effects for those who are in multiple-member hhld.
To allow variation according to hhld membership, I created two sets of explanatory variables using the stata codes below. Hence, instead of the original 35 explanatory variables, now I have 70 X's.
foreach x of varlist x1 - x35 {
g `x'_C = `x' if single_multiple == 0
replace `x'_C = 0 if single_multiple == 1
g `x'_S = `x' if single_multiple== 1
replace `x'_S = 0 if single_multiple == 0
}
g Xsingle = multiple == 1
g Xmultiple = multiple == 0
sort individual_id survey_round
runmlwin y Xsingle Xmultiple x1_S - X35_S X1_C - X35_C, level2(individual_id: Xsingle Xmultiple) level1(survey_round:) discrete(distribution(binomial) link(logit) denominator(cons) pql2) nopause
When I estimated the model (using pql2), I get sensible results for the fixed part and the random part of the model. However, I get the following results for the random parts:
Xlone -1.20876
Xmultiple -2.16036
X~3_dummy2_S 0.833651
Xduratio~2_S -0.2658277
Xduratio~3_S -0.7484888
Xduratio~4_S -0.9980441
Xduratio~5_S -1.107969
Xduratio~6_S -1.040654
Xduratio~7_S -1.198664
Xduratio~8_S -1.012838
Xduratio~9_S -1.051786
Xduratio~0_S -1.305826
Xage_S -0.0370093
Xagesq_S 0.0004113
Xsex_S -0.0564445
Xunion_for~S 1.163148
Xcount_d~2_S -0.0704926
Xcount_d~3_S -0.2510984
XYounges~2_S -0.0355757
XYounges~3_S -0.1854347
XYounges~4_S -0.0609936
Xbirth_o~2_S 0.1123636
Xbirth_o~3_S 0.3094418
Xbirth_o~4_S 0.1860407
Xbachelor_S 0.0104119
Xemployed_S 0.0781567
Xdisposabl~S -0.0136075
Xrooms_f~2_S -0.3622691
Xrooms_f~3_S -0.3467808
Xrooms_f~4_S -0.2675135
Xstate_d~2_S 0.0098394
Xstate_d~3_S 0.2527815
Xstate_d~4_S -0.1358728
Xstate_d~5_S 0.011654
Xstate_d~6_S -0.0160611
Xstate_d~7_S 0.5865496
Xstate_d~8_S 0.0413127
Xremote_~2_S 0.1837123
Xremote_~3_S 0.0382212
Xremote_~4_S 0.0971053
X~3_dummy2_C 1.325249
Xduratio~2_C -0.2336334
Xduratio~3_C -0.3403614
Xduratio~4_C -0.4833024
Xduratio~5_C -0.6244527
Xduratio~6_C -0.6558545
Xduratio~7_C -0.763012
Xduratio~8_C -0.5978259
Xduratio~9_C -0.9004535
Xduratio~0_C -1.090067
Xage_C -0.0292599
Xagesq_C 0.0002226
Xsex_C -0.0051237
Xliving_wi~C 0.1740561
Xunion_for~C 2.791115
Xunion_dis~C 1.651798
Xcount_d~2_C 0.1020503
Xcount_d~3_C -0.0524026
XYounges~2_C -0.1085454
XYounges~3_C -0.2272663
XYounges~4_C -0.4325886
Xbirth_o~2_C 0.0589249
Xbirth_o~3_C 0.2571513
Xbirth_o~4_C 0.0725413
Xbachelor_C 0.0805691
Xbachel~er_C 0.0614389
Xemployed_C 0.067457
Xemploye~r_C -0.0838872
Xdisposabl~C 0.0134741
Xrooms_f~2_C -0.1373251
Xrooms_f~3_C -0.0143071
Xrooms_f~4_C 0.2658966
Xstate_d~2_C -0.0605082
Xstate_d~3_C 0.1859525
Xstate_d~4_C -0.2454838
Xstate_d~5_C 0.0804148
Xstate_d~6_C 0.0089504
Xstate_d~7_C 0.0593975
Xstate_d~8_C -0.0818213
Xremote_~2_C 0.1057225
Xremote_~3_C 0.2880648
Xremote_~4_C 0.3106011
var(Xsingle) 0.1495671
cov(Xsingle,Xmultiple) 0.1146221
var(Xsingle) 0.1297719
Since I suspect that other household members within the household might influence the decision of an individual to move, I tried estimating a multiple membership model using the following code:
sort individual_id survey_round
runmlwin y Xsingle Xmultiple x1_S - X35_S X1_C - X35_C, level2(individual_id: Xlone Xmultiple, mmids(individual_id id_mem2 id_mem3 id_mem4 id_mem5 id_mem6) mmweights(weight_mem1 /// weight_mem2 weight_mem3 weight_mem4 weight_mem5 weight_mem6)) level1(survey_round:) discrete(distribution(binomial) link(logit) denominator(cons)) /// mcmc(burnin(1000) chain(10000)) initsprevious nopause mlwinpath(C:\Program Files\MLwiN v2.25\mlwin.exe)
However, mlwin keeps on returning an error message that says: "matrix must be positive definite for inversion". I am not sure what is causing this. The correlation between the two random effects in the previous model is within the unit circle (0.82). I also checked the diagonal elements of the system matrix e(V) and all of them are non-zero and positive (except for the last column which is 0 for var(bcons_1) which seems to be natural since I am using a logistic model).
Thank you very much for your insights.