I want to perform a regression in a fixed-effects model. To construct such a model, I have multiple FLAGs, like the following:
y ~ x + z + FlagYear1 + FlagYear2 + FlagYear3 + FlagCountry1 + FlagCountry2
I want to perform another regression in which I have fixed effects for Year * Country, so that the model will be equal to this
y ~ x + z + FlagYear1Country1 + FlagYear1Country2 + FlagYear2Country1 + FlagYear2Country2 + FlagYear3Country1 + FlagYear3Country2
As I have 26 countries and 8 Years in my model, so it would be very time-consuming to manually construct all the FLAGs. I know there is a command to perform this automatically in Stata, how can I do the same in R?