kenplot {NADA2} | R Documentation |
Plot robust median ATS line for censored data
Description
Function used by other functions to plot the Akritas-Theil-Sen (ATS) line for censored data. Only one x variable allowed. Both Y and X variables may be censored.
Usage
kenplot(
y1,
ycen,
x1,
xcen,
atsline = FALSE,
xnam = NULL,
ynam = NULL,
Title = "Akritas - Theil - Sen line",
ylim = NULL,
xlim = NULL,
pch = NULL,
cex = NULL,
xaxs = "r",
yaxs = "r",
...
)
Arguments
y1 |
The column of y (response variable) values plus detection limits |
ycen |
The y-variable indicators, where 1 (or |
x1 |
The column of x (explanatory variable) values plus detection limits |
xcen |
The x-variable indicators, where 1 (or |
atsline |
Indicator of whether to draw the ATS line or not. Default is FALSE. |
xnam |
Custom label for the x axis of plots. Default is x variable column name. |
ynam |
Custom label for the y axis of plots. Default is y variable column name. |
Title |
Custom title for plots. Default is "Akritas - Theil - Sen line". |
ylim |
argument consistent with |
xlim |
argument consistent with |
pch |
argument consistent with |
cex |
argument consistent with |
xaxs |
argument consistent with |
yaxs |
argument consistent with |
... |
argument to adjust other base plotting functions; see |
Value
Scatterplot of data plus ATS line. Censored values are drawn for both X and Y variables as dashed lines up to the detection limits.
References
Helsel, D.R., 2011. Statistics for Censored Environmental Data using Minitab and R, 2nd ed. John Wiley & Sons, USA, N.J.
See Also
Examples
# Both y and x are censored
data(PbHeron)
with(PbHeron, kenplot(Blood, BloodCen, Kidney, KidneyCen))
# x is not censored
data(Brumbaugh)
with(Brumbaugh, kenplot(Hg, HgCen, PctWetland,rep(0, times=length(PctWetland))))