I am currently running a fixed effects model with the use of the plm
function from the package of the same name. I have clustering in the data, so I am using the vcovCR
function from the clubSandwich
package to get the standard errors of the estimated regression coefficients.
What I want to do is the following: Create a graph that shows the predicted value of Y given X1 (when the other variables are held constant at their mean values) and also add 95% confidence bands to the plot.
What I have tried:
- Using the
ggpredict()
function from theggeffects
package. This did not work due to theplm
package apparently being problematic forggeffects
. - Manually using the "group centered" approach of fixed effects estimation, and then running the usual
lm()
function on the group centered data. Runningggpredict()
on that data does give me nice confidence bands, but the values of X and Y are then group centered (surprise, surprise!) and I want the predictions and values of X to be on the original scale, not on the mean centered scale.
Any suggestions on how to produce confidence bands for fixed effect estimation, when using cluster robust standard errors would be much appreciated.