Skip to content
Prev 298988 / 398503 Next

Specify model with polynomial interaction terms up to degree n

Hello,

Sorry, but it was you that misread some of the suggestions. I have 
written raw=TRUE not raw=raw. Just see


m <- matrix(1:6, ncol=2)  # your example

p2 <- poly(m, degree=2, raw=TRUE) # it's raw=TRUE, not raw=raw !!!
deg2 <- attr(p2, 'degree') == 2
p2[, deg2]

p6 <- poly(m, degree=6, raw=TRUE) # now degree 6
deg6 <- attr(p6, 'degree') == 6
p6[, deg6]


Hope this helps,

Rui Barradas

Em 02-07-2012 23:52, YTP escreveu: