Skip to content

visreg is not ploting random effects with a mixed model #127

@guilherme-pantanal

Description

@guilherme-pantanal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions