Package 'censReg'

Title: Censored Regression (Tobit) Models
Description: Maximum Likelihood estimation of censored regression (Tobit) models with cross-sectional and panel data.
Authors: Arne Henningsen <[email protected]>
Maintainer: Arne Henningsen <[email protected]>
License: GPL (>= 2)
Version: 0.5-39
Built: 2024-11-16 04:50:30 UTC
Source: https://github.com/r-forge/sampleselection

Help Index


Censored Regression (Tobit) Model

Description

Fitting a model with a censored dependent variable.

Usage

censReg( formula, left = 0, right = Inf, data = sys.frame( sys.parent()),
   subset = NULL, start = NULL, nGHQ = 8, logLikOnly = FALSE, ... )

## S3 method for class 'censReg'
print( x, logSigma = TRUE, digits = 4, ... )

Arguments

formula

an object of class "formula": a symbolic description of the model to be fitted.

left

left limit for the censored dependent variable; if set to -Inf, the dependent variable is assumed to be not left-censored; defaults to zero (classical Tobit model).

right

right limit for the censored dependent variable; if set to Inf, the dependent variable is assumed to be not right-censored; defaults to Inf (classical Tobit model).

data

an optional data frame. If argument data is of class "pdata.frame", a panel-model is estimated.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

start

an optional vector of initial parameters for the ML estimation (intercept, slope parameters, logarithm of the standard deviation of the individual effects (only for random-effects panel data models), and logarithm of the standard deviation of the general disturbance term); if start is not specified, initial values are taken from an OLS estimation or (uncensored) random-effects panel data estimation.

nGHQ

number of points used in the Gauss-Hermite quadrature, which is used to compute the log-likelihood value in case of the random effects model for panel data.

logLikOnly

logical. If TRUE, the model is not estimated but the log-likelihood contributions of all observations/individuals and the corresponding gradients calculated at the parameters specified by argument start are returned.

x

object of class censReg (returned by censReg).

logSigma

logical value indicating whether the variance(s) of the model should be printed logarithmized (see coef.censReg).

digits

positive integer specifiying the minimum number of significant digits to be printed (see print.default).

...

additional arguments for censReg are passed to maxLik; additional arguments for print.censReg are currently ignored.

Details

The model is estimated by Maximum Likelihood (ML) assuming a Gaussian (normal) distribution of the error term. The maximization of the likelihood function is done by function maxLik of the maxLik package. An additional argument method can be used to specify the optimization method used by maxLik, e.g.\ "Newton-Raphson", "BHHH", "BFGS", "SANN" (for simulated annealing), or "NM" (for Nelder-Mead).

Value

If argument logLikOnly is FALSE (default), censReg returns an object of class "censReg" inheriting from class "maxLik". The returned object contains the same components as objects returned by maxLik and additionally the following components:

call

the matched call.

terms

the model terms.

nObs

a vector containing 4 integer values: the total number of observations, the number of left-censored observations, the number of uncensored observations, and the number of right-censored observations.

df.residual

degrees of freedom of the residuals.

start

vector of starting values.

left

left limit of the censored dependent variable.

right

right limit of the censored dependent variable.

xMean

vector of mean values of the explanatory variables.

In contrast, if argument logLikOnly is TRUE, censReg returns a vector of the log-likelihood contributions of all observations/individuals. This vector has an attribute "gradient", which is a matrix containing the gradients of the log-likelihood contributions with respect to the parameters.

Note

When the censored regression model is estimated, the log-likelihood function is maximized with respect to the coefficients and the logarithm(s) of the variance(s).

Author(s)

Arne Henningsen

References

Greene, W.H. (2008): Econometric Analysis, Sixth Edition, Prentice Hall, p. 871-875.

Kleiber, C. and Zeileis, A. (2008): Applied Econometrics with R, Springer, p. 141-143.

Tobin, J. (1958): Estimation of Relationships for Limited Dependent Variables. Econometrica 26, p. 24-36.

See Also

summary.censReg, coef.censReg, tobit, selection

Examples

## Kleiber & Zeileis ( 2008 ), page 142
data( "Affairs", package = "AER" )
estResult <- censReg( affairs ~ age + yearsmarried + religiousness +
   occupation + rating, data = Affairs )
print( estResult )

## Kleiber & Zeileis ( 2008 ), page 143
estResultBoth <- censReg( affairs ~ age + yearsmarried + religiousness +
   occupation + rating, data = Affairs, right = 4 )
print( estResultBoth )

Coefficients, their Covariances, and Log-Likelihood Values of Censored Regression Models

Description

These functions extract the coefficient vectors, the corresponding covariance matrices, and log-likelihood values from censored regression models.

Usage

## S3 method for class 'censReg'
coef( object, logSigma = TRUE, ... )

## S3 method for class 'censReg'
vcov( object, logSigma = TRUE, ... )

## S3 method for class 'censReg'
logLik( object, ... )

Arguments

object

object of class "censReg" (returned by censReg).

logSigma

logical value indicating whether the variance(s) of the model should be returned logarithmized.

...

currently not used.

Value

coef.censReg returns a vector of the estimated coefficients.

vcov.censReg returns the covariance matrix of the estimated coefficients.

logLik.censReg returns an object of class "logLik". This object is the log-likelihood value of the estimated model and has an attribute "df" that gives the degrees of freedom, i.e.\ the number of estimated parameters.

Note

When the censored regression model is estimated, the log-likelihood function is maximized with respect to the coefficients and the logarithm(s) of the variance(s). Hence, if argument logSigma is FALSE, the variance(s) of the model is/are calculated by applying the exponential function to the estimated logarithmized variance(s) and the covariance matrix of all parameters is calculated by the Delta method.

Author(s)

Arne Henningsen

See Also

censReg, summary.censReg, and coef.summary.censReg

