void page7() { background(255); int tempx=0; generateGraph(); image(pg, 100, 20); String t = "Step 5 - The P-value (continued)"; textFont(myboldfont, 18); text(t, 30, 30); textFont(myfont, 18); if ((aStudy.known == 1) || (aStudy.samplesize>30)) { t = "N(0,1)"; text(t, 330, 60); tf3.setVisible(true); cb6.setVisible(false); } else { t = "t" + nf(aStudy.samplesize-1, 1); tf3.setVisible(false); cb6.setVisible(true); if(aStudy.samplesize == 10) text(t, 343, 60); if(aStudy.samplesize > 10) text(t, 340, 60); } if ((aStudy.known == 1) || (aStudy.samplesize>30)) { if (aStudy.k==0) { t = "Since the alternative is right-tailed, the p-value (indicated in red) equals the total probability, which is 1, minus the left-tailed value."; p = 1.0-zvalue; } else if (aStudy.k ==1) { t = "Since the alternative is left-tailed, the p-value (indicated in red) just equals the left-tailed value."; p = zvalue; } else { t= "Since the alternative is two-tailed, the p-value equals 2 times the minimum of the left-tailed and right-tailed values."; if (zvalue<0.5) { p = 2.0*zvalue; } else { p = (1.0-zvalue)*2.0; } } t += " What is the p-value? Type in the following textbox then click Answer: "; tempx = drawStrings(t, 30, 250, 25); tf3.setXY(tempx+10,283); } else { if (aStudy.k == 0) { p = 1.0-zvalue; if (testvalue > tcomp) { t = "Since t* > " + nf(tcomp, 1, 4) + ", what must be the area to the right of t*?"; } else { t = "Since t* < " + nf(tcomp, 1, 4) + ", what must be the area to the right of t*?"; } } else if (aStudy.k == 1) { p = zvalue; if (testvalue < -tcomp) { t = "Since t* < -" + nf(tcomp, 1, 4) + ", what must be the area to the left of t*?"; } else { t = "Since t* > -" + nf(tcomp, 1, 4) + ", what must be the area to the left of t*?"; } } else { if (zvalue<0.5) { p = 2.0*zvalue; } else { p = (1.0-zvalue)*2.0; } if (abs(testvalue) > tcomp) { t = "Since |t*| > " + nf(tcomp, 1, 4) + ", what must be the area when shading both tails?"; } else { t = "Since |t*| < " + nf(tcomp, 1, 4) + ", what must be the area when shading both tails?"; } } t += " What is the p-value? Choose the appropriate response then click Answer: "; tempx = drawStrings(t, 30, 250, 25); cb6.setXY(tempx+10,260); } fill(0, 0, 255); drawStrings(feedback, 80, 380, 25); cb7.setVisible(false); }