Announcement

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

  • Normal values on y-axis when using logged data in marginsplot

    Hello Stata List users,

    I am trying to plot my predicted margins using the command marginsplot for a variable NfL that has been logged (logNfL) on the y-axis against Age on the x-axis.

    I would like to run the regression and predict the margins based on the logged NfL values, however I would like to graphically represent the y-axis on a non-logged scale. Would anyone know how to do this?

    Here is my code below:
    Code:
    regress logNfL Age CAG
    levelsof Age
    margins, at(Age=(`r(levels)')) saving(model_cag, replace)
    est store model_cag
    marginsplot, recast(line) noci plotopts(lcolor("cranberry'")) title("CAG") ytitle("NfL pg/mL")  xtitle("Age (years)") legend(off) aspectratio(1)

  • #2
    Perhaps consider poisson instead of linear regression to avoid such issues. See https://blog.stata.com/2011/08/22/us...tell-a-friend/

    Comment

    Working...
    X