0

Hi I have an issue when i run a multi-level regression model, i have country level and individual level variables.

In total i have 34 countries but in all my models when i run them R only passes through 27 countries. I am not sure which countries are not included, and is there a way to include all countries or at least know which ones are being dropped.

Here is my first model

model1 = lmer(corruption ~ Gini.Index + GDP + Democracy.Index + Political.Terror.Index + Economic.Freedom  + Regime + respondentage + 
            respondentgender + Education_Completed + Employment + European.Integration  + (1 | country), NewD, REML = FALSE )

The word country in the model is the variable that i merged my two datasets with. It is not the name of each country but their code. When i run this i get number of countries 27 rather than 34??

Anyone know what to do

Just to do, i do have missing data but i have coded all of those to NA. Some country variables are quite similar with each other but not fully the same!

neilfws
  • 32,751
  • 5
  • 50
  • 63
  • 1
    Welcome to Stack Overflow. Please [make this question reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) by including a small representative dataset in a plain text format - for example the output from `dput(NewD)`, if that is not too large - or a link to your data file. It's impossible to troubleshoot without data to test. – neilfws May 01 '22 at 23:47
  • 2
    Are there any missing values in your data? R will drop observations containing missing values from the analysis. – dcarlson May 01 '22 at 23:54
  • 2
    `rownames(ranef(model1)$country)` should tell you which countries are included ... – Ben Bolker May 01 '22 at 23:54

0 Answers0