Skip to content
Prev 13855 / 20628 Next

contrasts among simple effects

I think we tend to highly overrate the idea of trying to engineer factor codings in order to get estimates of interesting contrasts among the regression coefficients. It gets confusing when there are multiple factors, and often, only some of the contrasts of interest can be estimated this way unless more than one version of the model is fitted. There are good packages that can handles such things -- multcomp, lsmeans, effects, etc. With your example, you could do, for example:

	library(lsmeans)
	lsm <- lsmeans(model2a, ~ drug | time)
	lsm 
	pairs(lsm)                   # compare drugs at each time
	pairs(lsm, by = "drug")  # compare times for each drug

Russ
--
Russell V. Lenth ?- ?Professor Emeritus
Department of Statistics and Actuarial Science ??
The University of Iowa ?- ?Iowa City, IA 52242 ?USA ??
Voice (319)335-0712 ?- ?FAX (319)335-3017
russell-lenth at uiowa.edu??- ?http://www.stat.uiowa.edu/~rlenth/?