Marginal effects and polynomial terms


#1

Would value advice on obtaining marginal effects of variables fitted with polynomial terms.

df$year3<-df$year^3
count~year+year3+offset(log(PY)),family=poisson,data=df,

marginal_effects provides estimates for year and year3 separately, but can I obtain the effect of year allowing for year cubed too? Thanks for advice.


#2

I think you should use following formula:

count ~ year + I(year^3) + offset(log(PY)), family = poisson, data = df,

That said, I’m not sure if it makes more sense to also include the quadratic term?

count ~ year + I(year^2) + I(year^3) + offset(log(PY)), family = poisson, data = df,

#3

Exactly how Daniel says and I also agree that you should include the quadratic term as well.


#4

Excellent, thank you for the replies.