Skip to content

predictInterval: coefs[, 1:colIdx, lvl] : subscript out of bounds #101

@rdeneer

Description

@rdeneer

Below follows a hypothetical but reproducible example to generate this error. In this example the model does not make any sense but in my case this model does but I cannot share the data.

Image we take the sleepstudy data from lme4, and we define a binary Test variable for each subject which is randomly set to TRUE/FALSE:

sleepstudy$Test <- rep(sample(c(TRUE, FALSE), length(unique(sleepstudy$Subject)), replace = TRUE), each = 10)

Now we fit the following (nonsensical) model:

lmer.sleep <- lmer(Reaction ~ Days:Test + (0 + Days | Subject), data = sleepstudy2)

Then if I use the predictInterval function like so:
predictInterval(lmer.sleep, newdata = sleepstudy)

I get the following error:
Error in coefs[, 1:colIdx, lvl] : subscript out of bounds

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