anova.opsr {OPSR} | R Documentation |
Conducts likelihood ratio tests for one or more OPSR model fits.
## S3 method for class 'opsr'
anova(object, ...)
object |
an object of class |
... |
additional objects of class |
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.
An object of class "anova.opsr"
.
stats::anova
, print.anova.opsr
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)