Skip to main content

Timeline for Order of variables in R's lm

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Dec 18, 2020 at 23:38 comment added Thomas Bilach The only reason for the coefficients changing in the referenced question is due to the removal of the intercept, and even then it should only impact the coefficients on the firm and/or year fixed effects (depending upon which "effect" is absorbed into the intercept).
Dec 18, 2020 at 8:22 comment added Sextus Empiricus "For some reason, the two models below result in different coefficients" The question is why does the order matter. Sure you can say that it doesn't matter because the models with different coefficients are effectively the same, but that is a bit of a red herring because it does not explain why the coefficients are different. (In addition, those different coefficients may result in different hypothesis testing when a hypothesis $H_0:\beta_i = 0$ is used)
Dec 18, 2020 at 7:27 comment added smci @SextusEmpiricus: no the order doesn't matter in that referenced question either. It gives different coefficients, same model, due to the choice of either factor A or year 1985 as base. It's the same model in the sense the output predictions will be identical for identical inputs. (If there are more coefficients than inputs, then the coefficients will be linearly dependent).
Dec 17, 2020 at 13:59 comment added Sextus Empiricus Your answer relates to the particular example from the OP. However, in the referenced question the order does matter.
Dec 17, 2020 at 10:13 vote accept biofan
Dec 18, 2020 at 11:07
Dec 17, 2020 at 9:43 history answered jcken CC BY-SA 4.0