Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running predict() after tobit() in package AER

Tags:

r

predict

I am doing a tobit analysis on a dataset where the dependent variable (lets call it y) is left censored at 0. So this is what I do:

library(AER) 
fit <- tobit(data=mydata,formula=y ~ a + b + c)

This is fine. Now I want to run the "predict" function to get the fitted values. Ideally I am interested in the predicted values of the unobserved latent variable "y*" and the observed censored variable "y" [See Reference 1].

I checked the documentation for predict.survreg [Reference 2] and I don't think I understood which option gives me the predicted censored variables (or the latent variable).

Most examples I found online advise the following :

predict(fit,type="response").

Again, its not clear what kind of predictions these are.

My guess is that the "type" option in the predict function is the key here, with type="response" meant for the censored variable predictions and type="linear" meant for latent variable predictions.

Can someone with some experience here, shed some light for me please ?

Many Thanks!

References:

  1. http://en.wikipedia.org/wiki/Tobit_model

  2. http://astrostatistics.psu.edu/datasets/2006tutorial/html/survival/html/predict.survreg.html

like image 861
Rajiv Avatar asked Dec 06 '25 07:12

Rajiv


2 Answers

Generally predict-"response" results have been back-transformed to the original scale of data from whatever modeling transformations were used in a regression, whereas the "linear" predictions are the linear predictors on the link transformed scale. In the case of tobit which has an identity link, they should be the same.

You can check my meta-prediction easily enough. I just checked it with the example on the ?tobit page:

plot(predict(fm.tobit2, type="response"), predict(fm.tobit2,type="linear"))
like image 69
IRTFM Avatar answered Dec 08 '25 21:12

IRTFM


I posted a similar question on stats.stackexchange and I got an answer that could be useful for you:

https://stats.stackexchange.com/questions/149091/censored-regression-in-r

There one of the authors of the package shows how to calculate the mean of (ie. prediction) of $Y$ where $Y = max(Y^*,0)$. Using the package AER this has to be done somewhat "by hand".

like image 24
Richi W Avatar answered Dec 08 '25 22:12

Richi W



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!