void page1() { generateGraph(1,true,0); image(pg, 500, 230); String t = "Step 1"; textFont(myboldfont, 18); text(t, 30, 110); textFont(myfont, 18); t = "The degree of freedom: k = n-1 = " + aStudy.samplesize + "-1 = " + (aStudy.samplesize-1); text(t, 30, 140); t = "Open Table A.4 in the back of the book, look up row " + (aStudy.samplesize-1) + " and find the closest value(s) to " + nf(abs(aStudy.testvalue), 1, 4); drawStrings(t, 30, 170, 25); s = 0; float value = (float)(Probability.tcdf(abs(aStudy.testvalue), aStudy.samplesize-1)); for (int i=1; i critical[i]) { s++; } else { break; } } if (s==0) { text("0.90", 250, 240); text((aStudy.samplesize-1), 130, 330); text(nf((float)(Probability.tinv(0.9, aStudy.samplesize-1)), 1, 4), 250, 330); t = "We find " + nf(abs(aStudy.testvalue), 1, 4) + " is less than " + nf((float)(Probability.tinv(0.9, aStudy.samplesize-1)), 1, 4); text(t, 30, 370); } else if (s==7) { text("0.9995", 250, 240); text((aStudy.samplesize-1), 130, 330); text(nf((float)(Probability.tinv(0.9995, aStudy.samplesize-1)), 1, 4), 250, 330); t = "We find " + nf(abs(aStudy.testvalue), 1, 4) + " is greater than " + nf((float)(Probability.tinv(0.9995, aStudy.samplesize-1)), 1, 4); drawStrings(t, 30, 370, 25); } else { text(critical[s], 250, 240); text(nf(critical[s+1], 1, 4), 380, 240); text((aStudy.samplesize-1), 130, 330); text(nf((float)(Probability.tinv(critical[s], aStudy.samplesize-1)), 1, 4), 250, 330); text(nf((float)(Probability.tinv(critical[s+1], aStudy.samplesize-1)), 1, 4), 380, 330); image(smalldown, 395, 260); t = "We find " + nf(abs(aStudy.testvalue), 1, 4) + " is between " + nf((float)(Probability.tinv(critical[s], aStudy.samplesize-1)), 1, 4) + " and " + nf((float)(Probability.tinv(critical[s+1], aStudy.samplesize-1)), 1, 4); text(t, 30, 370); } image(smalldown, 265, 260); image(smallright, 190, 305); t = "Thus, the left-tailed value of " + nf(abs(aStudy.testvalue), 1, 4) + " (in red) is between " + critical[s] + " and " + critical[s+1]; text(t, 30, 400); leftarrow.setVisible(false); rightarrow.setVisible(true); }