calc_annual_stat_trend {HyMETT} | R Documentation |
Calculate trend in annual statistics
Description
Calculate trend in annual statistics
Usage
calc_annual_stat_trend(data = NULL, year, value, ...)
Arguments
data |
'data.frame'. Optional data.frame input, with columns containing |
year |
'numeric' vector when |
value |
'numeric' vector when |
... |
further arguments to be passed to or from |
Details
This function is a wrapper for EnvStats::kendallTrendTest
with the passed equation
value ~ year
. The returned values include Mann-Kendall test statistic and p-value,
Theil-Sen slope and intercept values, and trend details (Millard, 2013; Helsel and others, 2020).
z_stat
Mann-Kendall test statistic, returned directly from
EnvStats::kendallTrendTest
p_value
z_stat
p-value, returned directly fromEnvStats::kendallTrendTest
sen_slope
Sen slope in units value per year, returned directly from
EnvStats::kendallTrendTest
intercept
Sen slope intercept, returned directly from
EnvStats::kendallTrendTest
trend_mag
Trend magnitude over entire period, in units of
value
, calculated assen_slope * (max(year)
min(year))
val_beg/end
Calculated value at beginning or end of period, calculated as
sen_slope * year + intercept
val_perc_change
Percentage change over period, calculated as
(val_end - val_beg) / val_beg * 100
Value
A tibble (see tibble::tibble
) with test statistic, p-value, trend coefficients, and
trend calculations. See Details.
References
Millard, S.P., 2013, EnvStats: An R Package for Environmental Statistics: New York, New York, Springer, 291 p. [Also available at https://doi.org/10.1007/978-1-4614-8456-1.]
Helsel, D.R., Hirsch, R.M., Ryberg, K.R., Archfield, S.A., and Gilroy, E.J., 2020, Statistical methods in water resources: U.S. Geological Survey Techniques and Methods, book 4, chap. A3, 458 p. [Also available at https://doi.org/10.3133/tm4a3.]
See Also
Examples
calc_annual_stat_trend(data = example_annual, year = "WY", value = "annual_mean")