这两个检验(逻辑回归和卡方)是等价的,功效分析应该给出相同的答案。
您假设 f2 和 w 的值 0.15 是相同的效果大小,但事实并非如此。w 的小值是 0.1,f2 的小值是 0.02。
cohen.ES(test=c("chisq"), size=c("small"))
cohen.ES(test=c("f2"), size=c("small"))
编辑:详细说明了两种方法的相似性。
如果您将相同的数据提供给逻辑回归和卡方检验(严格地说:没有耶茨校正),您会得到相同的结果。这是一个例子
> set.seed(1234)
> x <- rbinom(100, 1, 0.2)
> y <- rbinom(100, 1, 0.2)
> chisq.test(table(x, y), correct=FALSE)
Pearson's Chi-squared test #'
data: table(x, y)
X-squared = 0.155, df = 1, p-value = **0.694**
Warning message:
In chisq.test(table(x, y), correct = FALSE) :
Chi-squared approximation may be incorrect
> summary(glm(y ~ x, family="binomial"))
Call:
glm(formula = y ~ x, family = "binomial")
Deviance Residuals:
Min 1Q Median 3Q Max
-0.753 -0.753 -0.753 -0.668 1.794
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.114 0.251 -4.43 9.4e-06 ***
x -0.272 0.693 -0.39 **0.69**
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 110.22 on 99 degrees of freedom
Residual deviance: 110.06 on 98 degrees of freedom
AIC: 114.1
Number of Fisher Scoring iterations: 4
p 值相同,因此功效应该相同。我不记得两种不同版本的效果大小的公式。效果大小测量有点奇怪,因为在过去,您希望尽量减少放入书籍的表格数量(例如,我们有,f2代替R2,当它们之间存在直接关系时,以及R2是每个人都明白的)。