Package truncreg. R topics documented: August 3, 2016

Similar documents
Package mvprobit. November 2, 2015

Package palmtree. January 16, 2018

Package mnlogit. November 8, 2016

Package vinereg. August 10, 2018

Package endogenous. October 29, 2016

Package glogis. R topics documented: March 16, Version Date

Package intreg. R topics documented: February 15, Version Date Title Interval Regression

Package oglmx. R topics documented: May 5, Type Package

Package glmmml. R topics documented: March 25, Encoding UTF-8 Version Date Title Generalized Linear Models with Clustering

Package intccr. September 12, 2017

Package Formula. July 11, 2017

Package bife. May 7, 2017

Package CompGLM. April 29, 2018

Package ihs. February 25, 2015

Package GWRM. R topics documented: July 31, Type Package

Package survivalmpl. December 11, 2017

Package lmesplines. R topics documented: February 20, Version

Package RWiener. February 22, 2017

Package caic4. May 22, 2018

Package glmnetutils. August 1, 2017

The glmmml Package. August 20, 2006

Package assortnet. January 18, 2016

Package OrthoPanels. November 11, 2016

Package rpst. June 6, 2017

Package MIICD. May 27, 2017

Package StVAR. February 11, 2017

Package logitnorm. R topics documented: February 20, 2015

Package sfa. R topics documented: February 20, 2015

Package SSLASSO. August 28, 2018

Package addhaz. September 26, 2018

Package milr. June 8, 2017

Package modmarg. R topics documented:

Package flexcwm. May 20, 2018

Package TANDEM. R topics documented: June 15, Type Package

Package SmoothHazard

Package MatchIt. April 18, 2017

Package RAMP. May 25, 2017

Package fastdummies. January 8, 2018

Package calibrar. August 29, 2016

Package NormalLaplace

Package lgarch. September 15, 2015

Package misclassglm. September 3, 2016

Package GLMMRR. August 9, 2016

The grplasso Package

Package datasets.load

Package gppm. July 5, 2018

Package CALIBERrfimpute

Package nsprcomp. August 29, 2016

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package mreg. February 20, 2015

Package bayesdp. July 10, 2018

Package ordinalcont. January 10, 2018

Package iterators. December 12, 2017

Package sfc. August 29, 2016

Package ibm. August 29, 2016

Package ordinalnet. December 5, 2017

Package dglm. August 24, 2016

Package TBSSurvival. January 5, 2017

Package RLT. August 20, 2018

Package reval. May 26, 2015

Package robets. March 6, Type Package

Package crch. October 18, 2016

Package PTE. October 10, 2017

Package DSBayes. February 19, 2015

Package ICsurv. February 19, 2015

Package repec. August 31, 2018

Package rgcvpack. February 20, Index 6. Fitting Thin Plate Smoothing Spline. Fit thin plate splines of any order with user specified knots

Beta Regression: Shaken, Stirred, Mixed, and Partitioned. Achim Zeileis, Francisco Cribari-Neto, Bettina Grün

Package svalues. July 15, 2018

Package ssmn. R topics documented: August 9, Type Package. Title Skew Scale Mixtures of Normal Distributions. Version 1.1.

Package TSzip. February 15, 2013

Package rmi. R topics documented: August 2, Title Mutual Information Estimators Version Author Isaac Michaud [cre, aut]

Package intcensroc. May 2, 2018

Package imgur. R topics documented: December 20, Type Package. Title Share plots using the imgur.com image hosting service. Version 0.1.

Package libstabler. June 1, 2017

Package InformativeCensoring

Package DTRreg. August 30, 2017

Package Cubist. December 2, 2017

Package FWDselect. December 19, 2015

Package detect. February 15, 2013

Package ptinpoly. February 20, 2015

Package mcemglm. November 29, 2015

Package pnmtrem. February 20, Index 9

Package simsurv. May 18, 2018

Package simr. April 30, 2018

Package nricens. R topics documented: May 30, Type Package

Package OLScurve. August 29, 2016

Package MultiRR. October 21, 2015

Package LTRCtrees. March 29, 2018

Package clustvarsel. April 9, 2018

Package EBglmnet. January 30, 2016

Package OutlierDC. R topics documented: February 19, 2015

Package coxme. R topics documented: May 13, Title Mixed Effects Cox Models Priority optional Version

Package RegressionFactory

Package TBSSurvival. July 1, 2012

The cmprsk Package. January 1, 2007

Package PrivateLR. March 20, 2018

Extended Model Formulas in R : Multiple Parts and Multiple Responses

STENO Introductory R-Workshop: Loading a Data Set Tommi Suvitaival, Steno Diabetes Center June 11, 2015

Package robustgam. February 20, 2015

Transcription:

Package truncreg August 3, 2016 Version 0.2-4 Date 2016-08-03 Title Truncated Gaussian Regression Models Depends R (>= 1.8.0), maxlik Suggests survival Description Estimation of models for truncated Gaussian variables by maximum likelihood. License GPL (>= 2) URL http://r-forge.r-project.org/projects/truncreg/ Author Yves Croissant [aut, cre], Achim Zeileis [aut] Maintainer Yves Croissant <yves.croissant@univ-reunion.fr> Repository CRAN Repository/R-Forge/Project truncreg Repository/R-Forge/Revision 10 Repository/R-Forge/DateTimeStamp 2016-08-03 15:06:57 Date/Publication 2016-08-03 23:50:45 NeedsCompilation no R topics documented: truncreg........................................... 2 Index 5 1

