censReg | R Documentation |
Builds a linear regression model for censored response data.
censReg(formula, data, subset, weights, na.action, dist = "normal")
formula |
a formula describing the regression model. See Details. |
data |
the data to search for the variables in |
subset |
an expression to select a subset of the data. |
weights |
a variable to use for weights. |
na.action |
what to do with missing values. |
dist |
the distribution of the data, either "normal," "lognormal," or "commonlog." See Details. |
The left-hand side of the formula may be any numeric variable, just as with
lm
or a variable of class "lcens," "mcens," or "qw."
For un- or left-censored data, AMLE is used unless weights are specified in
the model, then MLE is used, through a call to survreg
. For any other
censored data, MLE is used.
If dist
is "normal," then the regression analysis assumes that the
residuals are normally distributed. If dist
is "lognormal," then
the regression analysis assumes that the residuals are lognormally
distributed. In this case, predicted values are back transformed and
optionally bias corrected to represent the expected mean. If dist
is "commonlog," then the response data are transformed using log10
and those residuals are assumed to be normally distributed. No back
transformation is made for predicted values.
An object of class "censReg."
A special feature of censReg
is the ability to expand
the formula passed as a variable rather than as an expressly entered
formula. This feature is intended to facilitate certain kinds of scripts that
construct a formula from combinations of variables in a dataset.
Objects of class "censReg" have these methods:
extract the regression coefficents
compute another information criterion (AIC) value
extract the fitted values
compute the log-likelihood of the fitted model
extract the number of observations used to fit the model
create some basic diagnostic plots
predict new values from the model
print the model
extract the residuals from the model
compute the root mean squared error (residual standard error)
compute summary information about the model
extract the variance-covariance matrix from the model
compute the variance inflation factors for the explanatory variables in the model
The AMLE method has arbitrary limitations on the size of the data: 24 explanatory variables and 5000 observations. Exceeding these will generate a warning message with the error code in the output object.
Lorenz, 2015, smwrQW.
Breen, R., 1996, Regression models: censored, sample selected, or truncated data:
Sage University Paper series on Quantitative Applications in the Social Sciences,
07-111, Thousand Oaks, CA,
Cohn, T.A., 1988, Adjusted maximum likelihood estimation of moments
of lognormal populations from type I censored samples:
U.S. Geological Survey Open-File Report 88-350, 34 p.
lm
, survreg
set.seed(345) X <- runif(24, 1, 5) Y <- X/2 + rnorm(24) lm(Y ~ X) # the uncensored regression censReg(as.lcens(Y, 1) ~ X) # censored at 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.