[Vegan-commits] r349 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 13 15:38:04 CEST 2008


Author: jarioksa
Date: 2008-05-13 15:38:04 +0200 (Tue, 13 May 2008)
New Revision: 349

Modified:
   pkg/R/fieller.MOStest.R
Log:
fieller.MOStest gets the overdispersion from summary.glm (as Pearson Chi-square/df)

Modified: pkg/R/fieller.MOStest.R
===================================================================
--- pkg/R/fieller.MOStest.R	2008-05-12 18:57:14 UTC (rev 348)
+++ pkg/R/fieller.MOStest.R	2008-05-13 13:38:04 UTC (rev 349)
@@ -4,10 +4,7 @@
     smodel <- summary(object$mod)
     var <- smodel$cov.scaled
     fam <- family(object$mod)
-    if (fam$family %in% c("poisson", "binomial"))
-        od <- 1
-    else
-        od <- deviance(object$mod)/df.residual(object$mod)
+    od <- summary(object$mod)$dispersion
     k <- coef(object$mod)
     b2 <- -2 * k[3]
     u <- -k[2]/2/k[3]
@@ -26,7 +23,7 @@
         x <- u - g * vvar/uvar
         f <- z/b2
         s <- sqrt(wvar - 2 * u * vvar + u^2 * uvar - g * (wvar - 
-                                                              vvar^2/uvar))
+                                                          vvar^2/uvar))
         limits[1] <- (x - f * s)/(1 - g)
         limits[2] <- (x + f * s)/(1 - g)
     }



More information about the Vegan-commits mailing list