Random and fixed effects models in R for glm i am quite confused about creating a fixed effects model.
How exactly does the Fixed effects model differ from the basic model with fixed countrys, because up until now i thought that this model would be my Fixed effects model.
So my plan is to run three models:


*

*Basic model with fixed countrys 

*Random effects with country
intercept  

*Fixed effects model without countrys (here i have no
idea, on how to create this model anymore)


This is my code:
##country-level fixed effects
model_fes <- as.formula("comp ~  factor(country) + h + c + wd + ra + ac + ov")
clog_fes = glm(model_fes,data=df,family = binomial(link = cloglog))
summary(clog_fes)
summ(clog_fes)

random intercept with country-level effects
library(lme4)
model_res<- as.formula("comp ~  (1|country) + h + c + wd + ra + ac + ov")
clog_res = glmer(model_re1,data=df,family = binomial(link = cloglog))
summary(clog_res)
summ(clog_res)

fixed effects model

??

 A: I think their is a problem with the terms. A (classical) model, whithout introducing a random effect, is what you seem to call a fixed effect model. All the effects are fixed, their are not a random sample of a larger population. 
For your models, before trying to fit everything, you should determine what you want.


*

*Do you have a fixed (small) number of different countries? It means, if new samples are to be gathered, they would come from the same countries? And are you really interrested by the specific impact of, say, UK, on your comp variable? In this case, you put country as a fixed effect and go for your first model. 

*Or do you have a high number of different countries, and want to draw conclusions for data coming from maybe new countries? In this case, you need to take into account for the country effect, because it creates correlations between residuals, and thus you go for the mixed models, your second model.
But to my knowledge, their is no differences between your first model and what could be a fixed effects model ! 
Hope it helps... 
A: 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.
