void page2() { String t = "Step 2"; textFont(myboldfont, 18); text(t, 30, 110); textFont(myfont, 18); if (aStudy.k == 0) { generateGraph(0, false, 1); image(pg, 400, 150); t = "Since the right-tailed value equals the total probability, which is 1, minus the left-tailed value:"; drawStrings(t, 30, 140, 25); t = "1-" + nf(value, 1, 4) + " = " + nf(1-value, 1, 4); text(t, 180, 190); t = "Therefore, the right-tailed p-value (in green) equals " +nf(1-value, 1, 4); drawStrings(t, 30, 270, 25); } else if (aStudy.k == 2) { if (aStudy.testvalue>0) { generateGraph(0, false, 1); image(pg, 400, 150); generateGraph(2, false, 2); image(pg, 450, 290); t = "Since the right-tailed value equals the total probability, which is 1, minus the left-tailed value:"; drawStrings(t, 30, 140, 25); t = "1-" + nf(value, 1, 4) + " = " + nf(1-value, 1, 4); text(t, 180, 190); t = "The right-tailed p-value (in green) equals " +nf(1-value, 1, 4); text(t, 30, 260); t = "Multiply that by two, we get the two-tailed value:"; text(t, 30, 290); t = "2*" + nf(1-value, 1, 4) + " = " + nf(2*(1-value), 1, 4); text(t, 180, 330); t = "Therefore, the two-tailed p-value (in blue) equals " + nf(2*(1-value), 1, 4); drawStrings(t, 30, 390, 25); } else { generateGraph(2, false, 1); image(pg, 400, 150); t = "Multiply that by two, we get the two-tailed value:"; drawStrings(t, 30, 140, 25); t = "2*" + nf(value, 1, 4) + " = " + nf(2*value, 1, 4); text(t, 180, 190); t = "Therefore, the two-tailed p-value (in green) equals " +nf(2*value, 1, 4); text(t, 30, 260); } } else { generateGraph(1, false, 1); image(pg, 200, 170); t = "Therefore, the left-tailed p-value (in green) equals " +nf(value, 1, 4); drawStrings(t, 30, 140, 25); } t = "THE END. Click the right arrow for a new problem"; text(t, 150, 450); leftarrow.setVisible(true); rightarrow.setVisible(true); }