Would value advice on obtaining marginal effects of variables fitted with polynomial terms.
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.
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,
Exactly how Daniel says and I also agree that you should include the quadratic term as well.
Excellent, thank you for the replies.