They are coding the variables as factors and using orthogonal
polynomial contrasts. This:

data.catapult <- data.frame(data.catapult$Distance,
do.call(data.frame, lapply(data.catapult[-1], factor, ordered=T)))
contrasts(data.catapult$h) <-
contrasts(data.catapult$s) <-
contrasts(data.catapult$l) <-
contrasts(data.catapult$e) <-
contr.poly(3, contrasts=F)
contrasts(data.catapult$b) <- contr.poly(2, contrasts=F)
lm1 <- lm(Distance ~ .^2, data=data.catapult)
summary(lm1)

gets you closer (same intercept at least), but I can't explain the
remaining differences. I'm not even sure why the results to look like
they do (interaction terms like "a*b" not "a:b" and one level for each
interaction).

Hope that helps,
Simon Knapp

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to