[R] Different random intercepts but same random slope for groups

li li hannah.hlx at gmail.com
Tue Jun 9 21:57:34 CEST 2015


Hi all,
  I'd like to fit a random intercept and random slope model. In my
data, there are three groups. I want to have different random
intercept for each group but the same random slope effect for all
three groups. I used the following R command.
However, there seems to be some problem. Any suggestions?



mod2 <- lmer(result  ~ group*time+(0+group1+ group2 +
group3+time|lot), na.action=na.omit, data=alldata)

> summary(mod2)
Model is not identifiable...
summary from lme4 is returned
some computational error has occurred in lmerTest
Linear mixed model fit by REML ['merModLmerTest']
Formula: result ~ group * time + (0 + group1 + group2 + group3 + time |
    lot)
   Data: alldata

REML criterion at convergence: 807.9

Scaled residuals:
    Min      1Q  Median      3Q     Max
-3.0112 -0.3364  0.0425  0.2903  3.2017

Random effects:
 Groups   Name     Variance Std.Dev. Corr
 lot      group1   0.00000 0.000
          group2   86.20156 9.284      NaN
          group3 55.91479 7.478      NaN  0.06
          time      0.02855 0.169      NaN -0.99  0.10
 Residual          39.91968 6.318
Number of obs: 119, groups:  lot, 15

Fixed effects:
                            Estimate Std. Error t value
(Intercept)                 100.1566     2.5108   39.89
group  group2        -2.9707     3.7490   -0.79
group  group3           -0.0717     2.8144   -0.03
time                         -0.1346     0.1780   -0.76
group  group2 :time   0.1450     0.2939    0.49
group  group3:time        0.1663     0.2152    0.77

Warning messages:
1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.147314 (tol = 0.002, component 2)
2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge: degenerate  Hessian with 2 negative eigenvalues



More information about the R-help mailing list