I am trying to add weights to my mixed-effects logistic regression model. I could use regression commands melogit or meqrlogit, but I don't know how to add weights to either.
So far, I have been working with simple logistic regression, and weighting with svyset and svy: . The difference is very significant depending on whether or not I weight the models. I expect the weighting to be similarly important with a mixed-effects logistic regression.
However, svyset and svy: do not seem to work in combination with melogit or meqrlogit (although I am not sure, as I find the help entry to be a bit confusing here).
So my question is whether somebody can tell me how to combine my weighting with either melogit or meqrlogit.
Here is the data and command information you may require:
My weighting variable
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double Compwt 2.09944 .41773 .36181 .87289 .41773 .87289 .41773 .87289 .36181 .87289 .36181 .87289 .87289 2.09944 .36181 .52707 .87289 .52707 .87289 .52707 .87289 2.09944 .87289 .87289 2.09944 .87289 2.09944 .87289 .87289 .52707 .36181 .52707 .52707 2.09944 2.09944 2.09944 .52707 .87289 .87289 .87289 2.09944 .87289 .87289 .87289 .36181 .36181 .87289 .54305 .52707 .52707 .87289 .87289 2.09944 .87289 .87289 .87289 .87289 .87289 .87289 .41773 .36181 2.09944 2.09944 .52707 .87289 .52707 .41773 .87289 .52707 .36181 2.09944 2.09944 .36181 .87289 .52707 .52707 2.09944 .52707 2.09944 .52707 .52707 .87289 .87289 .87289 .87289 .87289 .41773 .87289 .54305 .87289 2.09944 .87289 2.09944 .36181 .36181 .52707 .87289 .87289 .52707 .36181 end label values Compwt Compwt
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float childcare 0 0 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 1 0 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1 0 1 0 1 . 1 0 1 0 0 0 . 1 0 0 1 0 1 1 1 1 1 1 0 1 0 1 0 0 1 1 1 0 1 0 0 0 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 end label values childcare childcare label def childcare 0 "Not provided", modify label def childcare 1 "Provided", modify
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float p_regime 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 end label values p_regime p_regime label def p_regime 1 "Pre-K only", modify label def p_regime 2 "Both", modify
Code:
svyset [pweight = Compwt]
Code:
svy: logit childcare i.p_regime i.skillprofile gdp size fem_execs
Many thanks for your time and consideration.
0 Response to Applying weights to mixed-effects logistic regression model
Post a Comment