Running predict() after tobit() in package AER

2019-07-11 17:52发布

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

标签: r predict
2条回答
Juvenile、少年°
2楼-- · 2019-07-11 18:38

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".

查看更多
叛逆
3楼-- · 2019-07-11 18:41

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"))
查看更多
登录 后发表回答