【问题标题】:Ordinal regression - proportional odds assumption not met for variable in interaction序数回归 - 交互中的变量不满足比例优势假设
【发布时间】:2018-03-01 16:49:59
【问题描述】:

我尝试分析具有序数响应 (0-4) 和三个分类因素的数据集。我对所有三个因素的相互作用以及主要影响感兴趣。我使用包“ordinal”的 clm 函数并使用“nominal_test”函数检查假设。它揭示了其中一个预测变量的显着差异。现在我不知道如何继续......我试图将有问题的因素及其所有相互作用放在“名义”参数中(参见代码)并且 R 给了我警告。尽管如此,我还是做了几个可能性比测试,总是比较一个模型,包括一个缺少它的交互(ANOVA(没有,有,test =“Chisq”))并得到一些很好的显着结果。不过,我觉得我不知道我在这里做什么,我不相信结果。所以我的问题是:我所做的可以吗?我还可以做些什么?还是数据只是“无法分析”?

下面是测试代码:

# this is the model
res=clm(cue~     intention:outcome:age+
                 intention:outcome+
                 intention:age+
                 outcome:age+
                 intention+outcome+age+
                 Gender,
                 data=xdata)

#proportional odds assumption
nominal_test(res)
#                      Df  logLik    AIC    LRT  Pr(>Chi)    
#<none>                   -221.50 467.00                     
#intention              3 -215.05 460.11 12.891  0.004879 ** 
#outcome                3 -219.44 468.87  4.124  0.248384    
#age                                                         
#Gender                 3 -219.50 469.00  3.994  0.262156    
#intention:outcome                                           
#intention:age                                               
#outcome:age            6 -217.14 470.28  8.716  0.190199    
#intention:outcome:age 12 -188.09 424.19 66.808 1.261e-09 ***

这是我尝试解决它的一个示例 -> 并检查所有三个预测变量的三向交互。我也为 2-way-interactions 做了同样的事情......

res=clm(cue~         outcome:age+
                     outcome+age+
                     Gender, 
                     nominal= ~ intention:age:outcome+
                                intention:age+        
                                intention:outcome+
                                intention,
                     data=xdata)
res.red=clm(cue~     outcome:age+
                     outcome+age+
                     Gender, 
                     nominal= ~ 
                                intention:age+        
                                intention:outcome+
                                intention,
                     data=xdata)
anova(res,res.red, test="Chisq")
#        no.par    AIC  logLik LR.stat df Pr(>Chisq)
#res.red     26 412.50 -180.25                      
#res         33 424.11 -179.05  2.3945  7     0.9348

当我尝试集中模型时,这是 R 给我的警告:

Warning message:
(-3) not all thresholds are increasing: fit is invalid 
In addition: Absolute convergence criterion was met, but relativecriterion was not met

我特别担心“Fit is not valid”这句话......我不知道该怎么办,如果有任何想法或提示,我都会很高兴!

谢谢!

【问题讨论】:

    标签: r


    【解决方案1】:

    您是否尝试过使用更通用的模型,例如部分比例赔率模型?您的数据只需是名义上的,而不是有序的才能使用此模型。如果您发现对数似然之间存在巨大差异,则不满足您对序数的假设。

    您可以使用 VGAM 包中的 vlgm()。 Here 是几个例子。

    由于我不知道你的数据是什么样子,我不能说它是否不可分析,但代码应该是这样的:

    library(VGAM)
    res <- vglm(cue ~ intention:outcome:age+
                 intention:outcome+
                 intention:age+
                 outcome:age+
                 intention+outcome+age+
                 Gender, 
                 family = cumulative(parallel = FALSE ~ intention),
                 data = xdata)
    summary(res)
    

    我认为您可以使用我在上面发布的示例中提出的 pchiq() 来比较两个模型,就像您之前使用 anova() 所做的那样:

    pchisq(deviance(res) - deviance(res.red),
         df = df.residual(res) - df.residual(res.red), lower.tail = FALSE)
    

    【讨论】:

    • 哇,真快!谢谢!您建议的代码不起作用,但我在家庭论点中添加了一些东西,我认为它定义了不满足假设(意图)的预测变量,然后它就起作用了! res &lt;- vglm(cue ~ intention:outcome:age+ intention:outcome+ intention:age+ outcome:age+ intention+outcome+age+ Gender, family =cumulative(parallel=FALSE~intention), data = xdata)
    • 哦,它不允许 ANOVA 进行似然比测试...那么我如何获得交互作用和完整/空模型比较的效果?
    • @PatriciaG。如果你使用 summary() 你应该得到每个场景的 p 值。你还需要什么?
    • 是的,摘要中是我的因素(相互作用)的特定组合的 p 值。但我需要 p 值来衡量交互的“整体”效果。通常我通过将原始模型与第二个(简化的)模型进行比较来获得它们,而无需使用函数anova(original model, reduced model, test="Chisq") 进行交互对于 vglm s,anova 函数(尚)不可用...
    • @PatriciaG。您是否按照我的建议尝试了 pchisq() ?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-12
    • 1970-01-01
    • 2016-10-05
    • 1970-01-01
    • 2018-05-02
    • 2022-07-06
    • 1970-01-01
    相关资源
    最近更新 更多