This repository has been archived by the owner on Oct 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
censSeaken.Rd
84 lines (81 loc) · 3.4 KB
/
censSeaken.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/censSeaken.R
\name{censSeaken}
\alias{censSeaken}
\title{Trend Test}
\usage{
censSeaken(series, nseas = 12)
}
\arguments{
\item{series}{any regularly spaced object that can be forced to
class "lcens" to test for trend. Missing values are permitted.}
\item{nseas}{the number of seasons per year.}
}
\value{
An object of class "htest" also inhereting class "seaken"
containing the following components:
\item{method}{a description of the method.}
\item{statistic}{the value of Kendall's tau.}
\item{p.value}{the p-value. See \bold{Note}.}
\item{p.value.raw}{the p-value computed without correction for serial
correlation. See \bold{Note}.}
\item{p.value.corrected}{the p-value computed with correction for
serial correlation. See \bold{Note}.}
\item{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.}
\item{data.name}{a string containing the actual name of the input
series with the number of years and seasons.}
\item{alternative}{a character string describing alternative to the
test ("two.sided").}
\item{null.value}{the value for the hypothesized slope (0).}
\item{nyears}{the number of years.}
\item{nseasons}{the number of seasons.}
\item{series}{the data that was analyzed converted to numeric values.}
}
\description{
Compute the seasonal Kendall trend test
with the Turnbull slope estimator for left-censored data.
}
\note{
The value of \code{p.value} is \code{p.value.raw} if there are
fewer than 10 years of data and is \code{p.value.corrected} otherwise.
}
\examples{
\dontrun{
# 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))
}
}
\references{
The approach used in \code{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.\cr
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 \url{http://pubs.er.usgs.gov/publication/ofr20111130}).\cr
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.\cr
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.
}