Perform regression on order statistics for left-censored data.
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,
...
)
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.
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).
Logical vector of left-censored indicators.
A data.frame
containing the variables in the formula.
Name of transformation function (e.g., "log", "trueT").
Name of back-transformation function (e.g., "exp", "trueT").
Function to handle missing values.
ros2 model object
default = FALSE, if set to true it will also plot censored data
will plot linear model line
will add grid
default is "Value" but custom text can be added
default set to 16, codes consistent with points
and plot
functions
arguments passed to plot function
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.
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