Tobit: Prepare a Response for a Tobit Model

TobitR 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 log is TRUE, then the default is the minimal value of logst(data), and if limit>0, it refers to the untransformed data.

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 TRUE, data will be log transformed by calling logst. Argument transform will be ignored.

...

any additional arguments to the transform function

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

Surv() from package survival.

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)
}

plgraphics documentation built on Oct. 19, 2023, 3 p.m.