Today when I run this regression

Code:
did2s l_homicide [aweight=popwt], first_stage(i.sid i.year) second_stage(i.post) treatment(post) cluster(sid)
The code above can be explained as below
Code:
reg l_homicide i.sid i.year [aweight=popwt] if post == 0
predict adj, residuals
reg adj i.post [aweight=popwt], vce(cluster sid) nocons


I got the error notice as below

Code:
maxvar too small
    You have attempted to use an interaction with too many levels or attempted to fit a model with too many variables.  You need to increase maxvar; it is currently 5000.  Use set maxvar;
    see help maxvar.

    If you are using factor variables and included an interaction that has lots of missing cells, try set emptycells drop to reduce the required matrix size; see help set emptycells.

    If you are using factor variables, you might have accidentally treated a continuous variable as a categorical, resulting in lots of categories.  Use the c. operator on such variables.

I have a couple of questions as below:

1> I am still confused regarding "factor variables". In my panel dataset, I have indicators for the region, country, firm, and year. So, the factor variables here are "firm" and "year" or all of these four?

2> whether set empty cells affect the dataset (delete some observations, in "set emptycells drop" case)? And how to turn off this set emptycells command?

3> "If you are using factor variables, you might have accidentally treated a continuous variable as a categorical". I do not think that if firms and years are factor variables here, they would not suffers this problem, am I falling into any fallacy?

Many thanks and warmest regards.