[R-sig-ME] Syntax interaction polynomial term

Luca Corlatti luca.corlatti at boku.ac.at
Tue May 16 09:58:12 CEST 2017


Dear list members, I am trying to fit some models to investigate the effects of some predictors (weight, age) on fertility.
As the effect of age on fertility is typically quadratic (lower fertility for the extreme age-classes and higher fertility for intermediate age-classes), I fitted the full additive model as:


fertility ~ weight + poly(age, 2, raw=TRUE)


I would also like to fit a model with an interaction term between weight and age, but I fail to understand the correct syntax. Should the interaction be between weight and the full polynomial term:


fertility ~ weight * poly(age, 2, raw=TRUE)


or should it simply be between weight and the age^2?


fertility ~ weight + age + I(age^2) + weight : I(age^2)


Cheers, 
Luca



More information about the R-sig-mixed-models mailing list