Compute an analysis of deviance table for two nested TVGEV
objects.
# S3 method for TVGEV
anova(object, object1, trace = 1L, ...)
A TVGEV
object as fitted by
TVGEV
.
A TVGEV
object such that object
is
nested in object1
.
Level of verbosity. The value 0
prints
nothing.
Not used yet.
An object of class "anova"
inheriting from class
"data.frame"
.
The deviance of the models can not be interpreted: only the difference of the deviance is used.
The distribution of the test statistic (difference between two deviances) is obtained on the basis of the large sample theory which may not be applicable.
df <- within(TXMax_Dijon, Date <- as.Date(sprintf("%4d-01-01", Year)))
## fit without a break in trend
res0 <- TVGEV(data = df, response = "TXMax", date = "Date",
design = breaksX(date = Date, breaks = "1970-01-01", degree = 1),
loc = ~ t1,
estim = "nloptr")
## the same but with a break
res1 <- TVGEV(data = df, response = "TXMax", date = "Date",
design = breaksX(date = Date, breaks = "1970-01-01", degree = 1),
loc = ~ t1 + t1_1970,
estim = "nloptr")
anova(res0, res1)
#> Analysis of Deviance Table
#>
#> df deviance W Pr(>W)
#> res0 4 361.2
#> res1 5 354.4 6.7982 0.009125 **
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1