Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R中的多级Logit模型-不包括随机截距的所有值_R_Mlogit - Fatal编程技术网

R中的多级Logit模型-不包括随机截距的所有值

R中的多级Logit模型-不包括随机截距的所有值,r,mlogit,R,Mlogit,我正在使用glmer函数在R中建立一个随机截距模型,第二级变量为国家。然而,当我运行我的模型时,它只包括24个国家和27005个观测值,而有60个国家和75047个观测值。 我可以提供其他信息,如果必要的话,但只是想知道是否有人有任何初步的想法,为什么这可能是。我在网上找不到任何东西 Generalized linear mixed model fit by maximum likelihood (Adaptive Gauss-Hermite Quadrature, nAGQ = 0) ['gl

我正在使用
glmer
函数在R中建立一个随机截距模型,第二级变量为国家。然而,当我运行我的模型时,它只包括24个国家和27005个观测值,而有60个国家和75047个观测值。 我可以提供其他信息,如果必要的话,但只是想知道是否有人有任何初步的想法,为什么这可能是。我在网上找不到任何东西

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

数据集中可能缺少一些值。从大量国家完全退出来看,你可能没有衡量一些国家的一些变量。因此,这些案例被排除在外。也可能是因变量的值不是1和0。这些也将被排除在外。检查观察结果的完整性。这很有意义,谢谢。我会检查一切的。
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