随机化检查
Randomization check
我觉得问这个问题有点傻,但我怎么也想不通!
我想看看参与者是否被平等地随机分配到两组,所以偶然事件 table 看起来像下面的
Condition A Condition B
30 40
主要数据如下图
Variable 1
P1 Condition A
P2 Condition B
P3 Condition A
P4 Condition A
P5 Condition B
P6 Condition A
. .
. .
. .
什么是最好的 way/function 检查(使用 R)它们是否平均分配给任一条件?
非常感谢!
你想要一个 chisq.test()
,它在偶然事件 table 上运行,而不是组的原始向量。用法很简单:
> x = factor(sample(c('A', 'B'), 1000, replace = TRUE, prob = c(0.6, 0.4)))
> table(x)
x
A B
605 395
> chisq.test(table(x))
Chi-squared test for given probabilities
data: table(x)
X-squared = 44.1, df = 1, p-value = 3.12e-11
我觉得问这个问题有点傻,但我怎么也想不通!
我想看看参与者是否被平等地随机分配到两组,所以偶然事件 table 看起来像下面的
Condition A Condition B
30 40
主要数据如下图
Variable 1
P1 Condition A
P2 Condition B
P3 Condition A
P4 Condition A
P5 Condition B
P6 Condition A
. .
. .
. .
什么是最好的 way/function 检查(使用 R)它们是否平均分配给任一条件?
非常感谢!
你想要一个 chisq.test()
,它在偶然事件 table 上运行,而不是组的原始向量。用法很简单:
> x = factor(sample(c('A', 'B'), 1000, replace = TRUE, prob = c(0.6, 0.4)))
> table(x)
x
A B
605 395
> chisq.test(table(x))
Chi-squared test for given probabilities
data: table(x)
X-squared = 44.1, df = 1, p-value = 3.12e-11