我们使用以下语法运行了混合效果逻辑回归:
# fit model
fm0 <- glmer(GoalEncoding ~ 1 + Group + (1|Subject) + (1|Item), exp0,
             family = binomial(link="logit"))
# model output
summary(fm0)主题和项目是随机效果。我们得到一个奇怪的结果,即该主题词的系数和标准偏差均为零;
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
Family: binomial  ( logit )
Formula: GoalEncoding ~ 1 + Group + (1 | Subject) + (1 | Item)
Data: exp0
AIC      BIC      logLik deviance df.resid 
449.8    465.3   -220.9    441.8      356 
Scaled residuals: 
Min     1Q Median     3Q    Max 
-2.115 -0.785 -0.376  0.805  2.663 
Random effects:
Groups  Name        Variance Std.Dev.
Subject (Intercept) 0.000    0.000   
Item    (Intercept) 0.801    0.895   
Number of obs: 360, groups:  Subject, 30; Item, 12
Fixed effects:
                Estimate Std. Error z value Pr(>|z|)    
 (Intercept)     -0.0275     0.2843    -0.1     0.92    
 GroupGeMo.EnMo   1.2060     0.2411     5.0  5.7e-07 ***
 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 Correlation of Fixed Effects:
             (Intr)
 GroupGM.EnM -0.002这不应该发生,因为显然各个主题之间存在差异。当我们在Stata中运行相同的分析时
xtmelogit goal group_num || _all:R.subject || _all:R.item
Note: factor variables specified; option laplace assumed
Refining starting values: 
Iteration 0:   log likelihood = -260.60631  
Iteration 1:   log likelihood = -252.13724  
Iteration 2:   log likelihood = -249.87663  
Performing gradient-based optimization: 
Iteration 0:   log likelihood = -249.87663  
Iteration 1:   log likelihood = -246.38421  
Iteration 2:   log likelihood =  -245.2231  
Iteration 3:   log likelihood = -240.28537  
Iteration 4:   log likelihood = -238.67047  
Iteration 5:   log likelihood = -238.65943  
Iteration 6:   log likelihood = -238.65942  
Mixed-effects logistic regression               Number of obs      =       450
Group variable: _all                            Number of groups   =         1
                                                Obs per group: min =       450
                                                               avg =     450.0
                                                               max =       450
Integration points =   1                        Wald chi2(1)       =     22.62
Log likelihood = -238.65942                     Prob > chi2        =    0.0000
------------------------------------------------------------------------------
        goal |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   group_num |   1.186594    .249484     4.76   0.000     .6976147    1.675574
       _cons |  -3.419815   .8008212    -4.27   0.000    -4.989396   -1.850234
------------------------------------------------------------------------------
------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
               sd(R.subject) |   7.18e-07   .3783434             0           .
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.trial) |   2.462568   .6226966      1.500201    4.042286
------------------------------------------------------------------------------
LR test vs. logistic regression:     chi2(2) =   126.75   Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference.
Note: log-likelihood calculations are based on the Laplacian approximation.结果是预期的,主题词的系数为非零/ se。
最初,我们认为这可能与Subject术语的编码有关,但是将其从字符串更改为整数并没有任何区别。
显然,分析无法正常进行,但是我们无法确定困难的根源。(请注意,此论坛上的其他人也遇到过类似的问题,但是该主题仍未得到解答的链接)

subject这些变量是什么或其他任何东西,因此对我们来说并不是那么“明显””!还有“非零系数”从您的Stata分析中得出的主题词是7.18e-07!从技术上讲,我猜它是“非零”,但也离0也不太远...!