Professional Documents
Culture Documents
I want to estimate a fixed effects model while using panel-corrected standard errors as well as
Prais-Winsten (AR1) transformation in order to solve panel heteroscedasticity,
1 contemporaneous spatial correlation and autocorrelation.
I have time-series cross-section data and want to perform regression analysis. I was able to
estimate a fixed effects model, panel corrected standard errors and Prais-winsten estimates
individually. And I was able to include panel corrected standard errors in a fixed effects
model. But I want them all at once.
# Prais-Winsten estimates
library(prais)
prais1 <- prais_winsten(y ~ x1 + x2, data = data)
summary(prais1)
In the Stata command: xtpcse it is possible to include both panel corrected standard errors
and Prais-Winsten corrected estimates, with something allong the following code:
https://stackoverflow.com/questions/56042590/is-there-a-way-to-both-include-pcse-and-prais-winsten-correction-in-a-fixed-effe 1/2
07/06/2023, 13:32 regression - Is there a way to both include PCSE and Prais-Winsten correction in a fixed effects model in R (similar to the xt…
Share Follow edited May 13, 2019 at 9:53 asked May 8, 2019 at 14:00
Helix123 Bo Boaz Kaarsemaker
3,422 2 16 35 Kaars 61 7
Sorted by:
1 Answer
Highest score (default)
I am not sure that my answer will completely address your concern, these days I've been
trying to deal with the same problem that you mention.
0
In my case, I ran the Prais-Winsten function from the package prais where I included my
model with the fixed effects. Afterwards, I correct for heteroskedasticity using the function
vcovHC.prais which is analogous to vcovHC function from the package sandwich.
library(lmtest)
prais.fe.w <- coeftest(prais.fe, vcov = vcovHC.prais(prais.fe, "HC1")
h.m1 # run the object to see the output with the corrected standard errors.
Alas, I am aware that the sandwhich heteroskedasticity-consistent standard errors are not
exactly the same as the Beck and Katz's PCSEs because PCSE deals with panel
heteroskedasticity while sandwhich SEs addresses overall heteroskedasticity. I am not totally
sure in how much these two differ in practice, but something is something.
I hope my answer was somehow helpful, this is actually my very first answer :D
Join Stack Overflow to find the best answer to your technical question, help others
Sign up
answer theirs.
https://stackoverflow.com/questions/56042590/is-there-a-way-to-both-include-pcse-and-prais-winsten-correction-in-a-fixed-effe 2/2