[R] problem with survreg and anova function
Prof. Ronaldo Reis Junior
chrysopa at gmail.com
Mon Nov 6 11:46:51 CET 2006
Hi,
I make a weibull survival regression using suvreg function. Bu when I try to
get the P values from anova, it give me NAs:
I'm using R 2.4.0 and survival 2.29
Look:
m <- survreg(Surv(tempo,censor)~grupo*peso)
anova(m)
Df Deviance Resid. Df -2*LL P(>|Chi|)
NULL NA NA 148 966.6416 NA
grupo -2 25.6334407 146 941.0081 NA
peso -1 0.7088892 145 940.2992 NA
grupo:peso -2 1.0731248 143 939.2261 NA
Older version of survival dont have this problem, look this printed result:
> anova(glex8.m1)
-2LL
Df Deviance Resid. Df P(>|Chi|)
NULL NA NA 2 966.6416 NA
grupo 2 25.6334408 4 941.0081 2.714995e-06
peso 1 0.7088892 5 940.2992 3.998128e-01
grupo:peso 2 1.0731248 7 939.2261 5.847550e-01
This a bug or a change in package?
The data from crawley book:
structure(list(tempo = c(20, 34, 1, 2, 3, 3, 50, 26, 1, 50, 21,
3, 13, 11, 22, 50, 50, 1, 50, 9, 50, 1, 13, 50, 50, 1, 6, 50,
50, 50, 36, 3, 46, 10, 50, 1, 18, 3, 36, 37, 50, 7, 1, 1, 7,
24, 4, 50, 12, 17, 1, 1, 1, 21, 50, 50, 1, 46, 50, 1, 8, 2, 12,
3, 2, 1, 5, 50, 1, 2, 2, 4, 17, 5, 1, 11, 8, 1, 5, 2, 41, 5,
21, 1, 38, 50, 3, 19, 4, 7, 1, 46, 2, 5, 40, 4, 50, 2, 1, 17,
7, 1, 5, 1, 1, 5, 6, 2, 24, 1, 1, 1, 1, 7, 13, 6, 11, 46, 5,
14, 2, 1, 20, 2, 20, 1, 23, 11, 1, 1, 20, 9, 1, 1, 1, 1, 7, 11,
1, 3, 1, 5, 9, 21, 10, 11, 30, 1, 1, 17), censor = c(1, 1, 1,
1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0,
0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1,
1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
), peso = c(5.385, 7.413, 9.266, 6.228, 5.229, 9.699, 1.973,
5.838, 2.088, 0.237, 6.814, 5.502, 1.137, 6.323, 7.384, 8.713,
7.458, 1.424, 1.312, 5.162, 7.187, 4.677, 6.548, 5.903, 2.113,
7.617, 3.737, 8.972, 6.523, 2.165, 4.895, 6.538, 1.674, 6.726,
2.671, 4.949, 4.819, 5.08, 3.532, 4.406, 6.286, 5.529, 2.27,
5.245, 9.675, 5.61, 4.297, 3.179, 6.776, 0.466, 0.626, 1.221,
0.124, 0.32, 2.282, 0.287, 3.468, 7.314, 4.901, 5.418, 6.344,
1.163, 12.126, 11.561, 8.333, 0.055, 10.583, 9.534, 13.182, 10.156,
16.881, 15.452, 16.831, 18.947, 19.099, 19, 9.652, 1.544, 10.786,
4.13, 2.2, 7.567, 14.581, 26.259, 0.44, 18.188, 6.789, 16.669,
38.177, 29.154, 14.578, 1.569, 0.345, 33.929, 28.958, 38.139,
26.822, 39.501, 9.264, 22.88, 27.48, 35.069, 4.974, 41.521, 42.09,
25.037, 9.509, 23.682, 0.352, 19.589, 7.426, 7.913, 2.37, 5.533,
18.8, 18.508, 3.343, 26.926, 2.388, 21.567, 5.594, 17.15, 15.986,
1.588, 2.055, 16.074, 12.086, 20.524, 6.493, 7.258, 16.635, 10.324,
5.228, 0.784, 5.587, 5.011, 7.441, 3.69, 4.708, 9.207, 1.4, 6.309,
1.784, 0.767, 1.993, 1.03, 2.875, 1.82, 0.974, 0.1), grupo = structure(c(1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3), .Label = c("g1", "g2", "g3"), class = "factor")), .Names = c("tempo",
"censor", "peso", "grupo"), class = "data.frame", row.names = c("1",
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
"14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24",
"25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35",
"36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46",
"47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57",
"58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68",
"69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79",
"80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90",
"91", "92", "93", "94", "95", "96", "97", "98", "99", "100",
"101", "102", "103", "104", "105", "106", "107", "108", "109",
"110", "111", "112", "113", "114", "115", "116", "117", "118",
"119", "120", "121", "122", "123", "124", "125", "126", "127",
"128", "129", "130", "131", "132", "133", "134", "135", "136",
"137", "138", "139", "140", "141", "142", "143", "144", "145",
"146", "147", "148", "149", "150"))
Thanks
Inte
Ronaldo
--
O cigarro disse ao fumante: Hoje você me acende, amanhã eu te apago.
--
> Prof. Ronaldo Reis Júnior
| .''`. UNIMONTES/Depto. Biologia Geral/Lab. Ecologia Evolutiva
| : :' : Campus Universitário Prof. Darcy Ribeiro, Vila Mauricéia
| `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil
| `- Fone: (38) 3229-8190 | chrysopa em gmail.com
| ICQ#: 5692561 | LinuxUser#: 205366
More information about the R-help
mailing list