Examples

## Kleiber & Zeileis ( 2008 ), page 142
data( "Affairs", package = "AER" )
estResult <- censReg( affairs ~ age + yearsmarried + religiousness +
   occupation + rating, data = Affairs )
coef( estResult )
coef( estResult, logSigma = FALSE )
vcov( estResult )
vcov( estResult, logSigma = FALSE )
logLik( estResult )

Coefficients of Censored Regression Models and their Statistical Properties

Description

This function returns the estimated coefficients of censored regression models as well as their standard errors, z-values, and P-values.

Usage

## S3 method for class 'summary.censReg'
coef( object, logSigma = TRUE, ... )

Arguments

object

object of class "summary.censReg" (returned by summary.censReg).

logSigma

logical value indicating whether the variance(s) of the model should be returned logarithmized.

...

currently not used.

Value

coef.summary.censReg returns an matrix, where each row corresponds to one coefficient and the 4 rows contain the estimated coefficients, their standard errors, z-values, and P-values.

Author(s)

Arne Henningsen

See Also

censReg, summary.censReg and coef.censReg

Examples

## Kleiber & Zeileis ( 2008 ), page 142
data( "Affairs", package = "AER" )
estResult <- censReg( affairs ~ age + yearsmarried + religiousness +
   occupation + rating, data = Affairs )
coef( summary( estResult ) )

Marginal Effects in Censored Regression Models

Description

The margEff method computes the marginal effects of the explanatory variables on the expected value of the dependent variable evaluated. Please note that this functionality is currently not available for panel data models.

Usage

## S3 method for class 'censReg'
margEff( object, xValues = NULL, vcov = NULL,
   calcVCov = TRUE, returnJacobian = FALSE, vcovLogSigma = TRUE, ... )

## S3 method for class 'margEff.censReg'
summary( object, ... )

Arguments

object

argument object of the margEff method must be an object of class "censReg" (returned by censReg); argument object of the summary method must be an object of class "margEff.censReg" (returned by margEff.censReg).

xValues

vector that specifies the values of the explanatory variables (including the intercept if it is included in the model), at which the marginal effects should be calculated. The number and order of the elements of this vector must correspond to the number and order of the estimated coefficients (without sigma). If this argument is NULL (or not specified), argument xValues is set to the mean values of the explanatory variables.

vcov

a symmetric matrix that specifies the variance covariance matrix of the estimated coefficients that should be used to calculate the variance covariance matrix and the standard errors of the marginal effects. If this argument is NULL (the default), the variance covariance matix is obtained by vcov( object ).

calcVCov

logical. If TRUE, the approximate variance covariance matrices of the marginal effects is calculated and returned as an attribute (see below).

returnJacobian

logical. If TRUE, the Jacobian of the marginal effects with respect to the coefficients is returned as an attribute (see below).

vcovLogSigma

logical. TRUE (the default) indicates that the last row and last column of the variance covariance matrix provided by argument vcov indicate the (co)variances of the logarithm of the sigma coefficient, while FALSE indicates that this row and this column indicate the (co)variances of the (non-logarithic) sigma coefficient. If argument vcov is NULL, argument vcovLogSigma is ignored.

...

currently not used.

Value

margEff.censReg returns an object of class "margEff.censReg", which is a vector of the marginal effects of the explanatory variables on the expected value of the dependent variable evaluated at the mean values of the explanatory variables. The returned object has an attribute df.residual, which is equal to the degrees of freedom of the residuals.

If argument calcVCov is TRUE, the object returned by margEff.censReg has an attribute vcov, which is a the approximate variance covariance matrices of the marginal effects calculated with the Delta method.

If argument returnJacobian is TRUE, the object returned by margEff.censReghas an attribute jacobian, which is the Jacobian of the marginal effects with respect to the coefficients.

summary.margEff.censReg returns an object of class "summary.margEff.censReg", which is a matrix with four columns, where the first column contains the marginal effects, the second column contains the standard errors of the marginal effects, the third column contains the corresponding t-values, and the fourth columns contains the corresponding P values.

Author(s)

Arne Henningsen

See Also

censReg, coef.censReg, and summary.censReg

Examples

## Kleiber & Zeileis ( 2008 ), page 142
data( "Affairs", package = "AER" )
estResult <- censReg( affairs ~ age + yearsmarried + religiousness +
   occupation + rating, data = Affairs )
margEff( estResult )
summary( margEff( estResult ) )
margEff( estResult, xValues = c( 1, 40, 4, 2, 4, 4 ) )

Summary Results of Censored Regression Models

Description

These methods prepare and print summary results for censored regression models.

Usage

## S3 method for class 'censReg'
summary( object, ... )

## S3 method for class 'summary.censReg'
print( x, logSigma = TRUE, digits = 4, ... )

Arguments

object

object of class "censReg" (returned by censReg).

x

object of class "summary.censReg" (returned by summary.censReg).

logSigma

logical value indicating whether the variance(s) of the model should be printed logarithmized.

digits

positive integer specifiying the minimum number of significant digits to be printed (passed to printCoefmat).

...

currently not used.

Value

summary.censReg returns an object of class "summary.censReg" inheriting from class "summary.maxLik". The returned object contains the same components as objects returned by summary.maxLik and additionally the following components:

call

the matched call.

nObs

a vector containing 4 integer values: the total number of observations, the number of left-censored observations, the number of uncensored observations, and the number of right-censored observations.

Author(s)

Arne Henningsen

See Also

censReg, coef.summary.censReg, and coef.censReg

Examples

## Kleiber & Zeileis ( 2008 ), page 142
data( "Affairs", package = "AER" )
estResult <- censReg( affairs ~ age + yearsmarried + religiousness +
   occupation + rating, data = Affairs )
summary( estResult )