0

I am building a random intercept model in R using the glmer function, with the 2nd level variable being country. When I run my model however, it is only including 24 countries and 27005 observations when there are 60 countries and 75047 observations. I can provide other info if necessary but just wondering if anyone has any initial idea why this might be. I cannot find anything online.

Generalized linear mixed model fit by maximum likelihood (Adaptive Gauss-Hermite Quadrature, nAGQ = 0) ['glmerMod']
 Family: binomial  ( logit )
Formula: serve ~ age + sex + income + religion + proud + trusting + outgoing +      (1 | country)
   Data: WVS
Control: glmerControl(optimizer = "bobyqa")

     AIC      BIC   logLik deviance df.resid 
 30102.4  30250.1 -15033.2  30066.4    26987 

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.2087 -0.8943  0.4331  0.6737  3.8525 

Random effects:
 Groups  Name        Variance Std.Dev.
 country (Intercept) 0.6272   0.7919  
Number of obs: 27005, groups:  country, 24

Fixed effects:
                          Estimate Std. Error z value Pr(>|z|)    
(Intercept)               0.188730   0.181939   1.037 0.299584    
age                      -0.004503   0.001229  -3.666 0.000247 ***
sexmale                   0.672997   0.028757  23.403  < 2e-16 ***
income                   -0.005812   0.007070  -0.822 0.411024    
religionRather important  0.117421   0.049464   2.374 0.017604 *  
religionVery important    0.269977   0.048460   5.571 2.53e-08 ***
proud2                   -0.210176   0.033430  -6.287 3.23e-10 ***
proud3                   -0.306502   0.054530  -5.621 1.90e-08 ***
proud4                   -0.601837   0.099568  -6.044 1.50e-09 ***
trusting2                 0.134689   0.055366   2.433 0.014987 *  
trusting3                 0.195169   0.056104   3.479 0.000504 ***
trusting4                 0.309589   0.054498   5.681 1.34e-08 ***
trusting5                 0.294739   0.059784   4.930 8.22e-07 ***
outgoing2                -0.160543   0.062618  -2.564 0.010352 *  
outgoing3                -0.119559   0.062781  -1.904 0.056861 .  
outgoing4                 0.120816   0.060180   2.008 0.044689 *  
outgoing5                 0.238158   0.063453   3.753 0.000175 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Here is a sample of the data:

conscription serve country    sex education income         religion immigrant proud trusting outgoing         age
1             1   Yes     ALG   male         3      5   Very important         0     1        2        2 -15.7403361
2             1   Yes     ALG female         3      6 Rather important         0     2        4        2 -12.7403361
3             1   Yes     ALG female         3      6   Very important         0     1        3        3 -10.7403361
4             1   Yes     ALG female         3      5   Very important         0     1        3        4  -8.7403361
5             1   Yes     ALG female         2      7   Very important         0     1        4        4  -1.7403361
6             1   Yes     ALG   male         4      5   Very important         0     1        3        4  -0.7403361
7             1   Yes     ALG   male         3      7   Very important         0     1        2        2   4.2596639
8             1   Yes     ALG female         2      2 Rather important         0     1        3        4   7.2596639
9             1   Yes     ALG   male         1      5 Rather important         0     1        3        2  22.2596639
11            1   Yes     ALG female         4      5   Very important         0     1        3        1 -13.7403361
Rachel9866
  • 121
  • 1
  • 11
  • 2
    You might have some missing values in your dataset. Judging from the large number of countries dropping out completely, it's possible that you did not measure some of the variables in some of the countries. So, these cases are excluded. Or it may be that your dependent variable has other values than 1 and 0. These would also get excluded. Check for the completeness of observations. – Martin Wettstein May 22 '21 at 14:42
  • That makes sense, thank you. I'll go through and check everything. – Rachel9866 May 22 '21 at 14:49

0 Answers0