Skip to content
Prev 17268 / 20628 Next

Plotting interactions while controlling for other predictors.

Hi David,

For plotting interactions between two continuous variables, maybe a gamm
model might be more adapted?

However, by defaut, in the visreg package, you can facet one of your
continuous variables (which is subsetted relative to its distribution) and
plot the other one accordingly.

This would be coded the following way: visreg(m1, X2, by="X3")
#overlay=TRUE to have them all combined in one plot, partial=TRUE to have
the partial residuals (which do not include RE by default), by default X1
will be fixed to its median

This will produce a conditional plot in which all random effects (or X1 in
this case) are fixed at a certain level (you can also fix this at a
particular value with cond=list(X1=XXXX) ).

Nevertheless, this simply calls for predict.lmer(). It is still pretty
convenient IMHO.

Hope this helps.

Sincerely,

GA2

Le mer. 12 d?c. 2018 ? 17:51, David Sidhu <dsidhu at ucalgary.ca> a ?crit :