What does the I do in formulas?
Posted: Tue Feb 06, 2018 9:40 am
I noticed that in some formulas, there is an I before a new term, for instance:
Do I need to add this "I" every time I include a new variable?
So for instance if I would add an interaction it would be:
Code: Select all
(mymodel11 <- runMLwiN(logit(a_point, cons, 6) ~ 1 + gcseavnormal[1:5] + gender[1:5] + I(gcseavnormal^2)[1:5] + (1[1:5] | school),
D = "Ordered Multinomial", estoptions = list(nonlinear = c(N = 1, M = 2)), data = alevchem))
So for instance if I would add an interaction it would be:
Code: Select all
(mymodel <- runMLwiN(logit(a_point, cons, 6) ~ 1 + gcseavnormal[1:5] + gender[1:5] + I(gsceavnormal*gender)[1:5] + (1[1:5] | school),
D = "Ordered Multinomial", estoptions = list(nonlinear = c(N = 1, M = 2)), data = alevchem))