[R] Bug in lmer?

Mark Lyman mlyman at byu.edu
Thu Sep 29 22:44:38 CEST 2005


I am relatively new to R so I am not confident enough in what I am doing 
to be certain this is a bug. I am running R 2.1.1 on a Windows XP 
machine and the lme4 package version 0.98-1. The following code fits the 
model I want using the nlme package version 3.1-60.

mltloc$loc <- factor(mltloc$loc)
mltloc$block <- factor(mltloc$block)
mltloc$trt <- factor(mltloc$trt)
Mltloc <- groupedData(adg~trt|loc,mltloc)
plot(Mltloc)
plot(Mltloc,outer=~trt)

lme(adg~trt,
random=pdBlocked(list(pdIdent(~1),pdIdent(~block-1),pdIdent(~trt-1))),Mltloc)

The problem is that when I try fitting the model using the lmer function 
with the following code:

lmer(adg~trt+(1|loc)+(1|block:loc)+(1|loc:trt),mltloc)

I get this message from Windows and R closes.

R for Windows GUI front-end has encountered a problem and needs to 
close.  We are sorry for the inconvenience.

This same code works on a Macintosh. So it doesn't seem that I have made 
an error in my code. Also if anyone of the random effect terms is 
removed there is no problem. Is this something that is being looked at? 
Or I have I made a mistake somewhere? I have included the data that I am 
using below.


      X obs loc block trt     adg      fe
1     1   3   A     1   3 3.16454  7.1041
2     2   4   A     1   4 3.12500  6.6847
3     3   6   A     1   2 3.15944  6.8338
4     4   7   A     1   1 3.25000  6.5254
5     5   9   A     2   2 2.71301  8.2505
6     6  10   A     2   1 3.20281  7.5922
7     7  12   A     2   3 3.02423  7.3894
8     8  16   A     2   4 2.87245  7.4604
9     9  19   A     3   1 2.68878  8.2785
10   10  20   A     3   2 2.86862  7.9470
11   11  21   A     3   3 2.89923  7.9739
12   12  22   A     3   4 3.02806  8.4331
13   13  25   B     1   3 2.18131  6.6691
14   14  27   B     1   4 2.51914  5.6281
15   15  28   B     1   2 1.88739  7.0723
16   16  31   B     1   1 2.34685  6.0295
17   17  33   B     2   4 2.45608  5.6195
18   18  35   B     2   1 2.25225  6.3978
19   19  36   B     2   3 2.23649  6.1799
20   20  40   B     2   2 2.47523  5.9985
21   21  41   B     3   2 1.94200  7.2975
22   22  44   B     3   3 2.43243  6.4350
23   23  47   B     3   4 2.30180  6.3339
24   24  48   B     3   1 2.53378  6.1564
25   25  50   C     1   4 2.96014  7.5110
26   26  51   C     1   2 3.23551  7.4762
27   27  54   C     1   3 3.24638  7.2063
28   28  56   C     1   1 3.04710  7.6389
29   29  58   C     2   3 3.26449  7.5466
30   30  59   C     2   2 2.71377  9.0895
31   31  61   C     2   1 3.06522  7.8723
32   32  62   C     2   4 2.71739  8.2318
33   33  66   C     3   4 3.03623  7.9426
34   34  67   C     3   3 3.10507  8.4608
35   35  69   C     3   1 3.16304  8.5549
36   36  70   C     3   2 3.02899  8.5038
37   37  74   D     1   1 2.49164  9.5758
38   38  77   D     1   3 2.51833  9.5121
39   39  79   D     1   2 2.35631 10.3264
40   40  80   D     1   4 2.30331  9.7715
41   41  81   D     2   3 2.72688  9.5628
42   42  83   D     2   2 2.59512  9.9414
43   43  85   D     2   1 2.56516  9.3887
44   44  88   D     2   4 2.91523  8.3158
45   45  89   D     3   3 2.57943 10.4416
46   46  90   D     3   4 2.98159  8.7710
47   47  93   D     3   2 2.35370 11.0148
48   48  94   D     3   1 2.21953 11.2417
49   49  99   E     1   3 2.84158  8.7886
50   50 100   E     1   4 2.65264  8.6946
51   51 102   E     1   2 2.47112  9.7143
52   52 103   E     1   1 2.89769  9.2401
53   53 105   E     2   2 2.57343  9.5353
54   54 106   E     2   1 2.99752  8.7538
55   55 110   E     2   4 2.95380  8.8210
56   56 112   E     2   3 3.08663  8.9427
57   57 114   E     3   1 2.72525  9.4308
58   58 115   E     3   2 2.75825  9.7721
59   59 116   E     3   3 3.08333  8.9010
60   60 117   E     3   4 3.12129  8.4852
61   61 122   F     1   1 3.20600  6.3983
62   62 123   F     1   2 2.89500  6.6569
63   63 125   F     1   4 3.36900  6.0821
64   64 126   F     1   3 3.12000  6.5349
65   65 130   F     2   2 3.19300  6.6729
66   66 131   F     2   1 3.29800  6.5488
67   67 133   F     2   4 3.09700  6.6598
68   68 135   F     2   3 3.38500  6.2998
69   69 139   F     3   3 3.44900  6.2849
70   70 140   F     3   2 3.05000  6.9957
71   71 141   F     3   1 3.43500  6.7302
72   72 143   F     3   4 3.60600  6.3827
73   73 145   G     1   2 2.58669  8.1394
74   74 147   G     1   1 3.17892  7.0972
75   75 148   G     1   4 2.95284  7.3140
76   76 151   G     1   3 3.17924  6.9430
77   77 154   G     2   4 2.62344  7.5150
78   78 155   G     2   3 2.64286  8.0237
79   79 157   G     2   1 3.12760  7.3169
80   80 160   G     2   2 2.54993  8.1957
81   81 163   G     3   4 2.58322  7.9687
82   82 164   G     3   3 2.84813  7.9284
83   83 166   G     3   2 2.69279  8.5303
84   84 167   G     3   1 3.14424  7.3564
85   85 169   H     1   3 3.39974  6.5945
86   86 173   H     1   2 3.12370  6.7530
87   87 175   H     1   4 3.17969  6.4279
88   88 176   H     1   1 3.70052  6.4830
89   89 177   H     2   2 2.95192  7.3809
90   90 179   H     2   3 3.44661  6.7929
91   91 182   H     2   4 3.28906  6.4807
92   92 184   H     2   1 3.37500  6.8139
93   93 188   H     3   4 3.65104  6.3068
94   94 190   H     3   1 3.27734  7.4789
95   95 191   H     3   3 3.42708  6.9327
96   96 192   H     3   2 3.04818  7.7264
97   97 193   I     1   2 2.22105  8.4243
98   98 196   I     1   1 3.15526  6.7119
99   99 197   I     1   4 2.40263  7.7486
100 100 198   I     1   3 3.00000  6.9215
101 101 203   I     2   1 2.29079  8.8861
102 102 204   I     2   4 2.25395  8.6850
103 103 205   I     2   3 2.60526  8.4150
104 104 208   I     2   2 2.34737  8.7866
105 105 209   I     3   2 2.50505  8.5975
106 106 212   I     3   1 2.31316  8.9267
107 107 213   I     3   4 2.42105  8.7750
108 108 214   I     3   3 2.74211  8.1599




More information about the R-help mailing list