Skip to content
Prev 4554 / 20628 Next

lmer give error message

Hi John,
pid     visit       eye         y 
"integer" "integer"  "factor" "integer" 

Part of the issue is that the modeling machinery is set up
to work with factor variables.  lmer does not always convert
numerics to integers.  Set up factor versions of your
independent variable groups.
Linear mixed model fit by REML 
Formula: y ~ 1 + (1 | fpid/fvisit) + (1 | fpid/eye) 
   Data: dat 
  AIC  BIC logLik deviance REMLdev
 2848 2875  -1418     2835    2836
Random effects:
 Groups      Name        Variance Std.Dev.
 fvisit:fpid (Intercept) 0.92510  0.96182 
 eye:fpid    (Intercept) 0.51945  0.72073 
 fpid        (Intercept) 4.02193  2.00547 
 fpid        (Intercept) 4.02191  2.00547 
 Residual                0.89761  0.94742 
Number of obs: 718, groups: fvisit:fpid, 359; eye:fpid, 240; fpid, 120

Fixed effects:
            Estimate Std. Error t value
(Intercept)   4.0648     0.2702   15.04
Error in function (fr, FL, start, REML, verbose)  : 
  Number of levels of a grouping factor for the random effects
must be less than the number of observations

Issues of model specification, number of observations
per group, and groups missing data remain
to be worked out.
, , eye = L

     fvisit
fpid  0 1 2
  1   1 1 1
  2   1 1 1
  3   1 1 1
...
  37  1 1 1
  38  1 0 1
  39  1 1 1
...
  119 1 1 1
  120 1 1 1

, , eye = R

     fvisit
fpid  0 1 2
  1   1 1 1
  2   1 1 1
  3   1 1 1
  4   1 1 1
  5   1 1 1
...
  117 1 1 1
  118 1 1 1
  119 1 1 1
  120 1 1 1



Steven McKinney