wrtdstrnd_sk: Get WRTDS trends using seasonal Kendall tests

View source: R/wrtdstrnd_sk.R

wrtdstrnd_skR Documentation

Get WRTDS trends using seasonal Kendall tests

Description

Get WRTDS trends using seasonal Kendall tests

Usage

wrtdstrnd_sk(dat_in, ...)

## Default S3 method:
wrtdstrnd_sk(dat_in, mobrks, yrbrks, molabs, yrlabs, ...)

## S3 method for class 'tidal'
wrtdstrnd_sk(
  dat_in,
  mobrks,
  yrbrks,
  molabs,
  yrlabs,
  tau = NULL,
  trndvar = "norm",
  ...
)

## S3 method for class 'tidalmean'
wrtdstrnd_sk(dat_in, mobrks, yrbrks, molabs, yrlabs, trndvar = "bt_norm", ...)

Arguments

dat_in

input tidal or tidalmean object which must already have fitted model data

...

methods passed to or from other methods

mobrks

list of month groupings where each month is an integer from 1 to 12, see examples

yrbrks

numeric vector of breaks for years, see examples

molabs

character vector of names for month breaks, see examples

yrlabs

character vector of names for year breaks, see examples

tau

numeric vector of quantile for estimating trends

trndvar

chr string of variable for trend evaluation, usually back-transformed, flow-normalized results, see details

Details

Trends are based on kendallSeasonalTrendTest for user-specified time periods. In general, the seasonal Kendall test evaluates monotonic trends using a non-parametric approach that accounts for seasonal variation in the time series.

All trends are based on back-transformed, flow-normalized results by default. The variable for evaluating trends can be changed with 'trndvar' as 'res', 'norm', or 'fit' for tidal objects and as 'res', 'bt_norm', or 'bt_fits' for tidalmean objects. In all cases, back-transformed variables are evaluated.

The user must supply the annual and monthly aggregation periods to the appropriate arguments. These are passed to cut and are left-open, right-closed along the interval.

Value

A data.frame with summary trends for each grouping, including med as the median value for the period of observation, tau as the magnitude and direction of the trend, slope as the Thiel-Sen slope for change per year, chitest as the significance test evaluating heterogeneity between seasons, ztest indicating significance of the overall trend, and perchg as 100 multiplied by the ratio of the annual slope to the median estimate of the time period (percent change per year).

As noted in kendallSeasonalTrendTest, the overall test is not appropriate if chitest indicates a small p-value.

References

Hirsch, R.M., Slack, J.R., Smith, R.A. 1982. Techniques of trend analysis for monthly water quality data. Water Resources Research, 18:107-121.

Millard, S. P. 2013. EnvStats: An R Package for Environmental Statistics. Springer, New York.

Examples

## load a fitted model object
data(tidfit)
data(tidfitmean)

## get trends

# setup month, year categories
mobrks <- list(c(1, 2, 3), c(4, 5, 6), c(7, 8, 9), c(10, 11, 12))
yrbrks <- c(1973, 1985, 1994, 2003, 2012)
molabs <- c('JFM', 'AMJ', 'JAS', 'OND')
yrlabs <- c('1974-1985', '1986-1994', '1995-2003', '2004-2012')

wrtdstrnd_sk(tidfit, mobrks, yrbrks, molabs, yrlabs)
wrtdstrnd_sk(tidfitmean, mobrks, yrbrks, molabs, yrlabs)


fawda123/WRTDStidal documentation built on Oct. 22, 2023, 11:28 p.m.