1

I am trying to generate an interaction plot using the following code:

library(plm)
FE <- plm(y~a*b+c,data=pdata, effect="time",model="within")
summary(FE)
plot_model(FE, type = "pred", terms = c("a", "b"))

and I receive this error:

Error in crossprod(beta, t(X)) : non-conformable arguments

It seem to occur when trying to use plot_model() with plm models with time-fixed or two way effects. However, it works when I fit the same model using for example between, random or usual within effects.

Did someone experience similar problems and is able to help?

Helix123
  • 3,502
  • 2
  • 16
  • 36
sustainex
  • 31
  • 1
  • `plot_model` calls the function `predict` which calls function `crossprod` in which the number of rows of one table must be equal to the number of columns of the other table. Maybe you have too many interaction terms and too few samples. Do you get the same output using just `a` instead of `a*b+c`? – danlooo Feb 22 '22 at 14:59
  • This is likely as within models do not have an intercept (while between, random, and pooling models have an intercept by default). You may reach out to the author of `plot_model` (you did not indicate from which package this function is) and ask to support this model type (or maybe time-fixed effects models only as you state that it works with "usual within effects" which I take as individual fixed effects). – Helix123 Feb 22 '22 at 20:14

0 Answers0