deviance_pvalue: deviance_pvale

Description Usage Arguments Value Examples

View source: R/deviance_pvalue.R

Description

Given a reference model and the fitted model and the degrees of freedom compute the deviance and the p-value. Then print them.

Usage

1
deviance_pvalue(reference_model, fitted_model, df, lower.tail = FALSE)

Arguments

reference_model

The model to act as the reference

fitted_model

The model that you want to compare to the reference model

df

degrees of freedom

lower.tail

Compute the p-value using the lower tail. Default = FALSE (optional)

Value

Nothing

Examples

 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_pvalue(intercept.only.model, fitted.model, df = 3)
}

ocrug/AdvancedRegression documentation built on Nov. 4, 2019, 10:13 p.m.