| anova.gkwreg | R Documentation |
Computes an analysis of deviance table for one or more fitted Generalized Kumaraswamy (GKw) regression model objects. When multiple models are provided, likelihood ratio tests are performed to compare nested models.
## S3 method for class 'gkwreg'
anova(object, ..., test = c("Chisq", "none"))
object |
An object of class |
... |
Additional objects of class |
test |
A character string specifying the test statistic to use. Currently
only |
When a single model is provided, the function returns a table showing the residual degrees of freedom and deviance.
When multiple models are provided, the function compares them using likelihood ratio tests (LRT). Models are automatically ordered by their complexity (degrees of freedom). The LRT statistic is computed as:
LRT = 2(\ell_1 - \ell_0)
where \ell_1 is the log-likelihood of the more complex model and
\ell_0 is the log-likelihood of the simpler (nested) model. Under the
null hypothesis that the simpler model is adequate, the LRT statistic follows
a chi-squared distribution with degrees of freedom equal to the difference in
the number of parameters between the models.
Important: This method assumes that the models being compared are
nested (i.e., one model is a special case of the other) and fitted to the
same data. Comparing non-nested models or models fitted to different datasets
will produce unreliable results. Use AIC or BIC
for comparing non-nested models.
The deviance is defined as -2 \times \text{log-likelihood}. For models
fitted by maximum likelihood, smaller (more negative) deviances indicate
better fit. Note that deviance can be negative when the log-likelihood is
positive, which occurs when density values exceed 1 (common in continuous
distributions on bounded intervals). What matters for inference is the
change in deviance between models, which should be positive when
the more complex model fits better.
An object of class c("anova.gkwreg", "anova", "data.frame"),
with the following columns:
Resid. DfResidual degrees of freedom
Resid. DevResidual deviance (-2 × log-likelihood)
DfChange in degrees of freedom (for model comparisons)
DevianceChange in deviance (for model comparisons)
Pr(>Chi)P-value from the chi-squared test (if test = "Chisq")
Lopes, J. E.
Wilks, S. S. (1938). The large-sample distribution of the likelihood ratio for testing composite hypotheses. The Annals of Mathematical Statistics, 9(1), 60–62. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aoms/1177732360")}
Pawitan, Y. (2001). In All Likelihood: Statistical Modelling and Inference Using Likelihood. Oxford University Press.
gkwreg, logLik.gkwreg, AIC.gkwreg,
BIC.gkwreg, lrtest
# Load example data
data(GasolineYield)
# Fit a series of nested models
fit1 <- gkwreg(yield ~ 1, data = GasolineYield, family = "kw")
fit2 <- gkwreg(yield ~ temp, data = GasolineYield, family = "kw")
fit3 <- gkwreg(yield ~ batch + temp, data = GasolineYield, family = "kw")
# ANOVA table for single model
anova(fit3)
# Compare nested models using likelihood ratio tests
anova(fit1, fit2, fit3)
#> Model 1 vs 2: Adding temperature is highly significant (p < 0.001)
#> Model 2 vs 3: Adding batch is highly significant (p < 0.001)
# Compare two models
anova(fit2, fit3, test = "Chisq")
# Suppress test statistics
anova(fit1, fit2, fit3, test = "none")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.