Skip to content

Plotting interactions while controlling for other predictors.

1 message · John Fox

#
Dear David,

You've already received a couple of suggestions to use the effects package. To clarify, the functions in the package can handle models fit by lmer() (for which it will plot fixed effects) with both factors and numeric predictors, interactions of arbitrary complexity, terms in numeric predictors with transformations, polynomials, and regression splines, and can add partial residuals and nonparametric smooths to the plot. 

See the help pages (in particular ?Effect, ?predictorEffect, and ?plot.eff) and vignettes for the package; there's a recent Journal of Statistical Software article describing partial residuals in effect plots and a book (Fox and Weisberg, An R Companion to Applied Regression, 2nd edition) with many examples.

I hope this helps,
 John

--------------------------------------
John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: socialsciences.mcmaster.ca/jfox/