[R] Symetric matrix as random effect in lmer
Marc
marc.moragues at gmail.com
Tue Mar 18 18:54:22 CET 2008
UseRs,
I am trying to fit the following model
> aa.lmer <- lmer(y ~ x + (1 | s), na.action=na.omit, family=binomial)
where s is a length(x) by length(x) matrix and I get this error:
Error in eval(expr, envir, enclos) : Ztl[[1]] must have 28392 columns
I am wondering if it is possible to fit such a model in R. If so, I
would very much appreciate some help because I have not found the way to
do it.
I pasted the sessionInfo() and subset of the data below.
Thanks!
Marc.
> sessionInfo()
R version 2.6.2 (2008-02-08)
i386-pc-mingw32
locale:
LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United
Kingdom.1252;LC_MONETARY=English_United
Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lme4_0.99875-9 Matrix_0.999375-5 lattice_0.17-6
loaded via a namespace (and not attached):
[1] grid_2.6.2
> y[1:20]
[1] 103.41 100.85 101.92 101.23 100.54 98.44 98.81 100.98 99.54 98.07
[11] 100.16 98.30 99.37 97.35 104.17 99.68 100.88 102.50 97.59 99.36
> x[1:20]
SJ1 SJ5 SJ7 SJ6 SJ8 SJ10 SJ2 SJ3 SJ4 SJ41 SJ42 SJ43 SJ44 SJ45
SJ47 SJ49
0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0
SJ61 SJ62 SJ63 SJ64
0 0 0 0
Levels: 0 1 0 1
> s[1:20,1:20]
1 2 3 4 5 6
7 8
1 0.00000 13.241699 13.249062 12.99136 14.199208 13.324555 13.532248
0.00000
2 13.24170 0.000000 0.000000 12.88476 10.748524 10.221546 9.240796
13.25193
3 13.24906 0.000000 0.000000 12.89398 10.723805 10.198039 9.233696
13.25925
4 12.99136 12.884756 12.893975 0.00000 13.830869 13.575058 12.598779
12.96261
5 14.19921 10.748524 10.723805 13.83087 0.000000 9.643651 9.606385
14.21013
6 13.32456 10.221546 10.198039 13.57506 9.643651 0.000000 9.124417
13.33480
7 13.53225 9.240796 9.233696 12.59878 9.606385 9.124417 0.000000
13.54269
8 0.00000 13.251928 13.259249 12.96261 14.210126 13.334801 13.542685
0.00000
9 13.23149 0.000000 0.000000 12.87484 10.740265 10.213692 9.233696
13.24170
10 14.21013 10.748524 10.732026 13.80521 0.000000 9.651043 9.606385
14.22107
11 13.63282 10.172285 10.156671 13.36214 10.107247 10.254806 9.395230
13.60640
12 14.21013 10.748524 10.732026 13.80521 0.000000 9.651043 9.606385
14.22107
13 13.85213 9.871560 9.856408 13.65912 5.102928 9.117417 9.501395
13.86280
14 13.60640 7.769800 7.757856 13.85213 9.710241 8.845317 10.319362
13.61689
15 15.13622 15.781355 15.808655 15.56360 16.124228 15.551587 15.704903
15.14793
16 14.17199 10.773415 10.756802 13.87349 0.000000 9.673324 9.576125
14.18296
17 0.00000 13.241699 13.259249 13.00136 14.210126 13.334801 13.542685
0.00000
18 13.85213 9.871560 9.856408 13.65912 5.102928 9.117417 9.501395
13.86280
19 13.98567 10.607399 10.630146 13.53812 10.295630 9.848858 9.761755
13.96049
20 13.47427 10.180119 10.205857 12.90387 11.233577 10.007666 9.972809
13.48464
9 10 11 12 13 14 15
1 13.231493 14.210126 13.632822 14.210126 13.852131 13.606397 15.13622
2 0.000000 10.748524 10.172285 10.748524 9.871560 7.769800 15.78135
3 0.000000 10.732026 10.156671 10.732026 9.856408 7.757856 15.80866
4 12.874841 13.805206 13.362142 13.805206 13.659115 13.852131 15.56360
5 10.740265 0.000000 10.107247 0.000000 5.102928 9.710241 16.12423
6 10.213692 9.651043 10.254806 9.651043 9.117417 8.845317 15.55159
7 9.233696 9.606385 9.395230 9.606385 9.501395 10.319362 15.70490
8 13.241699 14.221070 13.606397 14.221070 13.862799 13.616892 15.14793
9 0.000000 10.740265 10.164469 10.740265 9.863975 7.763821 15.80115
10 10.740265 0.000000 10.107247 0.000000 5.102928 9.710241 16.10538
11 10.164469 10.107247 0.000000 10.107247 9.280727 10.646462 15.40063
12 10.740265 0.000000 10.107247 0.000000 5.102928 9.710241 16.10538
13 9.863975 5.102928 9.280727 5.102928 0.000000 8.498306 15.88453
14 7.763821 9.710241 10.646462 9.710241 8.498306 0.000000 15.31385
15 15.801154 16.105381 15.400626 16.105381 15.884533 15.313848 0.00000
16 10.765098 0.000000 10.138394 0.000000 5.118654 9.688263 16.11784
17 13.241699 14.221070 13.643321 14.221070 13.862799 13.616892 15.11453
18 9.863975 5.102928 9.280727 5.102928 0.000000 8.498306 15.88453
19 10.599249 10.303523 10.496128 10.303523 10.496128 10.833257 16.27972
20 10.172285 11.197501 10.646462 11.197501 11.107560 10.367924 15.55159
16 17 18 19 20
1 14.171995 0.00000 13.852131 13.985674 13.47427
2 10.773415 13.24170 9.871560 10.607399 10.18012
3 10.756802 13.25925 9.856408 10.630146 10.20586
4 13.873491 13.00136 13.659115 13.538119 12.90387
5 0.000000 14.21013 5.102928 10.295630 11.23358
6 9.673324 13.33480 9.117417 9.848858 10.00767
7 9.576125 13.54269 9.501395 9.761755 9.97281
8 14.182960 0.00000 13.862799 13.960494 13.48464
9 10.765098 13.24170 9.863975 10.599249 10.17229
10 0.000000 14.22107 5.102928 10.303523 11.19750
11 10.138394 13.64332 9.280727 10.496128 10.64646
12 0.000000 14.22107 5.102928 10.303523 11.19750
13 5.118654 13.86280 0.000000 10.496128 11.10756
14 9.688263 13.61689 8.498306 10.833257 10.36792
15 16.117842 15.11453 15.884533 16.279721 15.55159
16 0.000000 14.18296 5.118654 10.278480 11.22339
17 14.182960 0.00000 13.862799 13.996428 13.48464
18 5.118654 13.86280 0.000000 10.496128 11.10756
19 10.278480 13.99643 10.496128 0.000000 10.68526
20 11.223391 13.48464 11.107560 10.685263 0.00000
More information about the R-help
mailing list