I am a beginner in R. I am using the plm package and I want to know the easiest way to get cluster robust standard errors for the fixed effects estimator. My data (called Mydata) is on poverty, GDP, investment, and education in 130 countries over 33 years, and my index in plm is country and time. My model is something like this:
Fixedeffect<-plm(Y~ X_(i,t) + W_(i,t) + Z_(i,t) , data=Mydata, model= "within")
Where Y, X, W, and Z are all panel data variables.
I read this post: Standard error clustering in R (either manually or in plm) , but it didn't help.
Someone there suggested to use this:
coeftest(model.plm,vcov=vcovHC(model.plm,type="HC0",cluster="group"))
but it didn't work for me. I got the following error:
could not find function "coeftest"
Can anyone help, Please?