pbreheny / visreg

Visualization of regression functions
http://pbreheny.github.io/visreg/
61 stars 18 forks source link

Incompatible with MuMIn for mixed models #77

Closed pbreheny closed 3 years ago

pbreheny commented 4 years ago

Current visreg() crashes:

library (lme4)
library (visreg)
library (MuMIn)
data (Milk, package = "nlme")
fit <- lmer (protein ~ Diet + Time + (Time | Cow), Milk)
v <- visreg (fit, "Time", by = "Cow", re.form = ~ (Time | Cow), plot = FALSE)
# Error: cannot calculate predictions with both standard errors and random effects

User should be able to turn off se.fit in this case:

v <- visreg (fit, "Time", by = "Cow", re.form = ~ (Time | Cow), plot = FALSE, se.fit=FALSE)

but visreg() does not currently allow this (formal argument "se.fit" matched by multiple actual arguments).