zelig-tobit

Linear Regression for a Left-Censored Dependent Variable

Tobit regression estimates a linear regression model for a left-censored dependent variable, where the dependent variable is censored from below. While the classical tobit model has values censored at 0, you may select another censoring point. For other linear regression models with fully observed dependent variables, see Bayesian regression (), maximum likelihood normal regression (), or least squares ().

Syntax

z5 <- ztobit$new()
z5$zelig(Y ~ X1 + X2, below = 0, above = Inf, data = mydata)
z5$setx()
z5$sim()

With the Zelig 4 compatibility wrappers:

z.out <- zelig(Y ~ X1 + X2, below = 0, above = Inf, model = "tobit", data = mydata)
x.out <- setx(z.out)
s.out <- sim(z.out, x = x.out)

Inputs

zelig() accepts the following arguments to specify how the dependent variable is censored.

  • below: (defaults to 0) The point at which the dependent variable is censored from below. If any values in the dependent variable are observed to be less than the censoring point, it is assumed that that particular observation is censored from below at the observed value. (See for a Bayesian implementation that supports both left and right censoring.)

  • robust: defaults to FALSE. If TRUE, zelig() computes robust standard errors based on sandwich estimators (see and ) and the options selected in cluster.

  • cluster: if robust = TRUE, you may select a variable to define groups of correlated observations. Let x3 be a variable that consists of either discrete numeric values, character strings, or factors that define strata. Then

    > z.out <- zelig(y ~ x1 + x2, robust = TRUE, cluster = "x3",
                     model = "tobit", data = mydata)
    

    means that the observations can be correlated within the strata defined by the variable x3, and that robust standard errors should be calculated according to those clusters. If robust = TRUE but cluster is not specified, zelig() assumes that each observation falls into its own cluster.

Zelig users may wish to refer to help(survreg) for more information.

Examples

Basic Example

Attaching the sample dataset:

data(tobin)

Estimating linear regression using tobit:

z.out <- zelig(durable ~ age + quant, model = "tobit", data = tobin)
## How to cite this model in Zelig:
##   Christian Kleiber, and Achim Zeileis. 2011.
##   tobit: Linear regression for Left-Censored Dependent Variable
##   in Christine Choirat, James Honaker, Kosuke Imai, Gary King, and Olivia Lau,
##   "Zelig: Everyone's Statistical Software," http://zeligproject.org/

Setting values for the explanatory variables to their sample averages:

x.out <- setx(z.out)

Simulating quantities of interest from the posterior distribution given x.out.

s.out1 <- sim(z.out, x = x.out)
summary(s.out1)
##
##  sim x :
##  -----
## ev
##   mean    sd  50%  2.5% 97.5%
## 1 1.54 0.628 1.46 0.511  3.01
## pv
##      mean   sd  50% 2.5% 97.5%
## [1,] 3.03 3.97 1.31    0  13.1

Simulating First Differences

Set explanatory variables to their default(mean/mode) values, with high (80th percentile) and low (20th percentile) liquidity ratio (quant):

x.high <- setx(z.out, quant = quantile(tobin$quant, prob = 0.8))
x.low <- setx(z.out, quant = quantile(tobin$quant, prob = 0.2))

Estimating the first difference for the effect of high versus low liquidity ratio on duration(durable):

s.out2 <- sim(z.out, x = x.high, x1 = x.low)
summary(s.out2)
##
##  sim x :
##  -----
## ev
##   mean    sd  50%  2.5% 97.5%
## 1 1.17 0.718 1.08 0.153  2.84
## pv
##      mean   sd  50% 2.5% 97.5%
## [1,] 2.73 3.62 1.16    0  12.5
##
##  sim x1 :
##  -----
## ev
##   mean    sd  50%  2.5% 97.5%
## 1 2.03 0.953 1.91 0.509  4.19
## pv
##      mean  sd  50% 2.5% 97.5%
## [1,] 3.57 4.3 2.22    0    15
## fd
##    mean   sd   50%  2.5% 97.5%
## 1 0.865 1.16 0.831 -1.33  3.25
plot(s.out1)

Zelig-tobit

Model

  • Let be a latent dependent variable which is distributed with stochastic component

    where is a vector means and is a scalar variance parameter. is not directly observed, however. Rather we observed which is defined as:

    where is the lower bound below which is censored.

  • The systematic component is given by

    where is the vector of explanatory variables for observation i and \beta is the vector of coefficients.

Quantities of Interest

  • The expected values (qi$ev) for the tobit regression model are the same as the expected value of :

  • The first difference (qi$fd) for the tobit regression model is defined as

  • In conditional prediction models, the average expected treatment effect (qi$att.ev) for the treatment group is

    where is a binary explanatory variable defining the treatment () and control () groups.

Output Values

The Zelig object stores fields containing everything needed to rerun the Zelig output, and all the results and simulations as they are generated. In addition to the summary commands demonstrated above, some simply utility functions (known as getters) provide easy access to the raw fields most commonly of use for further investigation.

In the example above z.out$getcoef() returns the estimated coefficients, z.out$getvcov() returns the estimated covariance matrix, and z.out$getpredict() provides predicted values for all observations in the dataset from the analysis.

See also

The tobit function is part of the survival library by Terry Therneau, ported to R by Thomas Lumley. Advanced users may wish to refer to help(survfit) in the survival library.

Kleiber C and Zeileis A (2008). Applied Econometrics with R. Springer-Verlag, New York. ISBN 978-0-387-77316-2, <URL: http://CRAN.R-project.org/package=AER>.