zelig package: robust SE

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

zelig package: robust SE

T.Riedle
Dear R users,

I am trying to run a logistic regression using zelig. The simple logistic regression works well but now I want to have HAC robust standard errors. I have read in the manual that there is an option called "robust" and that zelig() computes robust SE via the sandwich package. However, it doesn't work. My code looks as follows:


crisis_bubble4<-zelig(stock.market.crash~crash.MA+bubble.MA+MP.MA<http://mp.ma/>+UTS.MA<http://uts.ma/>+UPR.MA<http://upr.ma/>+PPI.MA<http://ppi.ma/>+RV.MA<http://rv.ma/>,robust=TRUE,model="logit",data=Data_logitregression_movingaverage)

Error in glm.control(robust = TRUE) : unused argument (robust = TRUE)



I took this code from the zelig manual and don't understand why I get an error. What is more, I want to calculate NeweyWest SE or the SE using the weights by Andrews via the kernHAC function. How can I do that?

Thanks for your support.

Kind regards

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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: zelig package: robust SE

Achim Zeileis-4
On Sun, 29 May 2016, T.Riedle wrote:

> Dear R users,
>
> I am trying to run a logistic regression using zelig. The simple
> logistic regression works well but now I want to have HAC robust
> standard errors. I have read in the manual that there is an option
> called "robust" and that zelig() computes robust SE via the sandwich
> package. However, it doesn't work. My code looks as follows:
>
> crisis_bubble4<-zelig(stock.market.crash~crash.MA+bubble.MA+MP.MA+UTS.MA+UPR.MA+PPI.MA+RV.MA<http://rv.ma/>,robust=TRUE,model="logit",data=Data_logitregression_movingaverage)
>
> Error in glm.control(robust = TRUE) : unused argument (robust = TRUE)

Possibly this changed in recent versions of "Zelig". The documentation
for relogit on the official Zelig web page shows the same error:
http://docs.zeligproject.org/en/latest/zelig-relogit.html#example-2-one-tau-with-weighting-robust-standard-errors-and-bias-correction

In any case, Zelig only interfaced the so-called "robust" standard errors
(sandwich or HC0) and not the ones with HAC correction.

> I took this code from the zelig manual and don't understand why I get an
> error. What is more, I want to calculate NeweyWest SE or the SE using
> the weights by Andrews via the kernHAC function. How can I do that?

Why do you want to use Zelig? Apparently, the solution using plain glm()
along with the sandwich package and coeftest() did work for you. And in my
other e-mail I showed you how you can use lrm().

> Thanks for your support.
>
> Kind regards
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.