It seems to me that the three models are actually three different things. It is normal that there is some confusion about the terms "fixed" and "random" effects, because different applied fields use them differently, see for example here: https://statmodeling.stat.columbia.edu/2005/01/25/why_i_dont_use/
Within a more econometric reading of your question, model 3 would refer to a model where values all variables are de-meaned for country (i.e., you subtract the country-level mean from each observation, across all variables). In this case you will not need to include country explicitly as a predictor variable, so the model would indeed be "without countries", as in your description. This is typically called the fixed effects estimator in econometrics, or the within estimator (because you reduce your data to variation within countries only). You can do this in R for example by using plm::plm()
with model = "within"
. The plm package, which can do all three model types you mentioned, is described in detail here: https://cran.r-project.org/web/packages/plm/vignettes/plmPackage.html
Note that the estimates and standard errors should be exactly identical to the case where you simply add dummies for country to your model matrix via factor(country)
(model 1).
Model 1 is actually known as the LSDV (Least Square Dummy Variable) approach in econometrics. Equivalence between fixed effects and LSDV estimator is further shown and discussed in chapter 10.2 of
- Verbeek, M. (2008). A guide to modern econometrics. John Wiley & Sons.
A note of cuation: De-meaning by hand and then running a simple lm()
on the de-meaned data will lead to a fixed effects model with biased standard errors, because lm()
will calculate with too many degrees of freedom, as if there were no country variables used at all. So better simply use plm()
, which corrects for this.