0

我在 R 中有以下混合效应回归模型:

linearModSubset <- lmer(od.deaths.pc ~   (year.x|County.x) +
                              pov_perc + 
                              unemply_perc +
                              hispanic_perc +
                              sing_parent_hh_perc +
                              Fentanyl.Crime.Lab.Cases.pc +
                              Meth.Crime.Lab.Cases.pc +
                              Benzo.Crime.Lab.Cases.pc +
                              COC.Crime.Lab.Cases.pc +
                              opioidHospitalizations.pc +
                              popDens,
                data=drug.data.county.year.filt)

summary(linearModSubset)
r.squaredGLMM(linearModSubset)
tab_model(linearModSubset)

使用summary(linearModSubset)and r.squaredGLMM(linearModSubset),我得到:

Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: od.deaths.pc ~ (year.x | County.x) + pov_perc + unemply_perc +  
    hispanic_perc + sing_parent_hh_perc + Fentanyl.Crime.Lab.Cases.pc +  
    Meth.Crime.Lab.Cases.pc + Benzo.Crime.Lab.Cases.pc + COC.Crime.Lab.Cases.pc +      opioidHospitalizations.pc + popDens
   Data: drug.data.county.year.filt

REML criterion at convergence: 2142.3

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.6337 -0.5535 -0.0570  0.3850  6.0012 

Random effects:
 Groups   Name        Variance  Std.Dev.  Corr 
 County.x (Intercept) 1.068e+02 10.334251      
          year.x      1.922e-05  0.004384 -1.00
 Residual             1.066e+02 10.323681      
Number of obs: 284, groups:  County.x, 72

Fixed effects:
                              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                  -2.708189   2.441282  50.613193  -1.109 0.272531    
pov_perc                     57.142106  22.800314  50.891021   2.506 0.015442 *  
unemply_perc                222.294220  66.788253  55.417666   3.328 0.001557 ** 
hispanic_perc                 0.452461   0.307941  41.392374   1.469 0.149309    
sing_parent_hh_perc         -45.872855  12.961035 221.598936  -3.539 0.000489 ***
Fentanyl.Crime.Lab.Cases.pc   0.345118   0.056659 248.968846   6.091 4.23e-09 ***
Meth.Crime.Lab.Cases.pc      -0.016265   0.007532  67.392572  -2.159 0.034379 *  
Benzo.Crime.Lab.Cases.pc     -0.246739   0.099567 272.662523  -2.478 0.013814 *  
COC.Crime.Lab.Cases.pc        0.090246   0.035264 148.696936   2.559 0.011491 *  
opioidHospitalizations.pc     0.022111   0.003516  63.809163   6.289 3.26e-08 ***
popDens                       0.005422   0.002347  35.207351   2.310 0.026864 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) pv_prc unmpl_ hspnc_ sng___ F.C.L. M.C.L. B.C.L. COC.C. opdHs.
pov_perc    -0.379                                                               
unemply_prc -0.185 -0.217                                                        
hispanc_prc -0.286  0.089 -0.087                                                 
sng_prnt_h_ -0.309 -0.253 -0.376 -0.140                                          
Fntn.C.L.C. -0.193  0.049 -0.169  0.019  0.210                                   
Mth.Cr.L.C. -0.080  0.013 -0.034  0.303 -0.192 -0.077                            
Bnz.Cr.L.C.  0.035 -0.098  0.003  0.005  0.071 -0.119 -0.039                     
COC.Cr.L.C.  0.099  0.104 -0.024 -0.082 -0.209 -0.271  0.099 -0.296              
opdHsptlzt.  0.343 -0.310 -0.145  0.001 -0.317 -0.178  0.012 -0.148 -0.016       
popDens      0.217 -0.030  0.111 -0.553 -0.087 -0.042 -0.010  0.075 -0.013 -0.066
fit warnings:
Some predictor variables are on very different scales: consider rescaling
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see ?isSingular

> r.squaredGLMM(linearModSubset)
           R2m       R2c
[1,] 0.5414291 0.5507347

但是使用tab_model(linearModSubset)我得到:

在此处输入图像描述

当我使用相同的模型时,我对为什么这两个输出的值略有不同感到困惑。我也想知道为什么r.squaredGLMM(linearModSubset)报告条件 R 平方,但tab_model(linearModSubset)条件 R 平方是 NA。

提前致谢!

4

0 回答 0