anova.opsr {OPSR}R Documentation

ANOVA for OPSR Model Fits

Description

Conducts likelihood ratio tests for one or more OPSR model fits.

Usage

## S3 method for class 'opsr'
anova(object, ...)

Arguments

object

an object of class "opsr".

...

additional objects of class "opsr". See also the 'Details' section.

Details

If only a single object is passed then the model is compared to the null model (opsr_null_model). If more than one object is specified, a likelihood ratio test is conducted for each pair of neighboring models. It is conventional to list the models from smallest to largest, but this is up to the user.

Value

An object of class "anova.opsr".

See Also

stats::anova, print.anova.opsr

Examples

sim_dat <- opsr_simulate()
dat <- sim_dat$data
model <- ys | yo ~ xs1 + xs2 | xo1 + xo2
fit <- opsr(model, dat)
fit_null <- opsr_null_model(fit)
fit_intercept <- update(fit, ~ . | 1)

anova(fit)
anova(fit_null, fit_intercept, fit)

[Package OPSR version 1.0.0 Index]