Get WRTDS trends for annual and monthly groupings

wrtdstrnd(dat_in, ...)

# S3 method for default
wrtdstrnd(
  dat_in,
  mobrks,
  yrbrks,
  molabs,
  yrlabs,
  aves = FALSE,
  mo_strt = 10,
  min_mo = 9,
  ...
)

# S3 method for tidal
wrtdstrnd(
  dat_in,
  mobrks,
  yrbrks,
  molabs,
  yrlabs,
  tau = NULL,
  aves = FALSE,
  mo_strt = 10,
  min_mo = 9,
  ...
)

# S3 method for tidalmean
wrtdstrnd(
  dat_in,
  mobrks,
  yrbrks,
  molabs,
  yrlabs,
  aves = FALSE,
  mo_strt = 10,
  min_mo = 9,
  ...
)

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

aves

logical if averages within each period are also returned

mo_strt

numeric indicating month to start aggregation years for annual trends, defaults to October for USGS water year from October to September, passed to annual_agg

min_mo

numeric value from one to twelve indicating the minimum number of months with observations for averaging by years, passed to annual_agg

tau

numeric vector of quantile for estimating trends

Value

A data.frame with summary trends for each grouping

Details

Trends are reported as percent changes of annual averages from the beginning to the end of each period. To reduce the effects of odd years at the beginning and end of each period, percent changes are based on an average of the first three and last three annual averages. For example, percent changes for January throughout an an entire time series from 1980 to 2000 would be the change of the average from January in 1980-1982 to the average from January in 1998-2000. Annual trends, e.g., percent changes from 1980-1986, 1987-1993, etc. do not average by the first and last three years in each grouping because the values are already based on annual averages as returned by annual_agg.

Note that the default minimum number of months argument (min_mo) may not be appropriate for all cases. Annual estimates should first be evaluated with prdnrmplot to verify that odd years with missing months are not driving results for the annual percent changes.

Averages in each period can be returned if aves = TRUE. These averages are based on annual averages within each period for congruency with the trend estimates.

All trends are based on back-transformed, flow-normalized results.

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.

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(tidfit, mobrks, yrbrks, molabs, yrlabs)
#>         cat         chg
#> 1 1974-1985 -10.8098920
#> 2 1986-1994 -26.8103223
#> 3 1995-2003 -12.6940068
#> 4 2004-2012   0.3881047
#> 5       JFM -72.0666410
#> 6       AMJ -50.7080726
#> 7       JAS -33.1198103
#> 8       OND -58.4959633
wrtdstrnd(tidfitmean, mobrks, yrbrks, molabs, yrlabs)
#>         cat        chg
#> 1 1974-1985 -23.302609
#> 2 1986-1994 -22.752598
#> 3 1995-2003 -14.906338
#> 4 2004-2012  -1.519542
#> 5       JFM -75.479413
#> 6       AMJ -61.187758
#> 7       JAS -35.380266
#> 8       OND -57.413662

# get averages in each period
wrtdstrnd(tidfit, mobrks, yrbrks, molabs, yrlabs, aves = TRUE)
#>         cat         chg       ave
#> 1 1974-1985 -10.8098920 20.428922
#> 2 1986-1994 -26.8103223 12.993209
#> 3 1995-2003 -12.6940068 10.469643
#> 4 2004-2012   0.3881047  9.768733
#> 5       JFM -72.0666410 10.080009
#> 6       AMJ -50.7080726 12.767500
#> 7       JAS -33.1198103 19.369678
#> 8       OND -58.4959633 13.583336