Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • plotting additive interaction after mixed effect ordinal regression (meologit)

    Hi everyone,

    In a nutshell, I have the following model for which I would like to automatically compute the changing OR and CI for the effect of treatment (treat2c=1) over time (fui=0,1,3,5,7,10,15). I would then like to use calculated numbers to produce a line plot with surrounding confidence intervals.

    I can compute the OR and CI manually, but I would very much prefer to learn how to directly produce those results. I also understand that marginplot would be quite useful if my outcome was linear or even binary. However, given that the outcome is ordinal, this command results in a separate output per outcome level. This isn't exactly what I'm looking for. Any idea on how to code this?

    The model:
    meologit tr i.treat2c##c.fui i.trpre i.rvdilpre i.rvsdpre aac creptvr clead pvd ceps, || id: fui, vce(robust) or

    Click image for larger version

Name:	model.png
Views:	1
Size:	96.3 KB
ID:	1492875

  • #2
    So, I figured out part of the answer. The command lincom seems to be an easy way to automatically compute linear interactions.

    lincom 1.treat2c, or
    lincom 1.treat2c + 1.treat2c#c.fui, or
    lincom 1.treat2c + 3*1.treat2c#c.fui, or
    lincom 1.treat2c + 5*1.treat2c#c.fui, or
    etc.

    Now, any idea on how to save these different outputs (b, upper CI limit and lower CI limit) into a single dta file through commands and use it as a source for a graph?

    Thank you very much

    Comment


    • #3
      I don't really understand #1; for #2, see
      Code:
      help lincom
      and skip to the bottom to see what Stata saves - you can then save the results you want (in a variable? or a local? or ...?) and use them as you wish

      Comment


      • #4
        Thanks a lot. I tried initially saving results following the lincom command but stata didn't recognized confidence intervals as either scalars or return. However, I found 2 packages (lincomest and parmest) which were designed to address this problem.

        https://ideas.repec.org/c/boc/bocode/s430901.html

        Code:
        quietly: meologit tr i.treat2c##c.fui i.trpre i.rvdilpre i.rvsdpre aac creptvr clead pvd ceps, || id: fui, vce(robust)
        lincomest 1.treat2c,eform(OR)
        parmest,label saving(lincom0.dta,replace) eform
        Then, I appended all created files and could use the final dta to plot OR with CI.

        Comment

        Working...
        X