I'm trying to plot interaction effects from a fixed effects model. For some reason, I always get the same error message: Error in crossprod(beta, t(X)) : non-conformable arguments
First I thought this was only my data (maybe multicollinearity) but the same problem happens when using data included with the plm package. Here's an example:
library(plm)
library(sjPlot)
data("Grunfeld", package="plm")
grun.fe <- plm(inv~value+capital, data = Grunfeld, model = "within")
plot_model(grun.fe, type = "pred", terms = c("value","capital"))
In fact, if I want to do any sort of prediction with any estimated fixed effects model (for example using predict), I get the same error message. Random effects and pooled panel models work fine, it's only with fixed effects.
I wonder if this is to do with the way plm stores the fixed effects result matrix but couldn't find any help from the plm manual. The same task runs fine in Stata using xtreg for example with margins and marginsplot. Any help would be much appreciated!