Beginner's question probably. I would like to know why, to measure country fixed effects, I need to subtract one from the factor variable that I would like to consider as a fixed effect.
For example, I want to consider country and year fixed effects, so my regression model is:
lm(Premium ~ Brand + factor(Country) - 1 + factor(Year) -1 +
Population + Employment + Inflation, data=df)
From what I understand, the -1
after each factor is due to the fact that I need to subtract one baseline country/year from which to measure the fixed effects. However, in the regression output, I get a coefficient for all 18 countries in my data. Shouldn't one country be "missing" from the list of results since it is the baseline? Instead, if the output is correct, what's the right interpretation and what is the default baseline R considers? Below is the output:
lm(Y ~ X - 1)
would mean regress $Y$ against $X$ without an intercept term $\endgroup$