问题描述
似乎在confint()
上调用emmeans对象上的type="response"
会产生虚假结果。
示例:
- 无 type =“ response”:
Condition = A:
contrast estimate SE df z.ratio p.value
Y - X 0.496 0.296 Inf 1.676 0.0937
由confint()
提供的置信区间是一致的,因为它们为零:
Condition = A:
contrast estimate SE df asymp.LCL asymp.UCL
Y - X 0.496 0.296 Inf -0.084 1.076
但是现在看看当要求以emmeans支付type="response"
时会发生什么。
我应该注意,这是来自带有family =“ binomial”的glmer模型,因此估算值是比值比,或者在这种情况下是从logit逆变换:
- with type =“ response”:
Condition = A:
contrast odds.ratio SE df z.ratio p.value
Y / X 1.64 0.486 Inf 1.676 0.0937
因此,您会在这里看到z值和p值相同,情况应该如此。但是看看当您致电confint()
时会发生什么:
Condition = A:
contrast odds.ratio SE df. asymp.LCL asymp.UCL
Y / X 1.64 0.486 Inf 0.919 2.93
即使先前的p值= 0.0937且未进行逆向转换的CI 跨零,突然置信区间也不会跨过零。
>这是怎么回事,这是一个错误吗?
解决方法
优势比始终为正数。此外,这是比率,而不是差异。当两个量的比率为1时,它们是相同的。请注意,间隔的下限小于1,上限大于1;与您的测试结果一致。
最后,请注意,您可以直接从logit差的间隔中获取此间隔:exp {-0.084} = 0.919和exp {1.076} = 2.93。