ComenzarEmpieza gratis

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".

Este ejercicio forma parte del curso

Building Response Models in R

Ver curso

Instrucciones del ejercicio

  • 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".

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

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

# Compare null.model and extended.model
___(extended.model, ___, test = ___)
Editar y ejecutar código