cenregQQ function

Q-Q plot of censored regression residuals

Q-Q plot of censored regression residuals

Plots a quantile-quantile (Q-Q) plot of censored regression residuals for simple or multiple regression.

cenregQQ(y.var, cen.var, x.vars, LOG = TRUE, intcens = FALSE, main = NULL)

Arguments

  • y.var: The column of y (response variable) values plus detection limits. Alternatively, with interval-censord data, the column of the lower end of the interval.
  • cen.var: The column of 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. Alternatively, with interval-censored data the column of the high end of the interval.
  • x.vars: One or more uncensored explanatory variable(s). See Details
  • LOG: Indicator of whether to compute the regression 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).
  • intcens: a logical value indicating the input data is interval-censored instead of a column of values plus a column of indicators.
  • main: overall title for the plot. A default titel will be used if none is specified.

Returns

Q-Q Plot of model residuals and Shapiro-Francia test results.

Examples

data(Brumbaugh) # One variable cenregQQ(Brumbaugh$Hg,Brumbaugh$HgCen,Brumbaugh$PctWetland) # More than one variable for demostration purposes cenregQQ(Brumbaugh$Hg,Brumbaugh$HgCen,Brumbaugh[,c("PctWetland","SedLOI","Weight")])

References

Helsel, D.R., 2011. Statistics for censored environmental data using Minitab and R, 2nd ed. John Wiley & Sons, USA, N.J.

Millard, S.P., 2013. EnvStats: An R Package for Environmental Statistics. Springer-Verlag, New York.

Shapiro, S.S., Francia, R.S., 1972. An approximate analysis of variance test for normality. Journal of the American Statistical Association 67, 215–216.

  • Maintainer: Paul Julian
  • License: MIT + file LICENSE
  • Last published: 2024-09-06