Hello Stata Forum,
Thank you in advance for reading and contemplating this forum entry.
I am building a cross-classified multilevel logistic model with random effects on a 5000 case data set with 20 imputations to measure college completion for students from different towns and high schools using Stata 14.1.
Here is an example of the syntax or commands:
mi estimate, or: xtmelogit Completion Female FRL SAT FRL_TIITownRural SIISES SIIRigor TIITownVillage TIITownRural || _all: R.School || Town:
Description of priority variables: “Completion” is an indicator of college completion with dichotomous values; “School” and “Town” are identifying codes for the groups of schools and towns for each student; all of the level two variable titles begin with “SII” for school variables and “TII” for town variables; FRL_TIITownRural is an interaction between a student variable (dichotomous and at level 1) and a group variable (dichotomous and at level 2).
When started building the model, I used the syntax “_all: R.School || _all: R.Town” for level two groups, but encountered errors such as,
“Hessian is not negative semidefinite model did not converge on m=1 r(430)”
or
“could not calculate numerical derivatives -- discontinuous region with missing values encountered
could not calculate numerical derivatives -- discontinuous region with missing values encountered
model did not converge on m=1 r(430)” ,
depending on the level one variables added.
In an effort to be more computationally efficient, (according to the Stata Multi-level Mixed-Effects Manual 13, Rabe-Hesketh & Skrondal (2012), and entries in the Stata Forum,), I changed the syntax to “_all: R.School || Town:”. The level 2 group “School” has about 1/3 the number of clusters as “Towns”. The syntax yields results on a data set with 2 imputations, but not on a data set with 20 imputations. Depending on the variables added to the model, the analysis may run for dozens of hours without converging.
Questions:
1.Is there something additional I need to specify with the imputed data sets before running the xtmelogit command?
2.When I do receive results, “Schools” are represented as one group. ----------------------------------------------------------------------------
| No. of Observations per Group Integration
Group Variable | Groups Minimum Average Maximum Points
----------------+-----------------------------------------------------------
_all | 1 5,000 5,000.0 5,000 1
Town | 200 1 25.2 147 1
----------------------------------------------------------------------------
Are the random effects parameter estimates still interpretable as crossed effects for both School and Town, or only for one of the groups?
3.As I add more variables to the model, the standard error for Town increases substantially. I am not sure if this is due to estimation problems or an incorrectly specified covariance structure. Is there a way I can use the “covariance(unstructured)” option? I currently get “not allowed” r(198) error.
Your advice or guidance is appreciated.
Thank you,
Andrew
Rabe-Hesketh, S. & Skrondal, A. (2012). Multilevel and longitudinal modeling using Stata: Volume II: Categorical responses, counts, and survival 3rd edition. Stata Press: College Station, Texas
StataCorp. (2013). Stata multilevel mixed effects reference manual release 13. College Station, TX: StataCorp LP.
Thank you in advance for reading and contemplating this forum entry.
I am building a cross-classified multilevel logistic model with random effects on a 5000 case data set with 20 imputations to measure college completion for students from different towns and high schools using Stata 14.1.
Here is an example of the syntax or commands:
mi estimate, or: xtmelogit Completion Female FRL SAT FRL_TIITownRural SIISES SIIRigor TIITownVillage TIITownRural || _all: R.School || Town:
Description of priority variables: “Completion” is an indicator of college completion with dichotomous values; “School” and “Town” are identifying codes for the groups of schools and towns for each student; all of the level two variable titles begin with “SII” for school variables and “TII” for town variables; FRL_TIITownRural is an interaction between a student variable (dichotomous and at level 1) and a group variable (dichotomous and at level 2).
When started building the model, I used the syntax “_all: R.School || _all: R.Town” for level two groups, but encountered errors such as,
“Hessian is not negative semidefinite model did not converge on m=1 r(430)”
or
“could not calculate numerical derivatives -- discontinuous region with missing values encountered
could not calculate numerical derivatives -- discontinuous region with missing values encountered
model did not converge on m=1 r(430)” ,
depending on the level one variables added.
In an effort to be more computationally efficient, (according to the Stata Multi-level Mixed-Effects Manual 13, Rabe-Hesketh & Skrondal (2012), and entries in the Stata Forum,), I changed the syntax to “_all: R.School || Town:”. The level 2 group “School” has about 1/3 the number of clusters as “Towns”. The syntax yields results on a data set with 2 imputations, but not on a data set with 20 imputations. Depending on the variables added to the model, the analysis may run for dozens of hours without converging.
Questions:
1.Is there something additional I need to specify with the imputed data sets before running the xtmelogit command?
2.When I do receive results, “Schools” are represented as one group. ----------------------------------------------------------------------------
| No. of Observations per Group Integration
Group Variable | Groups Minimum Average Maximum Points
----------------+-----------------------------------------------------------
_all | 1 5,000 5,000.0 5,000 1
Town | 200 1 25.2 147 1
----------------------------------------------------------------------------
Are the random effects parameter estimates still interpretable as crossed effects for both School and Town, or only for one of the groups?
3.As I add more variables to the model, the standard error for Town increases substantially. I am not sure if this is due to estimation problems or an incorrectly specified covariance structure. Is there a way I can use the “covariance(unstructured)” option? I currently get “not allowed” r(198) error.
Your advice or guidance is appreciated.
Thank you,
Andrew
Rabe-Hesketh, S. & Skrondal, A. (2012). Multilevel and longitudinal modeling using Stata: Volume II: Categorical responses, counts, and survival 3rd edition. Stata Press: College Station, Texas
StataCorp. (2013). Stata multilevel mixed effects reference manual release 13. College Station, TX: StataCorp LP.
Comment