Hi team,
I ran a multilevel mixed effect logistic regression model using the following code:
melogit Depression_Yes_No i.B_E##I_C Residential_status Age Gender Marital_status Education Ethnicity Occupation Income Living_arng Comorbidity DM_family_history Tobacco Alcohol Taking_insulin Taking_OHAs PA DM_duration Recode_hypertension Recode_med_adherence HbA1ctest Foot_care BMI HbA1c, or vce(robust) baselevel
margins B_E##I_C ///
marginsplot, allxlabels xscale(range(0 1)) ///
legend(order(0 "control" 1 "intervention")) xtitle("Time", size(small)) ///
ytitle("Probability", margin(zero) bmargin(zero) size(small)) ///
xlabel(0 "Baseline" 1 "Endline", angle(0) labsize(small)) ///
legend(pos(6) cols(3) size(small)) ylabel(,grid) title("Depression_Yes_No", size(medsmall)) ///
plot1opts(msymbol(S) lp(shortdash)) ///
plot2opts(msymbol(T) lp(longdash)) ///
graphregion(color(white))
contrast r.B_E@I_C, or
However, I get an error that says "command legend is unrecognized" and the graph came up with predicted mean instead of predictive probabilities.
Any help would be highly appreciated.
I ran a multilevel mixed effect logistic regression model using the following code:
melogit Depression_Yes_No i.B_E##I_C Residential_status Age Gender Marital_status Education Ethnicity Occupation Income Living_arng Comorbidity DM_family_history Tobacco Alcohol Taking_insulin Taking_OHAs PA DM_duration Recode_hypertension Recode_med_adherence HbA1ctest Foot_care BMI HbA1c, or vce(robust) baselevel
margins B_E##I_C ///
marginsplot, allxlabels xscale(range(0 1)) ///
legend(order(0 "control" 1 "intervention")) xtitle("Time", size(small)) ///
ytitle("Probability", margin(zero) bmargin(zero) size(small)) ///
xlabel(0 "Baseline" 1 "Endline", angle(0) labsize(small)) ///
legend(pos(6) cols(3) size(small)) ylabel(,grid) title("Depression_Yes_No", size(medsmall)) ///
plot1opts(msymbol(S) lp(shortdash)) ///
plot2opts(msymbol(T) lp(longdash)) ///
graphregion(color(white))
contrast r.B_E@I_C, or
However, I get an error that says "command legend is unrecognized" and the graph came up with predicted mean instead of predictive probabilities.
Any help would be highly appreciated.
Comment