[R] Problems with rlm
Ed Hagen
e.hagen at biologie.hu-berlin.de
Wed Apr 7 19:00:29 CEST 2004
Dear all,
When calling rlm with the following data, I get an error. (R v.1.8.1,
WinXP Pro 2002 with service pack 1.)
> d <- na.omit(data.frame(CPRATIO, HEIGHTZ, FAMILYID))
> c <- tapply(d$CPRATIO, d$FAMILYID, mean)
> h <- tapply(d$HEIGHTZ, d$FAMILYID, mean)
> c
1 2 3 6 7 9 10
11
6.000000 2.500000 3.250000 4.000000 2.333333 2.400000 2.750000
2.000000
12 13 14 15 16 18 21
22
4.000000 5.000000 4.000000 7.000000 4.500000 3.500000 4.000000
5.000000
23 25 30 31 35 39 40
44
6.000000 3.000000 9.000000 10.000000 8.000000 10.000000 4.000000
6.000000
45 47 50
4.500000 5.500000 5.000000
> h
1 2 3 6 7 9
10
-2.7916667 -1.0246838 -2.0681170 -1.3256766 -3.1122708 -2.1444948
-2.5806538
11 12 13 14 15 16
18
-0.6791551 -0.1278583 -3.7737900 -3.3077561 -2.4615233 -3.4016225
-2.2484673
21 22 23 25 30 31
35
-0.8938528 -2.2521325 -2.3461999 -2.1405470 -2.7657994 -3.3588822
-2.8144453
39 40 44 45 47 50
-3.8521439 -2.1882352 -1.7531826 -3.6464482 -2.2158240 -2.7162693
> out <- rlm(h ~ c)
Error in model.matrix.default(mt, mf, contrasts) :
cannot allocate vector of length 1077237505
If I make the same rlm call a second or third time, R usually crashes.
Any help or suggestions would be greatly appreciated. These commands
were run after a much larger script had seemingly run successfully. But,
I had no problem calling, e.g., rlm(HEIGHTZ ~ CPRATIO), after the same
script had run. Although I have made some minor changes in the script,
I also didn't have this problem when using R 1.7.
Many thanks in advance,
Ed.
--
Edward H. Hagen Institute for Theoretical Biology
phone: +49/30 2093-8649 Humboldt-Universität zu Berlin
fax: +49/30 2093-8801 Invalidenstraße 43
http://itb.biologie.hu-berlin.de/~hagen 10115 Berlin, Germany
More information about the R-help
mailing list