R

时间:2018-03-09 19:39:43

标签: r statistics

我有两个正态分布的样本。我有零假设E = a1和替代E = a2

s1 <- rnorm(1000, mean = a1, sd = std)
s2 <- rnorm(1000, mean = a2, sd = std)

我可以通过这样做来计算我输入错误:

p_value = t.test(s1,alternative=c("t"),mu=a1)$p.value
if(p_value <= alpha) 
#then it's first type error

如何计算II类型错误?

1 个答案:

答案 0 :(得分:0)

II型错误的概率= 1次幂

测试的力量: R extract only power from power.t.test

sig.level是I类错误概率

如果你想了解逻辑以及为什么p值本身不会给你Type II错误: https://www.quora.com/What-is-the-relationship-between-statistical-power-and-the-p-value