メイン sample-size.html Last modified: Sep 01, 2009
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;CHARSET=EUC-JP">
<link rel="shortcut icon" href="../favicon.ico">
<title>JavaScript</title>
<script src="pxg.js">document.write("pxg.js ファイルが見つかりません??<br>")</script>
<script language="JavaScript">
<!--
function pxg2(x)
{
return (x > 0.5) ? -pxg(1-x) : pxg(x)
}
function f_hiritu1(form)
{
form.n.value = ""
var pi, ac, conf
if (isNaN(pi = parseFloat(form.pi.value)) || pi <= 0 || pi >= 1 || isNaN(ac = parseFloat(form.ac.value)) || ac <= 0 || ac >= 1 || isNaN(conf = parseFloat(form.conf.value)) || conf <= 0 || conf >= 1) return
form.n.value = Math.ceil(Math.pow(pxg2((1-conf)/2)/ac, 2)*pi*(1-pi))
}
function f_heikin1(form)
{
form.n.value = ""
var sigma, ac, conf
if (isNaN(sigma = parseFloat(form.sigma.value)) || sigma <= 0 || isNaN(ac = parseFloat(form.ac.value)) || isNaN(conf = parseFloat(form.conf.value)) || conf <= 0 || conf >= 1) return
form.n.value = Math.ceil(Math.pow(pxg2((1-conf)/2)/ac, 2)*sigma)
}
function f_hiritu2(form)
{
form.n.value = form.n2.value = ""
var pi1, pi2, alpha, beta, p, n
if (isNaN(pi1 = parseFloat(form.pi1.value)) || pi1 <= 0 || pi1 >= 1 || isNaN(pi2 = parseFloat(form.pi2.value)) || pi2 <= 0 || pi2 >= 1 || isNaN(alpha = parseFloat(form.alpha.value)) || alpha <= 0 || alpha >= 1 || isNaN(beta = parseFloat(form.beta.value)) || beta <= 0 || beta >= 1) return
p = (pi1+pi2)/2
n = Math.pow((pxg2(alpha/2)*Math.sqrt(2*p*(1-p))+pxg2(1-beta)*Math.sqrt(pi1*(1-pi1)+pi2*(1-pi2)))/(pi2-pi1),2)
form.n.value = Math.ceil(n)
form.n2.value = Math.ceil(n*Math.pow(1+Math.sqrt(1+8/(n*Math.abs(pi2-pi1))),2)/4)
}
function f_heikin2(form)
{
form.n.value = form.n2.value = ""
var d, sigma, alpha, beta
if (isNaN(d = parseFloat(form.d.value)) || isNaN(sigma = parseFloat(form.sigma.value)) || sigma <= 0 || isNaN(alpha = parseFloat(form.alpha.value)) || alpha <= 0 || alpha >= 1 || isNaN(beta = parseFloat(form.beta.value)) || beta <= 0 || beta >= 1) return
form.n.value = Math.ceil(2*sigma*Math.pow((pxg2(alpha)+pxg2((1-beta)))/d, 2))
form.n2.value = Math.ceil(2*sigma*Math.pow((pxg2(alpha/2)+pxg2((1-beta)))/d, 2))
}
//-->
</script>
</head>
<body bgcolor="#ffffff">
<font size="+2"><b>比率および平均値の差の検定・推定に必要な標本サイズの決定</b></font><br> <a href="src/sample-size.html"><img src="png/src.png" width=35 height=11 alt="src" align=top></a> Last modified: Jun 01, 2006<hr noshade><p>
<font color="#ff0000" size="+2">以下のプログラムのサポートは終了しました。自己責任でお使い下さい。</font>
<script language="JavaScript">
<!--
//-->JavaScript がサポートされていないブラウザですか?
</script>
<hr noshade>
<table border=1>
<tr>
<td valign=top align=right bgcolor="#eecccc">
<table border=0>
<caption><font color="#5555aa"><b>母比率の推定</b></font></caption>
<tr>
<td align=right>
<form name="hiritu1">
母比率の概数 <input name="pi" value=0.6 size=10><br>
精度 <input name="ac" value=0.1 size=10><br>
信頼率 <input name="conf" value=0.95 size=10><br>
<input type="button" name="clear" value="初期化" onClick="this.form.pi.value=this.form.ac.value=this.form.conf.value=this.form.n.value=''"> <input type="button" name="calcurate" value="計算開始" onClick="f_hiritu1(this.form)"><br>
標本サイズ <input name="n" value="" size=10><br>
</form>
</td>
</tr>
</table>
</td>
<td valign=top align=right bgcolor="#eecccc">
<table border=0>
<caption><font color="#5555aa"><b>母平均の推定</b></font></caption>
<tr>
<td align=right>
<form name="heikin1">
母分散の概数 <input name="sigma" value=3 size=10><br>
精度 <input name="ac" value=0.5 size=10><br>
信頼率 <input name="conf" value=0.95 size=10><br>
<input type="button" name="clear" value="初期化" onClick="this.form.sigma.value=this.form.ac.value=this.form.conf.value=this.form.n.value=''"> <input type="button" name="calcurate" value="計算開始" onClick="f_heikin1(this.form)"><br>
標本サイズ <input name="n" value="" size=10><br>
</form>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign=top align=right bgcolor="#eecccc">
<table border=0>
<caption><font color="#5555aa"><b>二群の比率の差の検定</b></font></caption>
<tr>
<td align=right>
<form name="hiritu2">
第一群の比率の概数 <input name="pi1" value=0.8 size=10><br>
第二群の比率の概数 <input name="pi2" value=0.9 size=10><br>
有意水準 <input name="alpha" value=0.05 size=10><br>
検出力 <input name="beta" value=0.8 size=10><br>
<input type="button" name="clear" value="初期化" onClick="this.form.pi1.value=this.form.pi2.value=this.form.alpha.value=this.form.beta.value=this.form.n.value=this.form.n2.value=''"> <input type="button" name="calcurate" value="計算開始" onClick="f_hiritu2(this.form)"><br>
標本サイズ <input name="n" value="" size=10><br>
連続補正標本サイズ <input name="n2" value="" size=10><br>
各群あたりの標本サイズです<br>
</form>
</td>
</tr>
</table>
</td>
<td valign=top align=right bgcolor="#eecccc">
<table border=0>
<caption><font color="#5555aa"><b>二群の平均値の差の検定</b></font></caption>
<tr>
<td align=right>
<form name="heikin2">
検出する平均値の差 <input name="d" value=5 size=10><br>
母分散の概数 <input name="sigma" value=49 size=10><br>
有意水準 <input name="alpha" value=0.05 size=10><br>
検出力 <input name="beta" value=0.9 size=10><br>
<input type="button" name="clear" value="初期化" onClick="this.form.d.value=this.form.sigma.value=this.form.alpha.value=this.form.beta.value=this.form.n.value=this.form.n2.value=''"> <input type="button" name="calcurate" value="計算開始" onClick="f_heikin2(this.form)"><br>
片側検定標本サイズ <input name="n" value="" size=10><br>
両側検定標本サイズ <input name="n2" value="" size=10><br>
各群あたりの標本サイズです<br>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p><hr noshade>
<img src="../gra/button3.png" width=9 height=9 alt="・"> <A HREF="../lecture/SampleSize/index.html"> 手法の解説</a><br>
<img src="../gra/button3.png" width=9 height=9 alt="・"> <A HREF="javascript:history.go(-1)">直前のページへ戻る</A> <img src="../gra/button3.png" width=9 height=9 alt="・"> <a href="../mail.html">E-mail to Shigenobu AOKI</a>
<p><center><IMG SRC="../gra/ume5.png" width=121 height=37 ALT="Made with Macintosh"></center>
</body>
</html>
サブ pxg.js Last modified: Mar 25, 2004
直前のページへ戻る E-mail to Shigenobu AOKI