Executing a fixed effect regression

For an analysis for my master thesis I am using a fixed effect regression model. However, I am not very familiar with this kind of analyses. I hope you guys and girls can help me.

So my equation is formulated as follows:

Employmentmy = β1SEZmy + β2Number of firmsmy + β3Educationmy + β4Wagemy + μy + λm + εmy

The variables encompass the following:

μy = Is the intercept that may vary each year*

β1SEZmy = Dummy-independent variable if an municipality has an SEZ (1) or not (0) in a given year

β2Educationmy = Control variable just like the other 2, which represents a certain value for municipality 'm' in year 'y'

λm= Municipality fixed effect to control for example geographic location in municipality 'm'

εmy= Error term in municipality 'm' in year 'y'

I hope someone can help with writing the right formula in order to execute this analysis in RStudio.

In advance thank you!

lm(Employment ~ SEZ + NumberOfFirms + Education + Wage + Year + as.factor(municipality)-1)
understanding that one dummy for SEZm, Year, or Municipality will be dropped.

Thank you! Now I included one more variable, namely λy which is a time fixed effect. So the formula is as follows:

Employmentmy = β1SEZmy + β2Number of firmsmy + β3Educationmy + β4Wagemy + μy + λm + λy + εmy

How will the R-command look like then?

*Before I want to perform the analysis, I first want to split the dataset by year (from 2008-2017), because now everything is in a dataset with all years with values ​​together and also for each year whether a municipality has an SEZ or not. I then want to divide that year into (1) or no (0) SEZ, so that you have two groups per year. Which then shows the 'β' and the significance level for each variable (from the formula). I hope this is clear, otherwise I would be happy to provide additional information!


\mu y and \lambda y are redundant.