void page3() { String t = "Step 3 - The Test Statistics"; String t2; textFont(myboldfont, 18); text(t, 30, 170); textFont(myfont, 18); testl = (aStudy.y - aStudy.n * aStudy.p + 0.5)/sqrt(aStudy.n * aStudy.p * (1-aStudy.p)); testu = (aStudy.y - aStudy.n * aStudy.p - 0.5)/sqrt(aStudy.n * aStudy.p * (1-aStudy.p)); if (aStudy.k==0) { t = "Since the alternative is left-tailed, we calculate: "; text(t, 30, 200); image(zl, 70, 220); t2 = "Z_l of " + nf(testl, 1, 4)+"."; } else if (aStudy.k==1) { t = "Since the alternative is right-tailed, we calculate: "; text(t, 30, 200); image(zu, 70, 220); t2 = "Z_u of " + nf(testu, 1, 4)+"."; } else { t = "Since the alternative is two-tailed, we calculate: "; text(t, 30, 200); image(zl, 70, 220); image(zu, 300, 220); t2 = "Z_l of " + nf(testl, 1, 4); t2 += " and a Z_u of " + nf(testu, 1, 4)+"."; } t = "Plugging in: Y as " + aStudy.y + ", n as " + aStudy.n + ", and p zero as " + nf(aStudy.p, 1, 2) + " gives us a " + t2; drawStrings(t, 30, 300,25); }