如何解释逻辑回归中的交互连续变量?

机器算法验证 回归 物流 相互作用 解释 连续数据
2022-04-04 07:39:45

我正在努力理解和解释逻辑回归中的交互项。解释变量是temperature(分类的)、gonad weight(连续的)和nnd(连续的)。在简化模型下:

model2012nnd = glm(fullyspawned ~ temperature + gonad + nnd+gonad:nnd, 
                   family=quasibinomial(link = logit), data=spaw)
summary(model2012nnd)
# 
# Call:
# glm(formula = fullyspawned ~ temperature + gonad + nnd + gonad:nnd, 
#     family = quasibinomial(link = logit), data = spaw)
# 
# Deviance Residuals: 
#     Min       1Q   Median       3Q      Max  
# -1.6793  -0.3594  -0.2457  -0.0651   2.5984  
# 
# Coefficients:
#                        Estimate Std. Error t value Pr(>|t|)    
# (Intercept)              2.6262     2.1212   1.238 0.217638    
# temperature15.58928019   2.4317     0.6453   3.768 0.000237 ***
# gonad                   -1.5718     0.6597  -2.382 0.018466 *  
# nnd                     -2.4845     1.0782  -2.304 0.022593 *  
# gonad:nnd                0.6407     0.3124   2.051 0.042058 *  
# ---
# Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
# 
# (Dispersion parameter for quasibinomial family taken to be 0.7864476)
# 
#     Null deviance: 118.652  on 152  degrees of freedom
# Residual deviance:  79.596  on 148  degrees of freedom
# AIC: NA

我如何解释这种互动?我将变量设置gonad为三个类别(低、中和高),并绘制了每个级别在温度 1 和 2 下完全产卵的概率,以尝试了解输出。这个对吗?

1个回答

nnd为 0 时,单位变化gonad的几率降低相关联(exp(1.5718)1)100%79%fullyspawned

每增加一个单位,nnd这种效果gonad就会增加(exp(0.6407)1)100%90%

因此,当nnd1 为 1 时,优势比为gonad1.9,也就是说,单位变化现在仅与的优势降低相关。为 2 时,优势比为1.9,也就是说,单位变化现在仅与的优势降低相关。1.91×.21.4gonad60%fullyspawnednndgonad1.92×.21.76gonad24%fullyspawned

这里有各种关于如何解释这种模型中的交互项的示例