I have age as a covariate in my material. A continuous variable. The age varies between 18-70 years.
I'm into a logistic regression and have decided to represent age as a polynomial.
In the data I have 4021 observations so then I just copied a piece of for you to see what they look like:
head(both)
gender passinggrade age prog
1 man FALSE 69 FRIST
2 man NA 70 FRIST
3 woman NA 65 FRIST
4 woman TRUE 68 FRIST
5 woman NA 65 NMFIK
6 man FALSE 70 FRIST
my model;
mod.fit<-glm(passinggrade ~prog+gender+age,family=binomial,data=both)
summary(mod.fit)
So what I'm wondering is, how should I do to treat age as a polynomial? Do not know if I need to change something in my R code? Have not done anything in R to 'make age a polynomial', my question is quite simple; how do you do it?