13.11.2012 Views

Introduction to Categorical Data Analysis

Introduction to Categorical Data Analysis

Introduction to Categorical Data Analysis

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.2 MODEL CHECKING 145<br />

increases. Models with multiple predic<strong>to</strong>rs would consider interaction terms. If more<br />

complex models do not fit better, this provides some assurance that a chosen model<br />

is adequate.<br />

We illustrate for the model in Section 4.1.3 that used x = width alone <strong>to</strong> predict<br />

the probability that a female crab has a satellite,<br />

logit[π(x)]=α + βx<br />

One check compares this model with the more complex model that contains a quadratic<br />

term,<br />

logit[ˆπ(x)]=α + β1x + β2x 2<br />

For that model, ˆβ2 = 0.040 has SE = 0.046. There is not much evidence <strong>to</strong> support<br />

adding that term. The likelihood-ratio statistic for testing H0: β2 = 0 equals 0.83<br />

(df = 1, P -value = 0.36).<br />

The model in Section 4.4.1 used width and color predic<strong>to</strong>rs, with three dummy<br />

variables for color. Section 4.4.2 noted that an improved fit did not result from adding<br />

three cross-product terms for the interaction between width and color in their effects.<br />

5.2.2 Goodness of Fit and the Deviance<br />

A more general way <strong>to</strong> detect lack of fit searches for any way the model fails.<br />

A goodness-of-fit test compares the model fit with the data. This approach regards<br />

the data as representing the fit of the most complex model possible – the saturated<br />

model, which has a separate parameter for each observation.<br />

Denote the working model by M. In testing the fit of M, we test whether all parameters<br />

that are in the saturated model but not in M equal zero. In GLM terminology,<br />

the likelihood-ratio statistic for this test is the deviance of the model (Section 3.4.3).<br />

In certain cases, this test statistic has a large-sample chi-squared null distribution.<br />

When the predic<strong>to</strong>rs are solely categorical, the data are summarized by counts in<br />

a contingency table. For the ni subjects at setting i of the predic<strong>to</strong>rs, multiplying the<br />

estimated probabilities of the two outcomes by ni yields estimated expected frequencies<br />

for y = 0 and y = 1. These are the fitted values for that setting. The deviance<br />

statistic then has the G 2 form introduced in equation (2.7), namely<br />

G 2 (M) = 2 � observed [log(observed/fitted)]<br />

for all the cells in that table. The corresponding Pearson statistic is<br />

X 2 (M) = � (observed − fitted) 2 /fitted<br />

For a fixed number of settings, when the fitted counts are all at least about 5,<br />

X 2 (M) and G 2 (M) have approximate chi-squared null distributions. The degrees of

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!