0

I have a dataframe consisting of a time series and I want to run Poisson quasi ML models using the fixest package. To account for autocorrelation of the error terms, I want to compute Newey West standard errors. However, so far, I have not managed to do that. Here is my code:

model1 <- feglm(y ~ x1 + x2 + x3 | x4,
                data, family = quasipoisson)
summary(model1, newey ~ time)

When I run the code I get the error message:

Error: in summary.fixest_multi(model1, newey ~ time):
 Argument 'type' must be a single character equal to 'short', 'long', 'compact' or
'se_compact'. Problem: it is not a vector, it is of class 'formula'. 

Any help would be highly appreciated.

Paul
  • 11
  • 2

1 Answers1

0

Your summary call dispatches summary.fixest_multi, which second argument is type= whereas you probably want cluster=. You should use a named argument.

summary(model1, cluster=newey ~ time)
jay.sf
  • 60,139
  • 8
  • 53
  • 110
  • When I run your code, I get: ```Error in vcov.fixest(object, se = se, cluster = cluster, dof = dof, forceCovariance = forceCovariance, : If argument cluster is to be a formula, it must be one sided: e.g. ~fe_1+fe_2.``` I also tried ```summary(model1, vcov =newey ~ time)```. But this gives me the ordinary standard errors as in ```summary(model1)```. – Paul Oct 11 '22 at 13:48
  • @Paul Probably because `"time"` isn't included in your real data, try the name of the variable associated with time instead. BTW, you could make a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – jay.sf Oct 11 '22 at 14:39