Problem Set 8 Answer Checker
Work on the assigned problems in the associated Problem Set PDF file, then use the problem set checker to find out if the answer was correct or incorrect. To check your answers put them in the appropriate box and click the ‘Check’ button. Every checker box can do arithmetic and calculate standard functions (see calculator help). If you give decimal answers, give them to at least 3 decimal places.
As you work you should have pencil and paper handy for calculations and thinking!
Note: some questions ask for a formula. For the checker we ask you to plug a value into the formula. For your pset you still need to give the whole formula.
//DEBUG PARAMETERS //Because we don’t show solutions for pset checkers we use //this to give a showanswer button during the debugging phase var debugans = undefined; //release //var debugans = kDebugAnswer; //debug problemNumber = 0; wl(“Calculator”); writecalculator(“psetcheckcalcid”, “Calculate”); whr(kdivcol,kdivwid);
//Problem 1 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a) Hint: the rejection region is one-sided."; wl(s); wl(kp); s = “(a.i) Give smallest value in the rejection region”; wl(s); wl(kp); partName = problemNumber + " (a.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0, buttonLabel, 0.001, debugans); wl(kp); s = “(a.ii) Give largest value in the rejection region”; wl(s); wl(kp); partName = problemNumber + " (a.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 2, buttonLabel, 0.001, debugans); wl(kp); s = “(a.iii) Give the $p$-value”; wl(s); wl(kp); partName = problemNumber + " (a.iii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .072998, buttonLabel, 0.001, debugans); wl(kp); s = “(b.i) Give smallest value in the rejection region”; wl(s); wl(kp); partName = problemNumber + " (b.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 9, buttonLabel, 0.001, debugans); wl(kp); s = “(b.ii) Give the $p$-value”; wl(s); wl(kp); partName = problemNumber + " (b.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .032715, buttonLabel, 0.001, debugans); wl(kp); s = “(c) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(d) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); s = “(e) " + knoonlinecheck; wl(s); wl(kp); wl(kbr); whr(kdivcol,kdivwid);
//Problem 2 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(i) Give value of the $X^2$ test statistic”; wl(s); wl(kp); partName = problemNumber + " (i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 25.7372, buttonLabel, 0.001, debugans); wl(kp); s = “(ii) Give the $p$-value”; wl(s); wl(kp); partName = problemNumber + " (ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0.0071, buttonLabel, 0.001, debugans); wl(kp); whr(kdivcol,kdivwid);
//Problem 3 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = emphtext("(You only need to use one of the $G$ or $X^2$ statistics.)"); wl(s); wl(kp); s = “(i) Give the $G$ statistic”; wl(s); wl(kp); partName = problemNumber + " (i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 56.3919, buttonLabel, 0.001, debugans); wl(kp); s = “(ii) Give value of the $X^2$ test statistic”; wl(s); wl(kp); partName = problemNumber + " (ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 62.69983, buttonLabel, 0.001, debugans); wl(kp); s = “(iii) Give the $p$-value to 5 decimal places”; wl(s); wl(kp); partName = problemNumber + " (iii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 0, buttonLabel, 0.001, debugans); wl(kp); whr(kdivcol,kdivwid);
//Problem 4 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a) Give the $p$-value”; wl(s); wl(kp); partName = problemNumber + " (a)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .9484, buttonLabel, 0.001, debugans); wl(kp); s = “(b.i) Give the $F$-statistic”; wl(s); wl(kp); partName = problemNumber + " (b.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .9703, buttonLabel, 0.001, debugans); wl(kp); s = “(b.ii) Give the $p$-value”; wl(s); wl(kp); partName = problemNumber + " (b.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .9484, buttonLabel, 0.001, debugans); wl(kp); whr(kdivcol,kdivwid);
//Problem 5 problemNumber++; wl(problemheader(problemNumber)); wl(''); var s; var partName, problemName, buttonLabel, answerArray, correct; s = “(a.i) Give the $F$-statistic”; wl(s); wl(kp); partName = problemNumber + " (a.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 6.0945, buttonLabel, 0.001, debugans); wl(kp); s = “(a.ii) Give the $p$-value to 5 decimal places”; wl(s); wl(kp); partName = problemNumber + " (a.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .00041, buttonLabel, 0.001, debugans); wl(kp); s = “(b) To compare all of the means two at a time requires how many tests?"; wl(s); wl(kp); partName = problemNumber + " (b)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 6, buttonLabel, 0.00001, debugans); wl(kp); s = emphtext(“Comparing 10-day growth vs. clean shaven:");; wl(s); wl(kbr); s = “(c.i) Give the $t$-statistic”; wl(s); wl(kp); partName = problemNumber + " (c.i)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 3.22314, buttonLabel, 0.001, debugans); wl(kp); s = “(c.ii) Give the one-sided $p$-value to 5 decimal places” wl(s); wl(kp); partName = problemNumber + " (c.ii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .00066, buttonLabel, 0.00001, debugans); wl(kp); s = emphtext(“Comparing 10-day growth vs. 5-day growth:"); wl(s); wl(kbr); s = “(c.iii) Give the $t$-statistic”; wl(s); wl(kp); partName = problemNumber + " (c.iii)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 3.84587, buttonLabel, 0.001, debugans); wl(kp); s = “(c.iv) Give the one-sided $p$-value to 5 decimal places”; wl(s); wl(kp); partName = problemNumber + " (c.iv)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .00007, buttonLabel, 0.00001, debugans); wl(kp); s = emphtext(“Comparing 10-day growth vs. full beard:"); wl(s); wl(kbr); s = “(c.v) Give the $t$-statistic”; wl(s); wl(kp); partName = problemNumber + " (c.v)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, 1.98273, buttonLabel, 0.001, debugans); wl(kp); s = “(c.vi) Give the one-sided $p$-value to 5 decimal places”; wl(s); wl(kp); partName = problemNumber + " (c.vi)"; problemName = “prob” + partName; buttonLabel = “Check problem " + partName; writeNumericBox(partName+"id”, .02389, buttonLabel, 0.001, debugans); wl(kp); whr(kdivcol,kdivwid);