computeS: Kendall's S-statistic for permutations of censored data

Description Usage Arguments Value References See Also Examples

View source: R/computeS.R

Description

Computes a Kendall rank correlation S-statistic for permutations of censored data. Collectively these represent the variation in S expected when the null hypothesis is true. Called by censeaken. computeS is not expected to be of much use to users on its own.

Usage

1
computeS(x, y, ycen, seas = NULL, R = R)

Arguments

x

Column of the time variable, either a sequence of days or decimal times, etc. Time data for one season.

y

The column of y (response variable) values plus detection limits for one season.

ycen

The y-variable indicators, where 1 (or TRUE) indicates a detection limit in the y column, and 0 (or FALSE) indicates a detected value in y.

seas

Name of a single season classification. Usually though not necessarily a text variable.

R

The number of repetitions in the permutation process. R is often between 999 and 9999 (+ the 1 observed test statistic produces 1000 to 10000 realizations).

Value

An Rx1 matrix containing an S-value for each of the R data permutations.

References

Helsel, D.R., Hirsch, R.M., Ryberg, K.R., Archfield, S.A., Gilroy, E.J., 2020. Statistical Methods in Water Resources. U.S. Geological Survey Techniques and Methods, book 4, chapter A3, 458p., https://doi.org/10.3133/tm4a3.

See Also

Kendall::Kendall

Examples

1
2
3
4
5
6
7
8
data(Brumbaugh)

#Artifical time and season variables for demonstration purposes
Brumbaugh$time=1:nrow(Brumbaugh)
Brumbaugh$sea=as.factor(round(runif(nrow(Brumbaugh),1,4),0))


with(Brumbaugh,computeS(time,Hg,HgCen,sea,R=100))

NADA2 documentation built on April 30, 2021, 5:09 p.m.