Kendall's S-statistic for permutations of censored data
Kendall's S-statistic for permutations of censored data
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.
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).
Returns
An Rx1 matrix containing an S-value for each of the R data permutations.
Examples
data(Brumbaugh)#Artifical time and season variables for demonstration purposesBrumbaugh$time=1:nrow(Brumbaugh)Brumbaugh$sea=as.factor(round(runif(nrow(Brumbaugh),1,4),0))with(Brumbaugh,computeS(time,Hg,HgCen,sea,R=100))
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.