Learn R Programming

NADA2 (version 2.0.1)

ros: Regression on Order Statistics (ROS)

Description

Perform regression on order statistics for left-censored data.

Usage

ros(
  obs,
  censored = NULL,
  data = NULL,
  forwardT = "log",
  reverseT = "exp",
  na.action = getOption("na.action")
)

# S3 method for ros plot( x, plot.censored = FALSE, lm.line = TRUE, grid = TRUE, ylab = "Value", pch = 16, ... )

Value

A list with:

modeled

Numeric vector of uncensored + imputed censored values.

modeled.censored

Imputed values only for censored observations.

uncensored

Original uncensored values.

censored

Original censored values.

censored.ranks

Censored ranks used in estimation.

uncensored.ranks

Uncensored ranks used in estimation.

model

Fitted linear model object.

Arguments

obs

Numeric vector of observations or formula of the form response ~ censor, where response is numeric values and censor is a logical or binary indicator (TRUE if censored).

censored

Logical vector of left-censored indicators.

data

A data.frame containing the variables in the formula.

forwardT

Name of transformation function (e.g., "log", "trueT").

reverseT

Name of back-transformation function (e.g., "exp", "trueT").

na.action

Function to handle missing values.

x

ros2 model object

plot.censored

default = FALSE, if set to true it will also plot censored data

lm.line

will plot linear model line

grid

will add grid

ylab

default is "Value" but custom text can be added

pch

default set to 16, codes consistent with points and plot functions

...

arguments passed to plot function

Details

Code for this function is originally from the NADA package developed by R. Lopaka Lee and Dennis Helsel. By default, ros performs a log transformation prior to, and after operations over the data. This can be changed by specifying a forward and reverse transformation function using the forwardT and reverseT parameters. No transformation will be performed if either forwardT or reverseT are set to NULL.

The procedure first computes the Weibull-type plotting positions of the combined uncensored and censored observations using a formula designed for multiply-censored data (see hc_ppoints). A linear regression is formed using the plotting positions of the uncensored observations and their normal quantiles. This model is then used to estimate the concentration of the censored observations as a function of their normal quantiles. Finally, the observed uncensored values are combined with modeled censored values to corporately estimate summary statistics of the entire population. By combining the uncensored values with modeled censored values, this method is more resistant of any non-normality of errors, and reduces any transformation errors that may be incurred.

Examples

Run this code
df <- data.frame(
  conc = c(0.2, 0.5, 1.0, 0.4, 2.0, 0.3),
  censored = c(TRUE, TRUE, FALSE, TRUE, FALSE, TRUE)
)
ros(conc ~ censored, data = df)

Run the code above in your browser using DataLab