Learn R Programming

gkwreg (version 2.1.6)

lrtest: Likelihood Ratio Test for Nested GKw Models

Description

Performs a likelihood ratio test to compare two nested Generalized Kumaraswamy regression models.

Usage

lrtest(object, object2)

Value

A list with class "htest" containing:

statistic

The LRT test statistic

parameter

Degrees of freedom for the test

p.value

P-value from the chi-squared distribution

method

Description of the test

data.name

Names of the compared models

Arguments

object

A fitted model object of class "gkwreg" (the restricted model).

object2

A fitted model object of class "gkwreg" (the full model).

Author

Lopes, J. E.

Details

This function performs a likelihood ratio test (LRT) to compare two nested models. The test statistic is: $$LRT = 2(\ell_{\text{full}} - \ell_{\text{restricted}})$$ which follows a chi-squared distribution with degrees of freedom equal to the difference in the number of parameters.

The models must be nested (one is a special case of the other) and fitted to the same data for the test to be valid.

See Also

anova.gkwreg

Examples

Run this code
# \donttest{
data(GasolineYield)

# Fit nested models
fit_restricted <- gkwreg(yield ~ temp, data = GasolineYield, family = "kw")
fit_full <- gkwreg(yield ~ batch + temp, data = GasolineYield, family = "kw")

# Likelihood ratio test
lrtest(fit_restricted, fit_full)
# }

Run the code above in your browser using DataLab