I am trying to replicate the following econometric equation from the paper "How do french manufacturing firms react to Energy shocks ?"
s denotes sectors,i denotes firms, and t denotes year. The paper uses panel data. As you see it has $\phi_i$ for firms fixed effects. I know how to implement such in R, I would use the following code:
model1 <- plm(log(Panel$Prices)~ log(Panel$Electricity.pricr)+log(Panel$Gaz.Price)+
data=Panel, index= c("Secteur","Date"), model="within",effect= "individual")
The command effect= "individual" enables me to have firm fixed effect.
However the paper includes also sector-year fixed effects $\chi_{st}$. But I do not know how to implement a fixed effect that plays on two variable at the same time: s and t. Do you know how I could implement it in R ?
Thank you
interaction(secteur, year)
seems to do the job. It generates a factor. You can add it as a regressor. $\endgroup$model1 <- plm(log(Panel$Prices)~ log(Panel$Electricity.pricr)+log(Panel$Gaz.Price)+ interaction(Secteur, year), data=Panel, index= c("Secteur","Date"), model="within",effect= "individual")
$\endgroup$year
variable $\endgroup$