post hoc test following linear mixed effect regression: stata code?

99 views Asked by At

I am trying to figure out the code to do a post hoc test (Bonferroni adjusted) in Stata following my linear mixed effects model. I believe the margins command can be used? Does anyone know how I can do this?

My code below didn't work, error: option bonferroni not allowed. All pe has three groups, and I want to see the differences between groups in final_hc variable

mixed final_hc age0 age0_2 all_pe || cidb3035: age0, cov(unstructured)

// Estimate marginal means
margins, at(all_pe=(0 1 2)) post

// Adjust for multiple comparisons (Bonferroni)
adjust all_pe: margins, bonferroni

i have since tried this:

margins r.all_pe, plot  

But i am still unsure how to get the Bonferroni correction. i needed to add i. to all_pe (i.all_pe) in my first model to make this work.

0

There are 0 answers