Hi Nick, thanks so much for the videos and free resources you provide. Quick question: I've estimated a panel regression using plm() in R and need to adjust my standard errors. I would like to cluster over three variables (year, origin, destination) and I haven't found any documentation that indicates that it works with plm. Loading sandwich and using vcovCL() did not help, unfortunately; rather it produces the error: coeftest(fs1, vcov = vcovCL(fs1, cluster = ~ destination + year + origin)) -> Error in UseMethod("estfun") : no applicable method for 'estfun' applied to an object of class "c('plm', 'panelmodel')". Just wondering if you knew the answer or another approach off the top of your head.
Hi Nick, great video as always! I was wondering, I am aware sandwich estimators can be used to deal with heteroscedasticity and serial correlation; can they also deal with bias ,e.g., from omitted variables?
Thanks! And no, sandwich estimators will not deal with bias. They only adjust the standard errors, not the coefficients themselves, so they can't fix anything wrong with the coefficients.
@@NickHuntingtonKlein Thanks for the reply. I thought, in the case where zero conditional mean was violated which may manifest with non normal errors, the errors could be modelled and used with WLS in a way that deals with this endogeneity. Do you think that would be possible; or, even if possible, inefficient, in comparison to other methods such as introduction of omitted variables, or model respecification?
@@Marteenez_ maybe there's some magic trick I don't know about, but I suspect for this to work you'd at least need to use the variables that are the source of endogenetity in your modeling to solve the problem
@@NickHuntingtonKlein Ah, I thought as much. It would be a bit convoluted, given the methods available. Just wondering for my own understanding. Thanks!
Your videos are always very clear and engaging. I appreciate your content!!
Awesome video - thank you!
One of the best videos on youtube so far on standard error.
Hi Nick, thanks so much for the videos and free resources you provide. Quick question: I've estimated a panel regression using plm() in R and need to adjust my standard errors. I would like to cluster over three variables (year, origin, destination) and I haven't found any documentation that indicates that it works with plm. Loading sandwich and using vcovCL() did not help, unfortunately; rather it produces the error: coeftest(fs1, vcov = vcovCL(fs1, cluster = ~ destination + year + origin)) -> Error in UseMethod("estfun") : no applicable method for 'estfun' applied to an object of class "c('plm', 'panelmodel')". Just wondering if you knew the answer or another approach off the top of your head.
Thanks! Try vcovCR from the plm package instead of vcovCL. If that doesn't work, I recommend switching from plm to feols in the fixest package.
Thanks for your response! I was afraid I'd have to switch to fixest haha. :)@@NickHuntingtonKlein
Hi Nick, great video as always! I was wondering, I am aware sandwich estimators can be used to deal with heteroscedasticity and serial correlation; can they also deal with bias ,e.g., from omitted variables?
Thanks! And no, sandwich estimators will not deal with bias. They only adjust the standard errors, not the coefficients themselves, so they can't fix anything wrong with the coefficients.
@@NickHuntingtonKlein Thanks for the reply. I thought, in the case where zero conditional mean was violated which may manifest with non normal errors, the errors could be modelled and used with WLS in a way that deals with this endogeneity. Do you think that would be possible; or, even if possible, inefficient, in comparison to other methods such as introduction of omitted variables, or model respecification?
@@Marteenez_ maybe there's some magic trick I don't know about, but I suspect for this to work you'd at least need to use the variables that are the source of endogenetity in your modeling to solve the problem
@@NickHuntingtonKlein Ah, I thought as much. It would be a bit convoluted, given the methods available. Just wondering for my own understanding. Thanks!
comment to help with algorithm :)