2 truncreg truncreg Truncated Gaussian Response Models Description Usage Estimation of models for truncated Gaussian variables by maximum likelihood. truncreg(formula, data, subset, weights, na.action, point = 0, direction = "left", model = TRUE, y = FALSE, x = FALSE, scaled = FALSE,...) Arguments formula data Details Value subset weights na.action a symbolic description of the model to be estimated, the data, an optional vector specifying a subset of observations, an optional vector of weights, a function which indicates what should happen when the data contains NA s, point the value of truncation (the default is 0), direction model, y, x scaled the direction of the truncation, either "left" (the default) or "right", logicals. If TRUE the corresponding components of the fit (model frame, response, model matrix) are returned,... further arguments. if TRUE, scaled parameters (beta / sigma) are estimated, The model is estimated with the maxlik package and the Newton-Raphson method, using analytic gradient and Hessian. A set of standard extractor functions for fitted model objects is available for objects of class "truncreg", including methods to the generic functions print, summary, coef, vcov, loglik, residuals, predict, fitted, model.frame, and model.matrix. An object of class "truncreg", a list with elements: coefficients vcov fitted.values loglik the named vector of coefficients, the variance matrix of the coefficients, the fitted values, the value of the log-likelihood,

truncreg 3 gradient nobs call terms model y x point direction est.stat the gradient of the log-likelihood at convergence, the number of observations, the matched call, the model terms, the model frame used (if model = TRUE), the response vector (if y = TRUE), the model matrix (if x = TRUE), the truncation point used, the truncation direction used, some information about the estimation (time used, optimization method), References Cragg JG (1971). Some Statistical Models for Limited Dependent Variables with Application to the Demand for Durable Goods. Econometrica, 39, 829 844. Hausman JA, Wise DA (1976). The Evaluation of Results from Truncated Samples: The New- Jersey Negative Income Tax Experiment. Annals of Economic ans Social Measurment, 5, 421 445. Hausman JA, Wise DA (1976). Social Experimentation, Truncated Distributions and Efficient Estimation. Econometrica, 45, 421 425. Tobin J (1958). Estimation of Relationships for Limited Dependent Variables. Econometrica, 26, 24 36. See Also maxlik, mhurdle Examples ######################## ## Artificial example ## ######################## ## simulate a data.frame set.seed(1071) n <- 10000 sigma <- 4 alpha <- 2 beta <- 1 x <- rnorm(n, mean = 0, sd = 2) eps <- rnorm(n, sd = sigma) y <- alpha + beta * x + eps d <- data.frame(y = y, x = x) ## truncated response d$yt <- ifelse(d$y > 1, d$y, NA) ## binary threshold response

4 truncreg d$yb <- factor(d$y > 0) ## censored response d$yc <- pmax(1, d$y) ## compare estimates for full/truncated/censored/threshold response fm_full <- lm(y ~ x, data = d) fm_trunc <- truncreg(yt ~ x, data = d, point = 1, direction = "left") fm_thresh <- glm(yb ~ x, data = d, family = binomial(link = "probit")) library("survival") fm_cens <- survreg(surv(yc, yc > 1, type = "left") ~ x, data = d, dist = "gaussian") ## compare scaled regression coefficients cbind( "True" = c(alpha, beta) / sigma, "Full" = coef(fm_full) / summary(fm_full)$sigma, "Truncated" = coef(fm_trunc)[1:2] / coef(fm_trunc)[3], "Censored" = coef(fm_cens) / fm_cens$scale, "Threshold" = coef(fm_thresh) ) ################################ ## Tobin's durable goods data ## ################################ ## Tobit model (Tobin 1958) data("tobin", package = "survival") tobit <- survreg(surv(durable, durable > 0, type = "left") ~ age + quant, data = tobin, dist = "gaussian") ## Two-part model (Cragg 1971) ## (see "mhurdle" package for a combined solution) cragg_probit <- glm(factor(durable > 0) ~ age + quant, data = tobin, family = binomial(link = "logit")) cragg_trunc <- truncreg(durable ~ age + quant, data = tobin, subset = durable > 0) ## Scaled coefficients cbind( "Tobit" = coef(tobit) / tobit$scale, "Binary" = coef(cragg_probit), "Truncated" = coef(cragg_trunc)[1:3] / coef(cragg_trunc)[4]) ## likelihood ratio test and BIC ll <- c("tobit" = tobit$loglik[1], "Two-Part" = as.vector(loglik(cragg_probit) + loglik(cragg_trunc))) df <- c(4, 3 + 4) pchisq(2 * diff(ll), diff(df), lower.tail = FALSE) -2 * ll + log(nrow(tobin)) * df

Index Topic regression truncreg, 2 coef, 2 coef.truncreg (truncreg), 2 fitted, 2 fitted.truncreg (truncreg), 2 loglik, 2 loglik.truncreg (truncreg), 2 maxlik, 2, 3 mhurdle, 3 model.frame, 2 model.frame.truncreg (truncreg), 2 model.matrix, 2 model.matrix.truncreg (truncreg), 2 predict, 2 predict.truncreg (truncreg), 2 print, 2 print.summary.truncreg (truncreg), 2 print.truncreg (truncreg), 2 residuals, 2 residuals.truncreg (truncreg), 2 summary, 2 summary.truncreg (truncreg), 2 truncreg, 2 vcov, 2 vcov.truncreg (truncreg), 2 5