[R] glm deviance question
Anne York
york at noaa.gov
Fri Jan 4 20:16:36 CET 2002
I am comparing the Splus and R fits of a simple glm.
In the following, foo is generated from rbinom with size = 20 p = 0.5.
The coefficients (and SE's0 of the fitted models are the same, but the
estimated deviances are quite different. Could someone please tell me why
they are so different? I am using R version 1.3.1 and Splus 2000 release 3
on windows 2000.
++++++++++++++++++++++
foo <- c(9, 4, 10, 7, 11, 13, 8, 6, 11, 14, 11,
10, 7, 9, 13, 7, 9, 6, 10, 10)
foo.glm <- glm(cbind(foo,20-foo)~1,family=binomial)
In Splus:
summary(foo.glm)
Coefficients:
Value Std. Error t value
(Intercept) 0.1502822 0.1002824 1.498589
(Dispersion Parameter for Binomial family taken to be 1 )
Null Deviance: 21.89527 on 19 degrees of freedom
Residual Deviance: 21.89527 on 19 degrees of freedom
In R:
summary(foo.glm)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.1503 0.1003 -1.499 0.134
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 26.479 on 19 degrees of freedom
Residual deviance: 26.479 on 19 degrees of freedom
AIC: 96.44
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anne E. York
National Marine Mammal Laboratory
Seattle WA 98115-0070 USA
e-mail: anne.york at noaa.gov
Voice: +1 206-526-4039
Fax: +1 206-526-6615
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list