Fixed effects estimates different number of parameters with different datasets Consider a simple panel data model of wage determination, with two periods, and only one regressor: a dummy of whether individual lives in urban or rural area. Importantly, individuals can switch location between periods. $U$ is urban, $R$ is rural. $1$ is year 1, $2$ is year 2, $i$ is individual, and $t \in \{1,2\}$. The model is:
$$ w_{i,t} = \alpha + \beta U1_{i,t} + \gamma U2_{i,t} + \phi R1_{i,t} + \theta R2_{i,t} + \epsilon_{i,t} $$
where $Ut_{i,t}$ and $Rt_{i,t}$ are dummy stating whether individual $i$ is in rural/urban in period $t$. (Note: I add all categories just for clarification. Naturally, the four of them are collinear with the constant). 
For example, the data matrix might look like this:
$$
\begin{array}{cc|cccc}
i & t & \text{constant} & U1_{i,t} & U2_{i,t} & R1_{i,t} & R2_{i,t} \\
\hline
1 & 1 & 1 & 1 & 0 & 0 & 0 \\
1 & 2 & 1 & 0 & 1 & 0 & 0 \\
2 & 1 & 1 & 1 & 0 & 0 & 0 \\
2 & 2 & 1 & 0 & 0 & 0 & 1
\end{array}
$$
Individual 1 remains in urban in both periods, whether individual 2 switches from urban to rural.
I am estimating a model like this using fixed-effects. The issue is the following:


*

*If the dataset has switchers, the software returns an estimation for four out of five of the model parameters ($\alpha, \beta, \gamma, \phi, \theta$) - four only because of the constant.

*If the dataset has no switchers, the software returns an estimation for three out of five of the model parameters. Of these, at least one is of urban and of rural type. 


I am trying to understand this parameter estimation difference. I have been through formulas and matrix algebra, textbooks and google, and so far I cannot resolve this. Now I want your help!
Further information:


*

*This estimation pattern does not follow through in random-effects. Regardless of whether switching exists or not, RE identifies the same number of coefficients. Thus, the result is necessarily due to a combination of switching and the intrinsic demeaning nature of FE.

*I've tried in different software and commands, and the result holds.

*Identification of all coefficients (but one) requires full rank of matrix $\sum_{i=1}^{N}(\ddot{X_{i}}'\ddot{X_{i}})$, where $\ddot{X_{i}}$ is the demeaned data matrix for individual $i$ (Wooldridge (2010), p.304). According to my calculations, if there are no switchers, that matrix is a diagonal, with element $(1,1)=NT$, and all rest diagonal elements equal to $N_{u/r}\frac{T-1}{T}$, where $N_{u/r}$ is the number of individuals on each region. I cannot see how that matrix has no full rank, and so cannot see why all coefficients are not calculated. For example, in the case of individual 1 above, $\ddot{X_{i}}$ is:


$$
\begin{array}{ccccc}
 1 & 0.5 & -0.5 & 0 & 0 \\
 1 & -0.5 & 0.5 & 0 & 0 
\end{array}
$$
and $\ddot{X_{i}}'\ddot{X_{i}}$ is:
$$
\begin{array}{ccccc}
2 &   0 & 0   & 0 & 0 \\
0 & 0.5 & 0   & 0 & 0 \\
0 & 0   & 0.5 & 0 & 0 \\
0 & 0   & 0   & 0 & 0 \\
0 & 0   & 0   & 0 & 0  
\end{array}
$$
Combined with another non-switcher who lives in a rural area, the sum is:
$$
\begin{array}{ccccc}
4 &   0 & 0   & 0 & 0 \\
0 & 0.5 & 0   & 0 & 0 \\
0 & 0   & 0.5 & 0 & 0 \\
0 & 0   & 0   & 0.5 & 0 \\
0 & 0   & 0   & 0 & 0.5  
\end{array}
$$
Which clearly has full rank. And so on. So why are not all coefficients estimated?
 A: I do not fully understand your question, and this does not seem like a complete answer. However it is too long for another comment, so I will write out my issue here.
Your model is
$$w_{it} = \alpha + \beta_{u,1} D_{i,u,1} + \beta_{u,2} D_{i,u,2} + \beta_{r,1} D_{i,r,1} + \beta_{r,2} D_{i,r,2} + \epsilon_{it}$$
If I understand correctly, during period $t$ individual $i$ is either urban or rural, but not both, i.e. 
$$D_{i,u,t} + D_{i,r,t} = 1$$
for $t\in\{1,2\}$.

( UPDATE: Apparently this is known as the "dummy variable trap". See case 4 here. )

So if we define a new dummy for "individual $i$ is urban in period $t$", we have
\begin{align}
U_{i,t} \equiv D_{i,u,t} \implies
\beta_{u,t} D_{i,u,t} + \beta_{r,t} D_{i,r,t} &= \beta_{u,t} U_{i,t} + \beta_{r,t} (1-U_{i,t}) \\
&= \beta_{r,t} + ( \beta_{u,t} - \beta_{r,t} ) U_{i,t}\\
&\equiv \Delta{\alpha}_t + \Delta{\beta}_t U_{i,t}
\end{align}
So your model becomes
$$ w_{it} = A + \Delta{\beta}_1 U_{i,1} + \Delta{\beta}_2 U_{i,2} $$
where $A\equiv\alpha+\Delta{\alpha}_1+\Delta{\alpha}_2$.
So, because you only have two $independent$ dummy variables, it seems like you can only estimate two coefficients, plus an intercept. That is, your original four coefficients are not identifiable: You can only estimate the urban-rural differences $\Delta\beta_t$.
