Learn R Programming

NADA2 (version 1.0.1)

kenplot: 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"
)

Arguments

y1

The column of y (response variable) values plus detection limits

ycen

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.

x1

The column of x (explanatory variable) values plus detection limits

xcen

The x-variable indicators, where 1 (or TRUE) indicates a detection limit in the x.var column, and 0 (or FALSE) indicates a detected value in x.var.

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".

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

NADA::cenken

Examples

Run this code
# NOT RUN {
# 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))))
# }

Run the code above in your browser using DataLab