Fits a linear model to each trajectory returned by nowcasting_inla() or nowcasting_mgcv() (with trajectories = TRUE) within a given window. Requires the 'lme4' package. The default is 3 weeks. If 'end.week' is missing uses the maximum date in 'trajectories'.
Valor
A trend category based on the distribution of the slopes of the trajectories:
1 increasing (5% quantile > 0), 0.5 probably increasing (25% quantile >= 0),
0 stable or uncertain, -0.5 probably decreasing (75% quantile <= 0) and
-1 decreasing (95% quantile < 0).
Exemplos
# \donttest{
if (requireNamespace("lme4", quietly = TRUE)) {
# Loading Belo Horizonte SARI dataset
data(sragBH)
now <- nowcasting_mgcv(dataset = sragBH,
date_onset = DT_SIN_PRI,
date_report = DT_DIGITA,
trajectories = TRUE)
slope.estimate.quant(trajectories = now$trajectories)
}
#> Warning: Using default, trimming out 0 days of data
#> Joining with `by = join_by(date_onset)`
#> Joining with `by = join_by(date_onset, delay, Time)`
#> Warning: Using max. date in 'trajectories' as 'end.week'
#> [1] -0.5
# }