censSeaken: Trend Test

View source: R/censSeaken.R

censSeakenR Documentation

Trend Test

Description

Compute the seasonal Kendall trend test with the Turnbull slope estimator for left-censored data.

Usage

censSeaken(series, nseas = 12)

Arguments

series

any regularly spaced object that can be forced to class "lcens" to test for trend. Missing values are permitted.

nseas

the number of seasons per year.

Value

An object of class "htest" also inhereting class "seaken" containing the following components:

method

a description of the method.

statistic

the value of Kendall's tau.

p.value

the p-value. See Note.

p.value.raw

the p-value computed without correction for serial correlation. See Note.

p.value.corrected

the p-value computed with correction for serial correlation. See Note.

estimate

a named vector containing the Sen estimate of the slope in units per year, the median value of the data, and the median value of time.

data.name

a string containing the actual name of the input series with the number of years and seasons.

alternative

a character string describing alternative to the test ("two.sided").

null.value

the value for the hypothesized slope (0).

nyears

the number of years.

nseasons

the number of seasons.

series

the data that was analyzed converted to numeric values.

Note

The value of p.value is p.value.raw if there are fewer than 10 years of data and is p.value.corrected otherwise.

References

The approach used in censSeaken was used ooriginally in Sullivan and others (2009). The original version of the code was published in Lorenz and others (2011). It is based on principles for comparing censored values in Helsel (2012) and the Turnbull slope estiamte is described by Turnbul(1974).

Helsel, D.R. 2012, Statistics for censored environmental data using Minitab and R: New York, Wiley, 324 p.
Lorenz, D.L., Ahearn, E.A., Carter, J.M., Cohn, T.A., Danchuk, W.J., Frey, J.W., Helsel, D.R., Lee, K.E., Leeth, D.C., Martin, J.D., McGuire, V.L., Neitzert, K.M., Robertson, D.M., Slack, J.R., Starn, J., Vecchia, A.V., Wilkison, D.H., and Williamson, J.E., 2011, USGS library for S-PLUS for Windows—Release 4.0: U.S. Geological Survey Open-File Report 2011-1130. (Available at http://pubs.er.usgs.gov/publication/ofr20111130).
Sullivan, D.J., Vecchia, A.V., Lorenz, D.L., Gilliom, R.J., and Martin, J.D., 2009, Trends in pesticide concentrations in corn-belt streams, 1996???-2006: U.S. Geological Survey Scientific Investigations Report 2009-5132, 75 p.
Turnbull, B.W., 1974, Nonparametric estimation of a survivorship function with doubly censored data: Journal of the American Statistical Society, v. 69, p. 169–173.

Examples

## Not run: 
# Compare censored and uncensored to seaken
library(USGSwsData)
data(KlamathTP)
# Construct the regular series
KlamathTP.rs <- with(KlamathTP, regularSeries(TP_ss, sample_dt,
 begin="1972-01-01", end="1980-01-01"))
# Uncensored, differences due to rounding
with(KlamathTP.rs, seaken(Value, 12))
with(KlamathTP.rs, censSeaken(Value, 12))
# About 30 percent censoring, censSeaken closer to uncensored slope
with(KlamathTP.rs, seaken(ifelse(Value < 0.05, 0.025, Value), 12))
with(KlamathTP.rs, censSeaken(as.lcens(Value, 0.05), 12))

## End(Not run)

USGS-R/restrend documentation built on Oct. 11, 2022, 6:10 a.m.