Learn R Programming

beezdemand (version 0.2.0)

anova.beezdemand_hurdle: ANOVA Method for Hurdle Demand Models

Description

Compare nested hurdle demand models using likelihood ratio tests.

Usage

# S3 method for beezdemand_hurdle
anova(object, ...)

Value

An object of class anova.beezdemand containing:

table

Data frame with model comparison statistics

lrt

Likelihood ratio test results

Arguments

object

A beezdemand_hurdle model.

...

Additional beezdemand_hurdle models to compare.

Details

All models must be fit to the same data. Models are ordered by degrees of freedom, and sequential likelihood ratio tests are performed.

Examples

Run this code
# \donttest{
data(apt)
fit2 <- fit_demand_hurdle(apt, y_var = "y", x_var = "x", id_var = "id",
                          random_effects = c("zeros", "q0"))
fit3 <- fit_demand_hurdle(apt, y_var = "y", x_var = "x", id_var = "id",
                          random_effects = c("zeros", "q0", "alpha"))
anova(fit2, fit3)
# }

Run the code above in your browser using DataLab