Deviance measures the discrepancy between the current model and the full model. The full model is the model that has n
parameters, one parameter per observation. The full model maximizes the log-likelihood function. The full model provides a point of comparison for models with fewer than n
parameters. Comparisons to the full model use the scaled deviance.
The contribution to the scaled deviance from each individual data point depends on the model.
The degrees of freedom for the test depend on the sample size and the number of terms in the model:
| Lf ||the log-likelihood for the full model|
| Lc||the log-likelihood of the model with a subset of terms from the full model|
| yi ||the number of events for the ith row in the data|
|the estimated mean response for the ith row in the data|
|mi||the number of trials for the ith row in the data|
|n||the number of rows in the data|
|p||the regression degrees of freedom|