anova.oola: Comparison of nested models

Description Usage Arguments Value References See Also Examples

Description

anova method for objects of class "oola". Compares two or more nested models using the adjusted likelihood ratio test statistic (ALRTS) described in Section 3.5 of Chandler and Bate (2007). The nesting must result from the simple constraint that a subset of the parameters of the larger model is held fixed.

Usage

1
2
## S3 method for class 'oola'
anova(object, object2, ...)

Arguments

object

An object of class "oola", returned by alogLik or adjust_object.

object2

An object of class "chandwich", returned by alogLik or adjust_object.

...

Further objects of class "oola" and/or arguments to be passed to anova.chandwich.

The objects of class "oola" need not be provided in nested order: they will be ordered inside anova.oola based on the values of attr(., "p_current").

Value

An object of class "anova" inheriting from class "data.frame", with four columns:

Model.Df

The number of parameters in the model

Df

The decrease in the number of parameter compared the model in the previous row

ALRTS

The adjusted likelihood ratio test statistic

Pr(>ALRTS)

The p-value associated with the test that the model is a valid simplification of the model in the previous row.

The row names are the names of the model objects.

References

Chandler, R. E. and Bate, S. (2007). Inference for clustered data using the independence loglikelihood. Biometrika, 94(1), 167-183. http://dx.doi.org/10.1093/biomet/asm015

See Also

anova.chandwich.

adjust_object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
got_evd <- requireNamespace("evd", quietly = TRUE)

if (got_evd) {
  y <- c(chandwich::owtemps[, "Oxford"], chandwich::owtemps[, "Worthing"])
  x <- rep(c(1, -1), each = length(y) / 2)
  owfit <- evd::fgev(y, nsloc = x)
  year <- rep(1:(length(y) / 2), 2)
  oola_small <- alogLik(owfit, cluster = year)

  owfit <- evd::fgev(y)
  year <- rep(1:(length(y) / 2), 2)
  oola_tiny <- alogLik(owfit, cluster = year)

  anova(oola_small, oola_tiny)
}

paulnorthrop/oola documentation built on May 12, 2019, 10:52 a.m.