According to the documentation of melogit there are 2 ways to specify random effects in a mixed effects logistic regression model:
for random coefficients and intercepts
levelvar: [varlist] [, re_options]
for random effects among the values of a factor variable
levelvar: R.varname
I have used the dataset http://www.stata-press.com/data/r13/bangladesh to fit a mixed effects model to estimate the effect of urban (yes/no) on the use of contraception (c_use), allowing the effect to vary by district (i.e., a random slope model) using the following command:
melogit c_use urban || district:urban, noconstant
the default integration method is mean-variance adaptive Gauss-Hermite quadrature (mvaghermite) with 7 integration points. The estimates of the variance of the random effect and the fixed effect of urban I obtained from this command are different from fitting the same random slope model in R and SAS with the same integration methods. However when I used the following command the results from the three software package are exactly the same:
melogit c_use urban || district:R.urban
I will appreciate any helps to explain the different results I got in using these two commands. Also, why only the second command produced the same results as R and SAS.
Thank you.
Bei Chang
for random coefficients and intercepts
levelvar: [varlist] [, re_options]
for random effects among the values of a factor variable
levelvar: R.varname
I have used the dataset http://www.stata-press.com/data/r13/bangladesh to fit a mixed effects model to estimate the effect of urban (yes/no) on the use of contraception (c_use), allowing the effect to vary by district (i.e., a random slope model) using the following command:
melogit c_use urban || district:urban, noconstant
the default integration method is mean-variance adaptive Gauss-Hermite quadrature (mvaghermite) with 7 integration points. The estimates of the variance of the random effect and the fixed effect of urban I obtained from this command are different from fitting the same random slope model in R and SAS with the same integration methods. However when I used the following command the results from the three software package are exactly the same:
melogit c_use urban || district:R.urban
I will appreciate any helps to explain the different results I got in using these two commands. Also, why only the second command produced the same results as R and SAS.
Thank you.
Bei Chang
Comment