Page 1 of 1

'predict' after runmlwin

Posted: Tue Jun 01, 2021 6:55 am
by GeorgeStevens
Hi Statalist,

I am running a cross classified model using runmlwin. Previously, I had used meqrlogit and then I used the following code to predict fixed and random effects and to graph them:

predict v0*, reffects
predict v0se*, reffects
predict probAll
predict pfx, xb

gen probPeriod = 1 /(1+exp(-1*(pfx + v01)))
gen probPrL = probPeriod-1.96*v0se1
gen probPrU = probPeriod+1.96*v0se1

collapse (mean) probP = probPeriod (semean) probPs = probPeriod, by(Period)
gen probPrL = probP-1.96*probPs
gen probPrU = probP+1.96*probPs

twoway (connected probP Period, mcolor(black) lcolor(black)) ///
(connected probPrL Period, mcolor(black) lcolor(black) lpattern(dash)) ///
(connected probPrU Period, mcolor(black) lcolor(black) lpattern(dash)), ///
ytitle(Predicted probability with 95% confidence band) xtitle(Period) xlabel(#3) legend(off)

In an attempt to predict and graph my results using runmlwin I tried the following code:

runmlwin ID cons, level2(Period:cons, , residuals(v)) level1(Cohort: cons, residuals(u)) discrete(dist(binomial) link(logit) denom(denom)) mcmc(cc) initsprevious nopause
which returns error: invalid ’residuals’

Would anyone be able to provide any insight into how to calculate this when using the runmlwin package? Thanks.