[R] Tobit model with panel data
Arne Henningsen
arne.henningsen at gmail.com
Thu May 1 11:14:12 CEST 2014
Hi Phil
On 30 April 2014 23:06, phil <quijote at gmx.net> wrote:
> I just started to work with R a couple of weeks ago. Right now I would like
> to regress an independent variable on a couple of explanatory variables. The
> dependent variable is left censored in the sense that all negative values
> and zero are set equal to one.
That is most likely not a suitable data transformation.
> This is done because I want to take the logarithm which, as you all know,
> is only defined for values bigger than zero.
>
> However, what I don't know now is how to compute this on R. Does anybody
> know how to proceed? I already checked
> http://cran.r-project.org/web/packages/censReg/vignettes/censReg.pdf
> <http://cran.r-project.org/web/packages/censReg/vignettes/censReg.pdf> but
> I am not able to apply the commands shown on page 8 correctly on my data
> set.
>
> Hence, I would really appreciate if somebody could give me a step-by-step
> instruction for my own dataset.
1st step: load the data set into R (see
http://cran.r-project.org/doc/manuals/r-release/R-data.html)
2nd step: use pdata.frame() or plm.data() to specify the panel
structure (see http://www.jstatsoft.org/v27/i02/)
3rd step: use censReg() to estimate the model (see
http://cran.r-project.org/web/packages/censReg/vignettes/censReg.pdf)
Please do read the posting guide http://www.R-project.org/posting-guide.html
Best regards,
Arne
--
Arne Henningsen
http://www.arne-henningsen.name
More information about the R-help
mailing list