IQSS / Zelig

A statistical framework that serves as a common interface to a large range of models
http://zeligproject.org
109 stars 43 forks source link

Clustered standard errors for OLS models do not work #354

Open matthewbondy opened 2 years ago

matthewbondy commented 2 years ago

Hello,

I output several imputed panel data sets using Amelia and am trying to run an OLS regression using time and unit fixed effects, with clustered standard errors. I get the following warning message:

Warning messages:
1: In lm.wfit(x, y, w, offset = offset, singular.ok = singular.ok, 
    ...) :
 extra arguments ‘robust’, ‘cluster’ will be disregarded 

I'm not sure this warning has anything to do with using Amelia data because I get a similar warning when doing a simple test. When I run this:

library(Zelig)
data(bivariate)
m_noCluster <- zelig(formula=y1 ~ x1, data=bivariate, model="logit", cite=FALSE)
m_cluster <- zelig(formula=y1 ~ x1, data=bivariate, robust=TRUE, cluster="x4", model="logit", cite=FALSE)

I get this error:

Error in glm.control(robust = TRUE, cluster = "x4") : 
  unused arguments (robust = TRUE, cluster = "x4")

Thanks, Matt