0

Employing the lmerTest package in r, I am using the syntax below to run a stepwise selection on a mixed model containing 2 continuous predictors (Duration, PrevSegDuration), 1 categorical factor (PrevSeg), and 1 random effect factor (Respondent).

m1 <- lmer(TotalCount ~ Duration + PrevSeg + PrevSegDuration + (1|Respondent), d1) 
step.m1 <- step(m1, reduce.random=FALSE)

After successfully completing the full model, the following error appears without completing the step:

Error: number of rows in use has changed: remove missing values?

I am not sure what may cause the issue, though I believe this similar issue with steps in linear models may be relevant. Any insights into how step may lead to changes in the number of rows in a reduced model would be helpful. Thanks!

kangaroo_cliff
  • 6,067
  • 3
  • 29
  • 42
jjcii
  • 139
  • 3
  • 10
  • 1
    Did you read the answer in the linked question? I'd think it is the same issue here. – kangaroo_cliff Oct 15 '19 at 03:36
  • Re-checking my data, I found some previously unidentified missing values. The issue noted in the linked question indeed seemed to be the same issue here, as `step` now completes fine with those NAs now addressed. Thanks. – jjcii Oct 15 '19 at 04:47

0 Answers0