两个样本t检验(等方差合并标准开发人员)的命令为
power.t.test(n=, delta=, sd=, type="two.sample")
在给出两个不等方差和样本数量的样本时,如何计算统计功效?
答案 0 :(得分:0)
您可以使用power_t_test()
软件包中的MESS
函数。
例如,要计算个人的比例为1:2(标准差为1和3)且效果大小为1.2(对于功效为80%)时,要计算所需的样本量
> MESS::power_t_test(n=NULL, sd=1, power=.8, ratio=2, sd.ratio=3, delta=1.2)
Two-sample t test power calculation with unequal sizes
n = 14.35824, 28.71648
delta = 1.2
sd = 3
sig.level = 0.05
power = 0.8
alternative = two.sided
NOTE: n is vector of number in each group
要计算功效,您需要设置power=NULL
并指定n
来代替常规的power.t.test()
函数。
> MESS::power_t_test(n=20, sd=1, power=NULL, ratio=2, sd.ratio=3, delta=1.2)
Two-sample t test power calculation with unequal sizes
n = 20, 40
delta = 1.2
sd = 3
sig.level = 0.05
power = 0.9149541
alternative = two.sided
NOTE: n is vector of number in each group