Hi,
I am calculating a linear regression model with an interaction effect between the migration background of the respondents and his or her income, which I log-transformed and centered beforehand.
Now I want to generate a margins plot to show the interaction effect. Usually, I would do something like this:
This works, but the X-axis represents the income variable that was log-transformed and centered. This makes it pretty hard to interpret. Is there a way to generate the marginsplot with the original variable (“income”)?
If I introduce it in the command, I get an error message that the untransformed variable was not found in the list of covariates.
Does someone know how to do generate a marginsplot with the untransformed variable?
Thank you!
I am calculating a linear regression model with an interaction effect between the migration background of the respondents and his or her income, which I log-transformed and centered beforehand.
Code:
regress attitude b4.migback##c.ln_income_c sex age hhsize, cf(%9.2f) vce(cluster hid)
Code:
margins, at(ln_income_c=(-2(0.5)1) migback=(1, 4)) marginsplot, recast(line) recastci(rarea)
If I introduce it in the command, I get an error message that the untransformed variable was not found in the list of covariates.
Code:
margins, at(income=(0(500)3500) migback=(1, 4)) variable income not found in list of covariates
Thank you!
Comment