P__disp: Display Pearson Chi2 and associated dispersion statistic...

Description Usage Arguments Format Details Value Note Author(s) References See Also Examples

View source: R/P__disp.r

Description

Following the glm() function with a grouped binomial or poisson family, or glm.nb(), P__disp() displays the Pearson Chi2 statistic and related dispersion statistic. Values of the dispersion greater than 1.0 indicate possible overdispersion; values under 1.0 indicate possible underdispersion.

Usage

1

Arguments

x

glm object

Format

x

The only argument is the name of the fitted glm or glm.nb function model

Details

P_disp is a post-estimation function, following the use of glm() or glm.nb(). Appropriate with grouped binomial or Poisson glm families.

Value

Pearson Chi2

Pearson Chi2 statistic

Dispersion

Pearson dispersion: Chi2/dof

Note

P__disp must be loaded into memory in order to be effectve. As a function in LOGIT, it is immediately available to a user.

Author(s)

Joseph M. Hilbe, Arizona State University, and Jet Propulsion Laboratory, California Institute of technology

References

Hilbe, Joseph M. (2015), Practical Guide to Logistic Regression, Chapman & Hall/CRC. Hilbe, Joseph M. (2014), Modeling Count Data, Cambridge University Press

See Also

glm

Examples

1
2
3
4
5
6
7
8
9
library(MASS)
library(LOGIT)
data(titanicgrp)
class03 <- factor(titanicgrp$class, levels=c("3rd class", "2nd class", "1st class"))
died <- titanicgrp$cases - titanicgrp$survive
grptit <- glm( cbind(survive, died) ~ age+sex+class03, family=binomial,
data=titanicgrp)
summary(grptit)
P__disp(grptit)

Example output

Call:
glm(formula = cbind(survive, died) ~ age + sex + class03, family = binomial, 
    data = titanicgrp)

Deviance Residuals: 
   Min      1Q  Median      3Q     Max  
-4.232  -2.365   1.038   3.180   4.362  

Coefficients:
                 Estimate Std. Error z value Pr(>|z|)    
(Intercept)        1.2955     0.2478   5.227 1.72e-07 ***
ageadults         -1.0556     0.2427  -4.350 1.36e-05 ***
sexman            -2.3695     0.1453 -16.313  < 2e-16 ***
class032nd class   0.7558     0.1753   4.313 1.61e-05 ***
class031st class   1.7664     0.1707  10.347  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 581.40  on 11  degrees of freedom
Residual deviance: 110.84  on  7  degrees of freedom
AIC: 157.77

Number of Fisher Scoring iterations: 5


 Pearson Chi2 =  100.8828 
 Dispersion   =  14.41183 

LOGIT documentation built on May 29, 2017, 10:26 a.m.

Related to P__disp in LOGIT...