# Tobit model with R

Does anybody know where to find good application and examples (besides the manual and the book applied econometrics with R) using the tobit model with the packages AER?

### Edit

I'm searching for a command to compute the marginal effects for y (not for the latent variable y*). It seems to be $$\phi(x\beta/\sigma)\beta$$, where $$\phi$$ is the std.normal cumulative distribution function. But how can I compute those effects with R?

It is not in the package, just write your own command. If your regression is reg <- tobit(y~x) then the vector of effects should be

pnorm(x%*%reg$coef[-1]/reg$scale)%*%reg$coef[-1].  • Did you miss some t()? Just get some non-conformable arguments when I try to it with the example data provided by AER::tobit. Would you mind giving it a try with the example dataset? Jul 19, 2013 at 9:52 I had the same issue (“non-conformable arguments”) that @hans0l0 mentioned in comment above. I think I have resolved this, and will try to explain here. First, there is an error in the equation in the original post. It should be$ϕ(xβ/σ)β_j$—i.e., there is a subscript after the second$β$but not after the first. In a Tobit model, the marginal effect of a variable$x_j$is determined not only by the coefficient of that particular variable (the$β_j$); an adjustment factor is also required that gets calculated from the values of other variables in the model (the$ϕ(xβ/σ)$). From Wooldridge 2006 (p. 598): The adjustment factor… depends on a linear function of$x$,$xβ/σ = (β_0 + β_1x_1 + … + β_kx_k)/σ$. It can be shown that the adjustment factor is strictly between zero and one. This adjustment factor means that we have to make a choice about the values of the other variables in the model: “we must plug in values for the xj, usually the mean values or other interesting values” (Wooldridge 2006, p598). So generally this would be the mean, but it could also be the median, the top/bottom quartile, or anything else. This relates to why @hans0l0 and I were getting the “non-conformable argument” errors when we were using Alex’s code above: the “x” in that code will be a vector when what we need is a single value for the variable (mean / median / etc). I believe there is also another error in the code above in that it excludes the intercept value from the adjustment term (with the [-1] script after the first use of reg$coef). My understanding of this (but I’m happy to be corrected) is that the adjustment term should include the intercept (the $β_0$ from above).

That all said, here is an example using the dataset from AER::tobit (“Affairs”):

## Using the same model and data as in the Tobit help file
## NB: I have added the “x=TRUE” command so the model saves the x values

> fm.tobit <- tobit(affairs ~ age + yearsmarried + religiousness + occupation + rating,
data = Affairs, x=TRUE)
> fm.tobit$coef (Intercept) age yearsmarried religiousness occupation rating 8.1741974 -0.1793326 0.5541418 -1.6862205 0.3260532 -2.2849727 > fm.tobit$scale
[1] 8.24708

## the vector of marginal effects (at mean values and for y > 0) should be as follows.
## note the [-1] used to remove the intercept term from the final vector,
##  but not from within the adjustment term.

> pnorm(sum(apply(fm.tobit$x,2,FUN=mean) * fm.tobit$coef)/fm.tobit$scale) * fm.tobit$coef[-1]
age        yearsmarried  religiousness  occupation  rating
-0.041921  0.1295365     -0.394172      0.076218    -0.534137


Important to reiterate: these are marginal effects only in the cases where y is positive (i.e. at least one affair has happened) and at the mean values of all of the explanatory variables.

If somebody would like to check those results using a program with a built-in marginal effects tool for Tobit models, I would be curious to see the comparison. Any comments and corrections will be very appreciated.

Reference:
Wooldridge, Jeffrey M. 2006. Introductory Econometrics: A Modern Approach. Thomson South-Western. 3rd Edition.

• Thanks for this contribution. Welcome to CV. I hope we'll see more. Mar 14, 2015 at 17:59
• In reaction to your last paragraph, R's package {censReg} and the functions censReg() combined with margEff.censReg() produce the same results as your calculation, plus some statistical inference output. Dec 5, 2021 at 16:36