htobit {ppml}R Documentation

Heteroscedastic Tobit Regression

Description

Fitting tobit regression models with conditional heteroscedasticity.

Usage

htobit(formula, data, subset, na.action,
  model = TRUE, y = TRUE, x = FALSE,
  control = htobit_control(...), ...)

htobit_fit(x, y, z = NULL, control)

htobit_control(maxit = 5000, start = NULL, ...)

Arguments

formula

a formula expression of the form y ~ x | z where y is the response and x and z are regressor variables for the location and the scale of the latent Gaussian distribution respectively.

data

an optional data frame containing the variables occurring in the formulas.

subset

an optional vector specifying a subset of observations to be used for fitting.

na.action

a function which indicates what should happen when the data contain NAs.

model

logical. If TRUE model frame is included as a component of the returned value.

x, y

for htobit: logical. If TRUE the model matrix and response vector used for fitting are returned as components of the returned value. For htobit.fit: x is a design matrix with regressors for the location and y is a vector of observations.

z

a design matrix with regressors for the scale.

...

arguments to be used to form the default control argument if it is not supplied directly.

control, maxit, start

a list of control parameters passed to optim .

Details

htobit fits tobit regression models with conditional heteroscedasticity with maximum likelihood estimation.

htobit_fit is the lower level function where the actual fitting takes place.

Value

An object of class "htobit".

References

Messner JW, Mayr GJ, Zeileis A (2016). Heteroscedastic Censored and Truncated Regression with crch. The R Journal, 3(1), 173–181. https://journal.R-project.org/archive/2016-1/messner-mayr-zeileis.pdf.

See Also

crch

Examples

## artificial data-generating process
dgp <- function(n, coef = c(1, 1, -1, 0, 1, 0)) {
  d <- data.frame(
    x1 = runif(100, -1, 1),
    x2 = runif(100, -1, 1)
  )
  d$ystar <- rnorm(100,
    mean = coef[1] + coef[2] * d$x1 + coef[3] * d$x2,
    sd = exp(coef[4] + coef[5] * d$x1 + coef[6] * d$x2)
  )
  d$y <- pmax(0, d$ystar)
  return(d)
}

## data
set.seed(2017-05-15)
d <- dgp()

## homoscedastic vs. heteroscedastic tobit model
m0 <- htobit(y ~ x1 + x2, data = d)
m1 <- htobit(y ~ x1 + x2 | x1 + x2, data = d)

## comparison of the two models
AIC(m0, m1)
BIC(m0, m1)
if(require("lmtest")) {
lrtest(m0, m1)
}

## comparison with crch
if(require("crch")) {
c1 <- crch(y ~ x1 + x2 | x1 + x2, data = d, left = 0)
cbind(coef(m1), coef(c1))
}

[Package ppml version 0.0-1 Index]