Learn R Programming

blm (version 2011.1.3)

logistic.dispersion: Computes deviance and Pearson's chi-squared statistica for a logisitc model fit with glm.

Description

Computes the deviance and Pearson chi-squared statistics for the fit from a glm logistic regression. These tests are appropriate when all predictors are categorical and there are many replicates within each covariate class.

Usage

logistic.dispersion(f,data,fit)

Arguments

f
model formula
data
data frame on which the fit was based
fit
glm object for logistic regression

Value

  • Returns a list of observed, expected, pearson. pearson.p, pearson.df, deviance, deviance.p and deviance.df.

Examples

Run this code
data(birthwt)

fit <- glm(low~smoke+ht+ui+I(ptl>0),birthwt,family=binomial)

fit

logistic.dispersion(low~smoke+ht+ui+I(ptl>0),birthwt,fit)

Run the code above in your browser using DataLab