18/10/14 07:14:30.48 +n7lCedi.net
pass=100
wm=0.2
curve( (x/(1-wm))/((pass-x)/wm),0,pass)
uniroot(function(x,u0=1.2) x*wm/(1-wm)/(pass-x)-u0, c(0,pass))
(83/800)/(17/200)
prop.test(c(83,17),c(800,200))
m_suc = function(rate) (pass* rate * (wm - 1))/(rate* (wm - 1) - wm)
m_suc(1.2)
curve(m_suc(x),1,5)
total=1000
wm=0.5
h <- function(mf){
M=ceiling(m_suc(mf))
F=pass-M
prop.test(c(M,F),c(total*(1-wm),total*wm))$p.value
}
r=seq(1,3,length=1000)
plot(r,sapply(r,h),type='l')
abline(h=0.05,lty=3)
uniroot(function(x)h(x)-0.05,c(1,2))$root
m_suc(1.43)
59/41
prop.test(c(59,41),c(500,500),correct=F)
prop.test(c(60,40),c(500,500),correct=F)