-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable_beta_unpaired_only.html
691 lines (604 loc) · 28.5 KB
/
table_beta_unpaired_only.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
<html>
<head>
<title>Single-Cell Sample Size</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<style>
* {
box-sizing: border-box;
}
body, html {
height: 100%;
margin: 0;
font-family: Arial;
}
/* Style tab links */
.tablink {
border-radius: 10px 10px 0px 0px;
background-color: #555;
color: white;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 8px 16px;
font-size: 17px;
width: 300px;
height: 40px;
}
.tablink:hover {
background-color: #777;
}
/* Style the tab content (and add height:100% for full page content) */
.tabcontent {
/*color: white;*/
display: none;
padding: 40px 0px;
height: 100%;
}
.row {
display: flex;
}
.column1 {
flex: 100%;
border-radius: 10px;
border: 2px solid #73AD21;
padding: 10px;
margin: 3px;
}
.column {
flex: 50%;
border-radius: 10px;
border: 2px solid #73AD21;
padding: 10px;
margin: 3px;
}
.column30 {
flex: 30%;
border-radius: 10px;
border: 2px solid #73AD21;
padding: 10px;
margin: 3px;
min-width: 300px;
}
.column40 {
flex: 40%;
border-radius: 10px;
border: 2px solid #73AD21;
padding: 10px;
margin: 3px;
}
.column70 {
flex: 70%;
border-radius: 10px;
border: 2px solid #73AD21;
padding: 10px;
margin: 3px;
}
label {
display: inline-block;
width: 150px;
text-align: left;
}
label.radio {
display: inline-block;
width: 250px;
text-align: left;
}
input[type=number] {
width:100px;
margin: 2px;
padding-left: 3px;
border: none; /* <-- This thing here */
border:solid 1px #ccc;
border-radius: 3px;
}
a.glossaryLink {
cursor: help;
border-bottom: 1px dashed #73AD21;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/jstat@latest/dist/jstat.min.js"></script>
<script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
<script type="text/javascript">
function betaStatParam(m, std)
{
m = parseFloat(m);
var v = parseFloat(std);
v = v * v;
var a = ((1 - m) / v - 1 / m) * m * m;
var b = a * (1 / m - 1)
return [a, b]
}
function betaParamStat(a, b)
{
a = parseFloat(a);
b = parseFloat(b);
var m = a / (a + b);
var v = a * b / Math.pow(a + b, 2) / (a + b + 1);
return [m, Math.sqrt(v)];
}
function execBetaParamStat(suffix)
{
var temp = betaParamStat(document.getElementById("a".concat(suffix)).value, document.getElementById("b".concat(suffix)).value);
document.getElementById("mean".concat(suffix)).value = round(temp[0], 4);
document.getElementById("std".concat(suffix)).value = round(temp[1], 4);
}
function execBetaStatParam(suffix)
{
var temp = betaStatParam(document.getElementById("mean".concat(suffix)).value, document.getElementById("std".concat(suffix)).value);
document.getElementById("a".concat(suffix)).value = round(temp[0], 3);
document.getElementById("b".concat(suffix)).value = round(temp[1], 3);
}
function calcBetaRaw(M0, M1, N0, N1, a0, a1, b0, b1, alpha, test_type, offset, sign)
{
N0 = parseFloat(N0);
N1 = parseFloat(N1);
M0 = parseFloat(M0);
M1 = parseFloat(M1);
a0 = parseFloat(a0);
a1 = parseFloat(a1);
b0 = parseFloat(b0);
b1 = parseFloat(b1);
alpha = parseFloat(alpha);
Ep0 = a0 / (a0 + b0);
Ep1 = a1 / (a1 + b1);
Vp0 = a0 * b0 * (a0 + b0 + N0) / ((N0 * (a0 + b0) * (a0 + b0)) * (a0 + b0 + 1));
Vp1 = a1 * b1 * (a1 + b1 + N1) / ((N1 * (a1 + b1) * (a1 + b1)) * (a1 + b1 + 1));
Et = (Ep1 - (Ep0 + offset)) / Math.sqrt(Vp0 / M0 + Vp1 / M1);
console.log(sign);
if (sign == 0) {
Et = Math.abs(Et);
} else {
Et = sign * Et;
}
nu = (Vp0 / M0 + Vp1 / M1) ** 2 / ((Vp0 / M0) ** 2 / (M0 - 1) + (Vp1 / M1) ** 2 / (M1 - 1));
if (test_type === "one_sided") t_star = jStat.studentt.inv(1 - alpha, nu);
else t_star = jStat.studentt.inv(1 - alpha / 2, nu);
return jStat.normal.cdf(t_star - Et, 0, 1)
}
function calcBeta(M0, M1, N0, N1, a0, a1, b0, b1, alpha)
{
Ep0 = a0 / (a0 + b0);
Ep1 = a1 / (a1 + b1);
Vp0 = a0 * b0 * (a0 + b0 + N0) / ((N0 * (a0 + b0) * (a0 + b0)) * (a0 + b0 + 1));
Vp1 = a1 * b1 * (a1 + b1 + N1) / ((N1 * (a1 + b1) * (a1 + b1)) * (a1 + b1 + 1));
Et = Math.abs(Ep1 - Ep0) / Math.sqrt(Vp0 / M0 + Vp1 / M1);
nu = (Vp0 / M0 + Vp1 / M1) ** 2 / ((Vp0 / M0) ** 2 / (M0 - 1) + (Vp1 / M1) ** 2 / (M1 - 1));
if (test_type === "one_sided") t_star = jStat.studentt.inv(1 - alpha, nu);
else t_star = jStat.studentt.inv(1 - alpha / 2, nu);
return jStat.normal.cdf(t_star - Et, 0, 1)
}
function round(x, p) {return Math.round(x * Math.pow(10, p)) / Math.pow(10, p)}
function execCalcBeta()
{
var M0_min = parseFloat(document.getElementById("M0_min").value);
var M0_max = parseFloat(document.getElementById("M0_max").value);
var M1_min = parseFloat(document.getElementById("M1_min").value);
var M1_max = parseFloat(document.getElementById("M1_max").value);
var N0 = parseFloat(document.getElementById("N0").value);
var N1 = parseFloat(document.getElementById("N1").value);
var a0 = parseFloat(document.getElementById("a0").value);
var a1 = parseFloat(document.getElementById("a1").value);
var b0 = parseFloat(document.getElementById("b0").value);
var b1 = parseFloat(document.getElementById("b1").value);
var alpha = parseFloat(document.getElementById("alpha").value);
var beta = parseFloat(document.getElementById("beta").value);
var test_type = "";
var sign = 0;
var offset = 0.0;
var lower_bound = 0.0;
var upper_bound = 0.0;
if (document.getElementById('one_sided').checked) {
test_type = "one_sided";
sign = 0;
offset = 0.0;
} else if (document.getElementById('two_sided').checked) {
test_type = "two_sided";
sign = 0;
offset = 0.0;
} else if (document.getElementById('sesoi_test').checked) {
test_type = "one_sided";
offset = parseFloat(document.getElementById("sesoi_bound").value);
if (offset == 0) {
//document.getElementById("result").innerHTML = "<p>Invalid input: SESOI must not be zero.</p>";
//return;
}
if (document.getElementById('sesoi_verify').checked) sign = Math.sign(offset);
else sign = -Math.sign(offset);
} else if (document.getElementById('tost_test').checked) {
test_type = "one_sided";
lower_bound = parseFloat(document.getElementById("tost_lower_bound").value);
upper_bound = parseFloat(document.getElementById("tost_upper_bound").value);
} else {
return; // do nothing.
}
var output = "<table class='w3-table' border='1' width='500' cellspacing='0'cellpadding='5'>";
output = output + "<tr>";
output = output + "<td>" + "ctrl \\ exp" + "</td>";
var temp = 1.0;
for (j = M1_min; j <= M1_max; j++)
{
output = output + "<td>" + j + "</td>";
}
output = output + "</tr>";
for(i = M0_min; i <= M0_max; i++)
{
output = output + "<tr>";
output = output + "<td>" + i + "</td>";
for (j = M1_min; j <= M1_max; j++)
{
if (document.getElementById('tost_test').checked) {
temp = Math.min((calcBetaRaw(i, j, N0, N1, a0, a1, b0, b1, alpha, test_type, upper_bound, -1) +
calcBetaRaw(i, j, N0, N1, a0, a1, b0, b1, alpha, test_type, lower_bound, 1)),
1);
} else {
temp = calcBetaRaw(i, j, N0, N1, a0, a1, b0, b1, alpha, test_type, offset, sign);
}
if (temp < beta) output = output + "<td bgcolor=#E0E0E0>" + round(temp, 3) + "</td>";
else output = output + "<td>" + round(temp, 3) + "</td>";
}
output = output + "</tr>";
}
output = output + "</table>";
document.getElementById("M0_min").value
document.getElementById("result").innerHTML = output;
//document.getElementById("results").scrollIntoView();
}
function plotBeta()
{
var a0 = parseFloat(document.getElementById("a0").value);
var a1 = parseFloat(document.getElementById("a1").value);
var b0 = parseFloat(document.getElementById("b0").value);
var b1 = parseFloat(document.getElementById("b1").value);
x = [];
y = [];
for (i = 0.0; i <= 1.0; i = i + 0.005) x.push(i);
for (i = 0; i < x.length; i++) y.push(jStat.beta.pdf(x[i], a1, b1))
var exp = {
x: x,
y: y,
type: 'scatter',
name: 'Experimental'
};
if (document.getElementById('one_sided').checked || document.getElementById('two_sided').checked) {
y = [];
for (i = 0; i < x.length; i++) y.push(jStat.beta.pdf(x[i], a0, b0));
var ctrl = {
x: x,
y: y,
type: 'scatter',
name: 'Control'
};
var data = [ctrl, exp];
} else if (document.getElementById('sesoi_test').checked) {
offset = parseFloat(document.getElementById("sesoi_bound").value);
y = [];
x1 = [];
for (i = 0; i < x.length; i++) {
y.push(jStat.beta.pdf(x[i], a0, b0));
x1.push(x[i] + offset);
}
var ctrl = {
x: x,
y: y,
type: 'scatter',
name: 'Control'
};
var sesoi = {
x: x1,
y: y,
type: 'scatter',
name: 'Control with SESOI',
line: {
dash: 'dot',
color: '#1f77b4'
}
};
var data = [ctrl, exp, sesoi];
} else if (document.getElementById('tost_test').checked) {
lower_bound = parseFloat(document.getElementById("tost_lower_bound").value);
upper_bound = parseFloat(document.getElementById("tost_upper_bound").value);
y = [];
x1 = [];
x2 = [];
for (i = 0; i < x.length; i++) {
y.push(jStat.beta.pdf(x[i], a0, b0));
x1.push(x[i] + lower_bound);
x2.push(x[i] + upper_bound);
}
var ctrl = {
x: x,
y: y,
type: 'scatter',
name: 'Control'
};
var lb = {
x: x1,
y: y,
type: 'scatter',
name: 'Lower',
line: {
dash: 'dot',
color: '#1f77b4'
}
};
var ub = {
x: x2,
y: y,
type: 'scatter',
name: 'Upper',
line: {
dash: 'dash',
color: '#1f77b4'
}
};
var data = [ctrl, exp, lb, ub];
} else {
return; // do nothing.
}
var layout = {showlegend: true, legend: {"orientation": "h"}, height: 300, width: 400,
margin: {
l: 50,
r: 50,
b: 50,
t: 50,
pad: 4
}
};
Plotly.newPlot('plot', data, layout)
}
</script>
</head>
<body>
<button class="tablink" onclick="openPage('main', this, 'green')" id="defaultOpen">Power Estimation</button>
<button class="tablink" onclick="openPage('instructions', this, 'green')">Instructions</button>
<div class="tabcontent" id="main">
<div class="row">
<div class="column30">
<h2>Control group</h2>
<div class="block">
<label for="">Range of samples M<sub>0</sub></label>
<input type="number" id="M0_min" value="" style="width: 45px;">
~
<input type="number" id="M0_max" value="" style="width: 45px;">
</div>
<div class="block">
<label for="N0">Number of cells N<sub>0</sub></label>
<input type="number" id="N0" value="" step=100>
</div>
<h3>Beta distribution</h3>
<h4><b>Specify</b> Mean and variance</h4>
<div class="block">
<label for="mean0">Mean</label>
<input type="number" id="mean0" value="" step="0.05" min="0.05" max="0.95" onchange="execBetaStatParam(0); plotBeta();">
</div>
<div class="block">
<label for="">Standard deviation</label>
<input type="number" id="std0" value="" step="0.01" min="0.001" onchange="execBetaStatParam(0); plotBeta();">
</div>
<h4><b>or</b> a<sub>0</sub> and b<sub>0</sub></h4>
<div class="block">
Beta(a<sub>0</sub> =
<input type="number" id="a0" value="" step="1" min="1" style="width: 70px" onchange="execBetaParamStat(0); plotBeta();">
, b<sub>0</sub> =
<input type="number" id="b0" value="" step="1" min="1" style="width: 70px" onchange="execBetaParamStat(0); plotBeta();">
)
</div>
</div>
<div class="column30">
<h2>Experimental group</h2>
<label for="">Range of samples M<sub>1</sub></label>
<input type="number" id="M1_min" value="" style="width: 45px;">
~
<input type="number" id="M1_max" value="" style="width: 45px;">
<div class="block">
<label for="N1">Number of cells N<sub>1</sub></label>
<input type="number" id="N1" value="" step=100>
</div>
<h3>Beta distribution</h3>
<h4><b>Specify</b> Mean and variance</h4>
<div class="block">
<label for="mean1">Mean</label>
<input type="number" id="mean1" value="" step="0.05" min="0.05" max="0.95" onchange="execBetaStatParam(1); plotBeta();">
</div>
<div class="block">
<label for="">Standard deviation</label>
<input type="number" id="std1" value="" step="0.01" min="0.001" onchange="execBetaStatParam(1); plotBeta();">
</div>
<h4><b>or</b> a<sub>1</sub> and b<sub>1</sub></h4>
<div class="block">
Beta(a<sub>1</sub> =
<input type="number" id="a1" value="" step="1" min="1" style="width: 70px" onchange="execBetaParamStat(1); plotBeta();">
, b<sub>1</sub> =
<input type="number" id="b1" value="" step="1" min="1" style="width: 70px" onchange="execBetaParamStat(1); plotBeta();">
)
</div>
</div>
<div class="column40">
<h2>Visualize Beta-distributions</h2>
<div id='plot'><!-- Plotly chart will be drawn inside this DIV --></div>
<div>The graph will update when the Beta-distributions change.</div>
</div>
</div>
<div class="row">
<div class="column30">
<h2>Statistical Test</h2>
<div>
<div class="block">
<label for="alpha">False positive rate α</label>
<input type="number" id="alpha" value="" step=0.01>
</div>
<div class="block">
<label for="beta">False negative threshold β<sub>th</sub></label>
<input type="number" id="beta" value="" step=0.01>
</div>
<div>
<h3>Type</h3>
<div>
<input type="radio" id="one_sided" name="test_type" value="one_sided" onchange="displayParams();" checked>
<label class="radio" for="one_sided">One-sided t-test</label>
</div>
<div>
<input type="radio" id="two_sided" name="test_type" value="two_sided" onchange="displayParams();">
<label class="radio" for="two_sided">Two-sided t-test</label>
</div>
<div>
<input type="radio" id="sesoi_test" name="test_type" value="sesoi_test" onchange="displayParams();">
<label class="radio" for="sesoi_test">t-Test with <a class="glossaryLink" title="SESOI: smallest effect size of interest">SESOI</a></label>
</div>
<div>
<input type="radio" id="tost_test" name="test_type" value="sesoi_test" onchange="displayParams();">
<label class="radio" for="tost_test"><a class="glossaryLink" title="TOST: two one-sided t-tests">TOST</a> for equivalence</label>
</div>
<div id="sesoi_param">
<h3>Parameters for SESOI</h3>
<div>
<input type="radio" id="sesoi_verify" name="sesoi_type" value="sesoi_verify" checked>
<label class="radio" for="sesoi_verify"><a class="glossaryLink" title="test if the effect is significantly greater than specified">Verify</a></label>
</div>
<div>
<input type="radio" id="sesoi_falsify" name="sesoi_type" value="sesoi_falsify">
<label class="radio" for="sesoi_falsify"><a class="glossaryLink" title="test if the effect is significantly smaller than specified">Falsify</a></label>
</div>
<div>
<label for="sesoi_bound">SESOI (≠ 0)</label>
<input type="number" id="sesoi_bound" value="0.01" step=0.005>
</div>
</div>
<div id="tost_param">
<h3>Parameters for TOST</h3>
<div>
<label for="tost_upper_bound"><a class="glossaryLink" title="Upper bound is set to (control + upper_bound_offset)">Upper bound offset</a></label>
<input type="number" id="tost_upper_bound" value="0.1" step=0.01 min=0.0>
</div>
<div>
<label for="tost_lower_bound"><a class="glossaryLink" title="Lower bound is set to (control - |lower_bound_offset|)">Lower bound offset</a></label>
<input type="number" id="tost_lower_bound" value="-0.1" step=0.01 max=0.0>
</div>
</div>
</div>
</div>
<!--<input type="button" id="create" value="Calculate beta table" onclick="execCalcBeta(); "/>-->
</div>
<div class="column70">
<h2>Result: False-negative rate β</h2>
<div>
<div id="result">
Results pending calculating...
</div>
</div>
<div>False negative rates. Lower is better. Each row correponds to a fixed number of control samples.
Each row correponds to a fixed number of experimental samples. Values pass β<sub>th</sub> are colored in gray.
</div>
</div>
</div>
</div>
<div class="tabcontent" id="instructions">
<div class="row">
<div class="column">
<h2>Instructions</h2>
<ol>
<li>Set range of M<sub>0</sub> and M<sub>1</sub>, i.e., the numbers of samples in control group and experimental group, respectively.</li>
<li>Set N<sub>0</sub> and N<sub>1</sub> for number of cells in each sample for each group. (Total number of cells = M<sub>0</sub>N<sub>0</sub> + M<sub>1</sub>N<sub>1</sub>) </li>
<li>Set mean and standard deviation for proportion of a cell type. This corresponds to variances among samples in a group. <b>Alternatively</b>, set a and b for each beta distribution.</li>
<li>Set α, it is the threshold for a significant p-value. 0.05 and 0.01 are commonly used.</li>
<li>Set threshold β<sub>th</sub> for preferred false negative rate. It is the probability of failing to yield a siginificant result.</li>
<li>Choose from one-sided test and two-sided test.</li>
</ol>
The table will automatically refresh when a value is changed.
</div>
</div>
<div class="row">
<div class="column">
<h2>Q&A</h2>
<ul>
<li>
<p>Q: What is a t-test with SESOI (smallest effect size of interest)? When should I use it?</p>
<p>
A: It is a t-test with a more stringent rule about what is considered a meaningful change. <br/><br/>
You can use it to verify a particular effect.
For example, if you set SESOI to 0.05, and choose "verify", the question it asks is "are the cases significantly higher than (controls + 0.05)?".
You can also use "falsify" to prove that there is no significant increase of the said SESOI.
The question then becomes "are the cases significantly lower than (controls + 0.05)?"
Note that the when SESOI is negative, the "verify" will test for "significantly lower", and so does the "falsify".
</p>
</li>
<li>
<p>Q: What is a TOST test (two one-sided tests for equivalence)? When should I use it?</p>
<p>
A: It tests if the cases are (1) significantly higher than the (controls - |lower_bound|), and (2) lower than the (controls + upper_bound). <br/><br/>
Because simply failing a t-test does not prove that there is no effect, as it can also be because of an insufficient sample size.
If you want to prove that the difference between the cases and the control are "equivalent", TOST is the simplest choice. <br/><br/>
Note that we assume the false-negative rate is the sum of the false-negative rate of both sides, truncated at 1.
</p>
</li>
</ul>
</div>
</div>
<div class="row">
<div class="column">
<h2>About</h2>
Github: <a href="https://github.com/KChen-lab/sensei">https://github.com/KChen-lab/sensei</a>
</div>
</div>
</div>
</body>
<script>
function openPage(pageName, elmnt, color) {
// Hide all elements with class="tabcontent" by default */
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Remove the background color of all tablinks/buttons
tablinks = document.getElementsByClassName("tablink");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].style.backgroundColor = "";
}
// Show the specific tab content
document.getElementById(pageName).style.display = "block";
// Add the specific color to the button used to open the tab content
elmnt.style.backgroundColor = color;
}
// Get the element with id="defaultOpen" and click on it
document.getElementById("defaultOpen").click();
var inputs = document.getElementsByTagName("input");
for (i=0; i<inputs.length; i++){
inputs[i].setAttribute('onchange', inputs[i].getAttribute('onchange') + '; plotBeta(); execCalcBeta();');
}
function displayParams(){
if (document.getElementById('sesoi_test').checked){
document.getElementById('tost_param').style.display = "none";
document.getElementById('sesoi_param').style.display = "block";
} else if (document.getElementById('tost_test').checked){
document.getElementById('sesoi_param').style.display = "none";
document.getElementById('tost_param').style.display = "block";
} else{
document.getElementById('sesoi_param').style.display = "none";
document.getElementById('tost_param').style.display = "none";
}
}
function init()
{
document.getElementById("M0_min").value = 5;
document.getElementById("M1_min").value = 5;
document.getElementById("M0_max").value = 12;
document.getElementById("M1_max").value = 12;
document.getElementById("N0").value = 1000;
document.getElementById("N1").value = 1000;
document.getElementById("a0").value = 7;
document.getElementById("a1").value = 10;
document.getElementById("b0").value = 10;
document.getElementById("b1").value = 7;
document.getElementById("alpha").value = 0.05;
document.getElementById("beta").value = 0.1;
execBetaParamStat(0);
execBetaParamStat(1);
plotBeta();
}
init();
displayParams()
execCalcBeta();
</script>
</html>