Tobit {plgraphics} | R Documentation |
Prepare a Response for a Tobit Model
Description
Returns a Surv
object that allows for setting up a Tobit
regression model by calling survreg
Usage
Tobit(data, limit = 0, limhigh = NULL, transform = NULL, log = FALSE, ...)
Arguments
data |
the variable to be used as the response in the Tobit regression |
limit |
Lower limit which censors the observations.
If |
limhigh |
Upper limit which censors the observations (for untransformed data). |
transform |
if data should be transformed, specify the function to be used. |
log |
logical. If |
... |
any additional arguments to the |
Details
Tobit regression is a special case of regression with left censored
response data. The function survreg
is suitable for fitting.
In regr
, this is done automatically.
Value
A Surv
object.
Author(s)
Werner A. Stahel
See Also
Examples
if(requireNamespace("survival")) {
data("tobin", package="survival")
Tobit(tobin$durable)
(t.r <- survival::survreg(Tobit(durable) ~ age + quant,
data = tobin, dist="gaussian"))
if(interactive())
plregr(t.r)
}