Description Usage Arguments Value Examples
Given two models, compute the deviance between the two
1 | deviance(reference_model, fitted_model)
|
reference_model |
The model to act as the reference |
fitted_model |
The model that you want to compare to the reference model |
The deviance between the two models
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | {
libraries.data <- AdvancedRegression::libraries
#specifying reference category
location.rel <- relevel(libraries.data$location, ref = "rural")
#fitting beta regression model
fitted.model <- betareg::betareg(propontime ~ nbooks + ncardholders + location.rel,
data = libraries.data, link = "logit")
#checking model fit
intercept.only.model <- betareg::betareg(propontime ~ 1,
data = libraries.data, link = "logit")
deviance(intercept.only.model, fitted.model)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.