2ちゃんねる スマホ用 ■掲示板に戻る■ 全部 1- 最新50    

■ このスレッドは過去ログ倉庫に格納されています

底辺私立医大を卒業した医者って頭悪いよね? Part23

284 :卵の名無しさん :2022/07/03(日) 14:52:14.36 ID:B0S8X40J0.net
calc=\(
N=3726, # 調査対象数
P55=55, # 回答率(%)
P50=50, # 支持率(%)
D=0.5){ # 誤差幅(%)
p55=P55/100
p50=P50/100
d=D/100
L55=floor((p55-d)*N)
u=(p55+d)*N
U55=ifelse(u-floor(u)==0,u,floor(u))
n=L55:U55
l=n*(p50-d)
L50=ifelse(l-floor(u)==0,l,ceiling(l))
U50=floor(n*(p50+d))
re=cbind(n,L50,U50,pL50=L50/n,pU50=U50/n)
idx.min=which.min(re[,4]) ; min(re[,4])
idx.max=which.max(re[,5]) ; max(re[,5])
Min=re[idx.min,4]
Max=re[idx.min,5]
f=\(x) (x[2]:x[3])/x[1]
p_all=unlist(apply(re,1,f))
Cases=length(unique(p_all))
cat(Cases,'cases\n')
cat('min : ',re[idx.min,'L50'],'/',re[idx.min,'n'],' = ',re[idx.min,'pL50'],'\n',sep='')
cat('max : ',re[idx.max,'U50'],'/',re[idx.max,'n'],' = ',re[idx.min,'pU50'],'\n',sep='')
}
calc(3726,55,50)
calc(2022,77,69)

総レス数 1021
289 KB
新着レスの表示

掲示板に戻る 全部 前100 次100 最新50
read.cgi ver 2014.07.20.01.SC 2014/07/20 D ★