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:
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)
Comment