anova.intRvals {intRvals}R Documentation

Compares model fits of intRvals objects

Description

Compare model fits of intRvals objects estimated on the same data. If one object is provided, the results of a deviance test against a model without a missed event probability 'p' is reported. If two objects are provided, the results of a deviance test between the model fits of the two objects is given.

Usage

## S3 method for class 'intRvals'
anova(
  object,
  y = NULL,
  conf.level = 0.95,
  digits = max(3L, getOption("digits") - 3L),
  ...
)

Arguments

object

an object of class intRvals, usually a result of a call to estinterval

y

an (optional) object of class intRvals, usually a result of a call to estinterval

conf.level

confidence level for the deviance test

digits

the number of digits for printing to screen

...

other arguments to be passed to low level functions

Value

A list of class "anova.intRvals" with the best model (1 or 2), deviance statistic and test results

best.model

the index of the best model (1 is first argument, 2 is second)

deviance

the deviance between the two tested models

p.value

p-value for the deviance (likelihood-ratio) test

conf.level

assumed confidence level for the test

model1.call

call that generated model 1

model2.call

call that generated model 2

AIC

numeric 2-vector containg the AIC value for model 1 (first element) and model 2 (second element)

loglik

numeric 2-vector containg the log-likelihood value for model 1 (first element) and model 2 (second element)

Examples

data(goosedrop)
model1=estinterval(goosedrop$interval,fun="gamma")
# visually inspect model1 fit:
plot(model1)
# The observed distribution has intervals near zero.
# We allow a small random baseline to reduce the effect
# of intervals near zero on the fit result.
model2=estinterval(goosedrop$interval,fun="gamma",fpp.method='auto')
# model2 performs better than model1:
anova(model1,model2)

[Package intRvals version 1.0.1 Index]