void page5() { background(255); String t = "Step 4 - The p-value (continued)"; textFont(myboldfont, 18); text(t, 30, 40); textFont(myfont, 18); if (aStudy.k==0) { t = "Since the alternative is left-tailed, we use the formula: "; text(t, 30, 70); image(p1, 80, 100); generateGraph(testl, 1, 0); image(pg, 400, 100); pvalue = pl; t = "p_ is indicated in red"; text(t, 80, 150); t = "Calculate the p-value? Type in the following textbox (with at least 3 decimal places) then click Answer:"; drawStrings(t, 30, 205,25); tf2.setXY(262,213); } else if (aStudy.k==1) { t = "Since the alternative is right-tailed, we use the formula: "; text(t, 30, 70); image(p2, 80, 100); generateGraph(testu, 0, 0); image(pg, 400, 100); t = "p+ is indicated in red"; text(t, 80, 150); pvalue = 1-pu; t = "Calculate the p-value? Type in the following textbox (with at least 3 decimal places) then click Answer:"; drawStrings(t, 30, 210,25); tf2.setXY(250,218); } else { t = "Since the alternative is two-tailed, we use these formulas: "; text(t, 30, 70); image(p1, 80, 100); generateGraph(testl, 1, 0); image(pg, 400, 100); t = "p_ is indicated in red"; text(t, 80, 150); image(p2, 80, 180); generateGraph(testu, 0, 1); image(pg, 400, 200); t = "p+ is indicated in green"; text(t, 80, 230); image(p3, 80, 250); if (pl < 1-pu) { pvalue = 2*pl; } else { pvalue = 2*(1-pu); } t = "Calculate the p-value. Type in the following textbox (with at least 3 decimal places) then click Answer:"; drawStrings(t, 30, 300,25); tf2.setXY(250,308); } fill(0, 0, 255); drawStrings(feedback, 80, 380,25); tf2.setVisible(true); tf3.setVisible(false); cb6.setVisible(false); }