k*******a 发帖数: 772 | 1 5个positive的人测出positive的分布式x~binomial(5,0.9)
5个negative的人测出positive的分布式y~binomial(5,0.2)
所有 x+y=3的概率为
dbinom(3,5,.9)*dbinom(0,5,.2)+
dbinom(2,5,.9)*dbinom(1,5,.2)+
dbinom(1,5,.9)*dbinom(2,5,.2)+
dbinom(0,5,.9)*dbinom(3,5,.2)
=0.0273 |
|
s*******s 发帖数: 1568 | 2 写了个R程序,
n = 100
m = 5
p = 0.5
v1= 0:n
s0=dbinom(v1,n,p)
Pmatrix = matrix(0, nrow = n+1, ncol = n+1)
for (i in 0:n) {
v1 = 0:i
Pmatrix[i+1,1:(i+1)] = dbinom(v1,i,p)
}
for (i in 1:m) {
s0=s0%*%Pmatrix
}
E = 0;
for (i in 0:n) {
E = E + s0[i+1]*i
}
print(E) |
|
d*******r 发帖数: 7 | 3 You need at least 84 tails in 100 trials (-x+2(100-x)=-50).
It's binomial so the prob is sum(100,x).5^x.5^(100-x), x from 84 to 100.
> x=84:100
> y=dbinom(x,100,.5)
> sum(y) |
|
k*******a 发帖数: 772 | 4 第一个就是Binomial(6, 0.3) distribution
所以 more than half type I error = sum(dbinom(4:6, 6, .3)) =0.07
第二个,既然null is true, 怎么会有type II error 呢? |
|