# anova.evd: Compare Nested EVD Objects In evd: Functions for Extreme Value Distributions

## Description

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

## Usage

 ```1 2``` ```## S3 method for class '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.

`fbvevd`, `fextreme`, `fgev`, `forder`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```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) ```

### Example output

```Analysis of Deviance Table

M.Df Deviance Df  Chisq Pr(>chisq)
M1    4   346.73
M2    3   348.01  1 1.2842    0.25712
M3    2   355.79  1 7.7774    0.00529 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Analysis of Deviance Table

M.Df Deviance Df  Chisq Pr(>chisq)
M1    7   591.65
M2    6   592.66  1 1.0029     0.3166
Analysis of Deviance Table

M.Df Deviance Df  Chisq Pr(>chisq)
M1    7   591.65
M3    6   600.09  1 16.866  4.012e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
```

evd documentation built on May 1, 2019, 10:11 p.m.