anlz_sumstats {wqtrends} | R Documentation |
Retrieve summary statistics for seasonal metrics and trend results
anlz_sumstats(
mod,
metfun = mean,
doystr = 1,
doyend = 364,
yrstr = 2000,
yrend = 2019,
yromit = NULL,
nsim = 10000,
confint = 0.95,
useave = FALSE,
...
)
mod |
input model object as returned by |
metfun |
function input for metric to calculate, e.g., |
doystr |
numeric indicating start Julian day for extracting averages |
doyend |
numeric indicating ending Julian day for extracting averages |
yrstr |
numeric for starting year for trend model, see details |
yrend |
numeric for ending year for trend model, see details |
yromit |
optional numeric vector for years to omit from the plot, see details |
nsim |
numeric indicating number of random draws for simulating uncertainty |
confint |
numeric from zero to one indicating confidence interval level for summarizing the mixed-effects meta-analysis model, see details |
useave |
logical indicating if |
... |
additional arguments passed to |
This function is primarily for convenience to return summary statistics of a fitted GAM from anlz_gam
.
Note that confint
only applies to the summary
and coeffs
list outputs. It does not apply to the metseason
list element output that is default set to 95
Set useave = T
to speed up calculations if metfun = mean
. This will use anlz_avgseason
to estimate the seasonal summary metrics using a non-stochastic equation.
A list object with named elements:
mixmet
: mixmeta
object of the fitted mixed-effects meta-analysis trend model
metseason
: tibble object of the fitted seasonal metrics as returned by anlz_metseason
or anlz_avgseason
summary
: summary of the mixmet
object
coeffs
: tibble object of the slope estimate coefficients from the mixmet
model. An approximately linear slope estimate will be included as slope.approx
if trans = 'log10'
for the GAM used in mod
.
library(dplyr)
# data to model
tomod <- rawdat %>%
filter(station %in% 34) %>%
filter(param %in% 'chl') %>%
filter(yr > 2015)
mod <- anlz_gam(tomod, trans = 'log10')
anlz_sumstats(mod, metfun = mean, doystr = 90, doyend = 180, yrstr = 2016,
yrend = 2019, nsim = 100)