0

I would like to plot the effects of variables in interaction terms, using panel data and a FE model.

I have various interaction effects in my equation, for example this one here:

FIXED1 <- plm(GDPPCgrowth ~ FDI * PRIVCR, data = dfp)

I can only find solutions for lm, but not for plm.

So on the x-axis there should be PRIVCR and on the y-axis the effect of FDI on growth.

Thank you for your help!

Lisa

Lisa
  • 1
  • 1
  • 1
    You should try to include a reproducible example in your post. As it is, we can't run your code. – MLavoie Apr 12 '16 at 21:45

1 Answers1

0

I am not aware of a package that supports plm objects directly. As you are asking for FE models, you can just take an LSDV approach for FE and do the estimation by lm to get an lm object which works with the effects package. Here is an example for the Grunfeld data:

library(plm)
library(effects)
data("Grunfeld", package = "plm")

mod_fe <- plm(inv ~ value + capital + value:capital, data = Grunfeld, model = "within")
Grunfeld[ , "firm"] <- factor(Grunfeld[ , "firm"]) # needs to be factor in the data NOT in the formula [required by package effects]
mod_lsdv <- lm(inv ~ value + capital + value:capital + firm, data = Grunfeld)
coefficients(mod_fe)    # estimates are the same
coefficients(mod_lsdv)  # estimates are the same

eff_obj <- effects::Effect(c("value", "capital"), mod_lsdv)
plot(eff_obj)
Helix123
  • 3,502
  • 2
  • 16
  • 36