anlz_sumstats {wqtrends}R Documentation

Retrieve summary statistics for seasonal metrics and trend results

Description

Retrieve summary statistics for seasonal metrics and trend results

Usage

anlz_sumstats(
  mod,
  metfun = mean,
  doystr = 1,
  doyend = 364,
  yrstr = 2000,
  yrend = 2019,
  yromit = NULL,
  nsim = 10000,
  confint = 0.95,
  useave = FALSE,
  ...
)

Arguments

mod

input model object as returned by anlz_gam

metfun

function input for metric to calculate, e.g., mean, var, max, etc

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 anlz_avgseason is used for the seasonal metric calculation, see details

...

additional arguments passed to metfun, e.g., na.rm = TRUE

Details

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.

Value

A list object with named elements:

Examples

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)

[Package wqtrends version 1.5.1 Index]