fixed effects Tobit, Honore style?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

fixed effects Tobit, Honore style?

David Hugh-Jones-3
Hi all,

Is there any code to run fixed effects Tobit models in the style of Honore
(1992) in R?
(The original Honore article is here:
http://www.jstor.org/sici?sici=0012-9682%28199205%2960%3A3%3C533%3ATLALSE%3E2.0.CO%3B2-2)

Cheers
David

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: fixed effects Tobit, Honore style?

Daniel Malter
Not that I know of, but the paper says that they are easy to compute. If you did, you could contribute the code.

Best,
Daniel

David Hugh-Jones-3 wrote
Hi all,

Is there any code to run fixed effects Tobit models in the style of Honore
(1992) in R?
(The original Honore article is here:
http://www.jstor.org/sici?sici=0012-9682%28199205%2960%3A3%3C533%3ATLALSE%3E2.0.CO%3B2-2)

Cheers
David

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: fixed effects Tobit, Honore style?

David Hugh-Jones-3
True! Here's my attempt -- use at your own risk.

honore <- function (b, dataset, x1, x2) {
    dxb <- (x2 - x1) %*% b
y1 <- # insert your y variable here
y2 <- # insert your y variable here
    sum(
        (pmax(y1, dxb) - pmax(y2, dxb) - dxb)^2 +
        2*(y1 < dxb)*(dxb-y1)*y2 +
        2*(y2 < -dxb)* (-dxb-y2)*y1
    )
}

fetobit <- function (dataset, form) {
    x2 <- model.matrix(form, dataset[,T=2])
    x1 <- model.matrix(form, dataset[,T=1])
   # could maybe set initial values to something different
    res <- optim(rep(0, ncol(x1)), fn=honore, x1=x1, x2=x2,
        dataset=dataset, method="BFGS", control=list(maxit=1000))
    if (res$convergence != 0) warning("Didn't converge")
    res$par
}

For standard errors, bootstrap.


David Hugh-Jones
Research Associate
CAGE, Department of Economics
University of Warwick
http://davidhughjones.googlepages.com



On 12 July 2011 21:38, Daniel Malter <[hidden email]> wrote:

> Not that I know of, but the paper says that they are easy to compute. If
> you
> did, you could contribute the code.
>
> Best,
> Daniel
>
>
> David Hugh-Jones-3 wrote:
> >
> > Hi all,
> >
> > Is there any code to run fixed effects Tobit models in the style of
> Honore
> > (1992) in R?
> > (The original Honore article is here:
> >
> http://www.jstor.org/sici?sici=0012-9682%28199205%2960%3A3%3C533%3ATLALSE%3E2.0.CO%3B2-2
> )
> >
> > Cheers
> > David
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/fixed-effects-Tobit-Honore-style-tp3662246p3663464.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: fixed effects Tobit, Honore style?

David Hugh-Jones-3
A cleaner and slightly more tested version is at

http://davidhughjones.blogspot.com/2011/07/honore-style-fixed-effects-estimators.html

David Hugh-Jones
Research Associate
CAGE, Department of Economics
University of Warwick
http://davidhughjones.googlepages.com



On 13 July 2011 15:33, David Hugh-Jones <[hidden email]> wrote:

> True! Here's my attempt -- use at your own risk.
>
> honore <- function (b, dataset, x1, x2) {
>     dxb <- (x2 - x1) %*% b
> y1 <- # insert your y variable here
> y2 <- # insert your y variable here
>     sum(
>         (pmax(y1, dxb) - pmax(y2, dxb) - dxb)^2 +
>         2*(y1 < dxb)*(dxb-y1)*y2 +
>         2*(y2 < -dxb)* (-dxb-y2)*y1
>     )
> }
>
> fetobit <- function (dataset, form) {
>     x2 <- model.matrix(form, dataset[,T=2])
>     x1 <- model.matrix(form, dataset[,T=1])
>    # could maybe set initial values to something different
>     res <- optim(rep(0, ncol(x1)), fn=honore, x1=x1, x2=x2,
>         dataset=dataset, method="BFGS", control=list(maxit=1000))
>     if (res$convergence != 0) warning("Didn't converge")
>     res$par
> }
>
> For standard errors, bootstrap.
>
>
> David Hugh-Jones
> Research Associate
> CAGE, Department of Economics
> University of Warwick
> http://davidhughjones.googlepages.com
>
>
>
> On 12 July 2011 21:38, Daniel Malter <[hidden email]> wrote:
>
>> Not that I know of, but the paper says that they are easy to compute. If
>> you
>> did, you could contribute the code.
>>
>> Best,
>> Daniel
>>
>>
>> David Hugh-Jones-3 wrote:
>> >
>> > Hi all,
>> >
>> > Is there any code to run fixed effects Tobit models in the style of
>> Honore
>> > (1992) in R?
>> > (The original Honore article is here:
>> >
>> http://www.jstor.org/sici?sici=0012-9682%28199205%2960%3A3%3C533%3ATLALSE%3E2.0.CO%3B2-2
>> )
>> >
>> > Cheers
>> > David
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> > ______________________________________________
>> > [hidden email] mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide
>> > http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>> >
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/fixed-effects-Tobit-Honore-style-tp3662246p3663464.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.