Get startedGet started for free

The deviance principle

There was no R-squared in the model summary. Instead, two types of deviance are reported. The null deviance serves as a baseline and can be evaluated relative to the residual deviance of the extended.model.

The null model is a logistic model without any additional predictors. You can specify such an intercept-only model by the relationship HOPPINESS ~ 1. Again, you use the function glm() and the family argument family = binomial. The result is named null.model. You judge the improvement in prediction accuracy by comparing the reduction in deviance from the extended.model to the null.model using the function anova() and the additional argument test = "Chisq".

This exercise is part of the course

Building Response Models in R

View Course

Exercise instructions

  • Explain HOPPINESS by the intercept only. Use the function glm() and the argument family = binomial. Assign the result to an object named null.model.
  • Compare the extended.model against the null.model by using the function anova() and the argument test = "Chisq".

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Explain HOPPINESS by the intercept only
___ <- ___(___, family = ___, data = choice.data)

# Compare null.model and extended.model
___(extended.model, ___, test = ___)
Edit and Run Code