Seasonal Kendall permutation test on censored data
censeaken(
time,
y,
y.cen,
group,
LOG = FALSE,
R = 4999,
nmin = 4,
seaplots = FALSE,
printstat = TRUE
)
Column of the time variable, either a sequence of days or decimal times, etc. Will be the scale used for time in the trend analysis.
The column of y (response variable) values plus detection limits
The y-variable indicators, where 1 (or TRUE
) indicates a detection limit in the y.var
column, and 0 (or FALSE
) indicates a detected value in y.var
.
Column of the season classifications. A factor in R, so usually though not necessarily a text variable. If numeric, define as a factor before running the script.
Indicator of whether to compute the trend analysis in the original y units, or on their logarithms. The default is to use the logarithms (LOG = TRUE
). To compute in original units, specify the option LOG = FALSE
(or LOG = 0).
The number of repetitions in the permutation process. R is often between 999 and 9999 (adding +1 to represent the observed test statistic produces 1000 to 10000 repetitions). By default R=4999. Increasing R results in lower variation in the p-values produced between runs.
The minimum number of observations needed for the entire time period to be tested, per season. For example, with 1 sample per year per season over an 8-year period, you have 8 observations for each season. You can increase this number if you want a higher minimum. Don<U+2019>t decrease it below the default of 4. If there are fewer than nmin values that season is skipped and not included in the overall test and a note of this will be printed in the console.
In addition to the plot of the overall Seasonal Kendall trend line, plots of the trend in individual seasons can also be drawn.
Logical TRUE
/FALSE
option of whether to print the resulting statistics in the console window, or not. Default is TRUE.
Prints the Kendall trend test results for each season individually. The overall Seasonal Kendall test and Theil-Sen line results are both printed and returned.
If seaplots=TRUE
each season's trend line will be plotted seperately. A plot of the overall Seasonal Kendall (Akritas-Theil-Sen) line is always plotted.
If seaplots=FALSE
only the overall Seasonal Kendall (Akritas-Theil-Sen) line will be plotted on a data scatterplot.
Helsel, D.R., 2011. Statistics for censored environmental data using Minitab and R, 2nd ed. John Wiley & Sons, USA, N.J.
Hirsch, R.M., Slack, J.R., Smith, R.A., 1982. Techniques of Trend Analysis for Monthly Water Quality Data, Water Res. Reseach 18, 107-121.
# NOT RUN {
data(Brumbaugh)
# Artificial 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,censeaken(time,Hg,HgCen,sea,seaplots = TRUE))
# }
Run the code above in your browser using DataLab