truncSP (version 1.2.2)

truncSP-package: Estimators of semi-parametric truncated regression models

Description

Functions for estimation of semi-parametric linear regression models with truncated response variables (fixed truncation point). Estimation using the Symmetrically Trimmed Least Squares (STLS) estimator (Powell 1986), Quadratic Mode (QME) estimator (Lee 1993) and Left Truncated (LT) estimator (Karlsson 2006).

Arguments

Details

Package:
truncSP
Type:
Package
Version:
1.2.2
Date:
2014-05-05
License:
GPL (>=2)
LazyLoad:
yes
Depends:
R(>= 2.10), methods, truncreg, boot
These semi-parametric estimators provide an alternative to maximum likelihood estimators, which are sensitive to distributional misspecification (Davidson and MacKinnon, 1993, p 536). All three estimators use trimming of the conditional density of the error terms. STLS assumes symmetrically distributed error terms, while QME and LT have been shown to be consistent for estimation of the slope parameters under asymmetrically distributed errors as well (Laitila 2001 and Karlsson 2006). The functions in the package (qme, lt and stls), all use optim to maximize or minimize objective functions wrt the vector of regression coefficients in order to find estimates (Karlsson and Lindmark, 2014). As the covariance matrices of the estimators depend on the density of the error distribution, the estimation of these is complicated and bootstrap (as described in Karlsson 2004 and Karlsson and Lindmark 2014) is used in all three functions.

References

Davidson, R., MacKinnon, J. G. (1993) Estimation and Inference in Econometrics, Oxford University Press, USA Karlsson, M. (2004) Finite sample properties of the QME, Communications in Statistics - Simulation and Computation, 5, pp 567--583 Karlsson, M. (2006) Estimators of regression parameters for truncated and censored data, Metrika, 63, pp 329--341 Karlsson, M., Lindmark, A. (2014) truncSP: An R Package for Estimation of Semi-Parametric Truncated Linear Regression Models, Journal of Statistical Software, 57(14), pp 1--19, http://www.jstatsoft.org/v57/i14/ Laitila, T. (2001) Properties of the QME under asymmetrically distributed disturbances, Statistics & Probability Letters, 52, pp 347--352 Lee, M. (1993) Quadratic mode regression, Journal of Econometrics, 57, pp 1-19 Lee, M., Kim, H. (1998) Semiparametric econometric estimators for a truncated regression model: a review with an extension, Statistica Neerlandica, 52(2), pp 200--225 Powell, J. (1986) Symmetrically Trimmed Least Squares Estimation for Tobit Models, Econometrika, 54(6), pp 1435--1460

See Also

truncreg, function for estimating models with truncated response variables by maximum likelihood assuming Gaussian errors

Examples

Run this code
 ##Simulate a data.frame (model with asymmetrically distributed errors)
n <- 10000
x1 <- runif(n,0,10)
x2 <- runif(n,0,10)
x3 <- runif(n,-5,5)
eps <- rexp(n,0.2)- 5
y <- 2-2*x1+x2+2*x3+eps
d <- data.frame(y=y,x1=x1,x2=x2,x3=x3)
   
##Use a truncated subsample
dtrunc <- subset(d, y>0)

##Use qme or lt to consistently estimate the slope parameters
qme(y~x1+x2+x3, dtrunc, point=0, direction="left", cval="ols", const=1, 
   beta="ols", covar=FALSE)
lt(y~x1+x2+x3, dtrunc, point=0, direction="left", clower="ols", const=1, 
   cupper=2, beta="ols", covar=FALSE)
   
##Simulate a data.frame (symmetrically distributed errors)
n <- 10000
x1 <- runif(n,0,10)
x2 <- runif(n,0,10)
x3 <- runif(n,-5,5)
y <- 1-2*x1+x2+2*x3+rnorm(n,0,2)
d <- data.frame(y=y,x1=x1,x2=x2,x3=x3)

##Use a truncated subsample
dtrunc <- subset(d, y>0)
  
##Use stls to estimate the model
stls(y~x1+x2+x3, dtrunc, point=0, direction="left", beta="ols", covar=FALSE)

Run the code above in your browser using DataLab