【发布时间】: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