evd (version 2.3-3)

anova.evd: Compare Nested EVD Objects

Description

Compute an analysis of deviance table for two or more nested evd objects.

Usage

# S3 method for evd
anova(object, object2, …, half = FALSE)

Arguments

object

An object of class "evd".

object2

An object of class "evd" that represents a model nested within object.

Further successively nested objects.

half

For some non-regular tesing problems the deviance difference is known to be one half of a chi-squared random variable. Set half to TRUE in these cases.

Value

An object of class c("anova", "data.frame"), with one row for each model, and the following five columns

M.Df

The number of parameters.

Deviance

The deviance.

Df

The number of parameters of the model in the previous row minus the number of parameters.

Chisq

The deviance minus the deviance of the model in the previous row (or twice this if half is TRUE).

Pr(>chisq)

The p-value calculated by comparing the quantile Chisq with a chi-squared distribution on Df degrees of freedom.

Warning

Circumstances may arise such that the asymptotic distribution of the test statistic is not chi-squared. In particular, this occurs when the smaller model is constrained at the edge of the parameter space. It is up to the user recognize this, and to interpret the output correctly.

In some cases the asymptotic distribution is known to be one half of a chi-squared; you can set half = TRUE in these cases.

See Also

fbvevd, fextreme, fgev, forder

Examples

Run this code
# NOT RUN {
uvdata <- rgev(100, loc = 0.13, scale = 1.1, shape = 0.2)
trend <- (-49:50)/100
M1 <- fgev(uvdata, nsloc = trend)
M2 <- fgev(uvdata)
M3 <- fgev(uvdata, shape = 0)
anova(M1, M2, M3)

bvdata <- rbvevd(100, dep = 0.75, model = "log")
M1 <- fbvevd(bvdata, model = "log")
M2 <- fbvevd(bvdata, model = "log", dep = 0.75)
M3 <- fbvevd(bvdata, model = "log", dep = 1)
anova(M1, M2)
anova(M1, M3, half = TRUE)
# }

Run the code above in your browser using DataCamp Workspace