visreg icon indicating copy to clipboard operation
visreg copied to clipboard

visreg is not ploting random effects with a mixed model

Open guilherme-pantanal opened this issue 8 months ago • 2 comments

I am trying to run the example provide in http://pbreheny.github.io/visreg/articles/web/mixed.html: library(visreg); library(lme4, quietly=TRUE)

data(Milk, package="nlme")

ctrl <- lmerControl(optCtrl=list(xtol_rel=1e-6)) # Warning otherwise

fit <- lmer(protein ~ Diet + Time + (Time|Cow), Milk, control=ctrl)

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

However, it is not working and I receive the following message error (translated from Portuguese): 'Error in h(simpleError(msg, call)) : error evaluating argument 'x' when selecting method for function 'rowSums': 'non-conformable arguments'

What's going wrong?

Obs: I am using the package ‘lme4’ built under R version 4.3.3; package ‘Matrix’ built under R version 4.3.1; ‘visreg’ version 2.7.0 and Windows 11 Pro 22H2

guilherme-pantanal avatar Jun 19 '24 18:06 guilherme-pantanal