qu.1.topic=Goodness-of-Fit Tests@

qu.1.1.mode=Inline@
qu.1.1.name=Calculate test statistic, range of p-value, conclusion@
qu.1.1.comment=<p>&nbsp;</p>
<p>a)&nbsp; The appropriate alternative hypothesis is <em>H<sub>A</sub>: At least one of the proportions is incorrect.</em>&nbsp;</p>
<p>&nbsp;</p>
<p>b)&nbsp; The test statistic is given by the formula <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi mathcolor='#800080'>i</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>1</mn></mrow><mrow><mn>4</mn></mrow></munderover><mrow><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><msub><mi mathvariant='normal'>O</mi><mrow><mi>i</mi></mrow></msub><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><msub><mi>E</mi><mrow><mi>i</mi></mrow></msub></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><msub><mi>E</mi><mrow><mi>i</mi></mrow></msub></mrow></mfrac></mrow></mrow></mstyle></math>, where the expected values can be&nbsp;calculated using the formula <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>E</mi><mrow><mi>i</mi></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>n</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><msub><mi>p</mi><mrow><mi>i</mi></mrow></msub></mrow></mstyle></math>, where <em>n</em> is the total number of observations, and <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>p</mi><mrow><mi>i</mi></mrow></msub></mrow></mstyle></math>is the hypothesized probability for a particular cell.&nbsp; After calculating the expected values, and substituting the observed and expected values into the formula for the test statistic, we get <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs1</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp1</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><mi>$Exp1</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs2</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp2</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><mi>$Exp2</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs3</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp3</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><mi>$Exp3</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs4</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp4</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp4</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$ChiTest</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>c)&nbsp; The p-value is calculated as the area under a <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>&nbsp;distribution, with <em>k - 1 = 4 - 1 = 3</em> degrees of freedom, to the right of the test statistic.&nbsp; Using computer software, or approximating with a <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>&nbsp;table, we can find the p-value to be $pvalue.</p>
<p>&nbsp;</p>
<p>d)&nbsp; Since the p-value is less than <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>&alpha;</mi><mo mathvariant='italic' lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn mathvariant='italic'>0.05</mn></mrow></mstyle></math>, there is sufficient evidence to reject the null hypothesis in favour of the alternative hypothesis: that at least one of the proportions is not equal to its hypothesized value.</p>@
qu.1.1.editing=useHTML@
qu.1.1.solution=@
qu.1.1.algorithm=$n=range(1000, 1200);
$p1=rand(0.46, 0.49, 2);
$p2=rand(0.15, 0.19, 2);
$p3=rand(0.09, 0.12, 2);
$p4=1-($p1+$p2+$p3);
$Obs1=decimal(0,$n*$p1);
$Obs2=decimal(0,$n*$p2);
$Obs3=decimal(0,$n*$p3);
$Obs4=$n-($Obs1+$Obs2+$Obs3);
$Exp1=$n*0.5;
$Exp2=$n*0.2;
$Exp3=$n*0.1;
$Exp4=$n*0.2;
$ChiTest=(($Obs1-$Exp1)^2/$Exp1)+(($Obs2-$Exp2)^2/$Exp2)+(($Obs3-$Exp3)^2/$Exp3)+(($Obs4-$Exp4)^2/$Exp4);
$Chi=numfmt("#.00000", $ChiTest);
$LowerTail=maple("
X:=Statistics[CDF](ChiSquare(3),$ChiTest):
X
");
$pvalue=1-$LowerTail;
condition:lt($pvalue,0.01);@
qu.1.1.uid=f1384c69-4797-4172-ac3a-4f884340af8a@
qu.1.1.info=  Course=Introductory Statistics;
  Topic=Goodness-of-Fit Tests;
  Author=Lorna Deeth;
  Difficulty=Hard;
  Features=None;
  Type=Calculation;
@
qu.1.1.weighting=1,1,1,1@
qu.1.1.numbering=alpha@
qu.1.1.part.1.name=sro_id_1@
qu.1.1.part.1.editing=useHTML@
qu.1.1.part.1.fixed=@
qu.1.1.part.1.question=null@
qu.1.1.part.1.choice.3=<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>H</mi><mrow><mi>A</mi></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&colon;</mo></mrow></mstyle></math>&nbsp;All of the proportions are equal to each other.@
qu.1.1.part.1.choice.2=<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>H</mi><mrow><mi>A</mi></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&colon;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math>All of the proportions are incorrect.@
qu.1.1.part.1.choice.1=<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>H</mi><mrow><mi>A</mi></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&colon;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math>At least one of the proportions is incorrect.@
qu.1.1.part.1.mode=Multiple Choice@
qu.1.1.part.1.display=vertical@
qu.1.1.part.1.answer=1@
qu.1.1.part.2.name=sro_id_2@
qu.1.1.part.2.answer.units=@
qu.1.1.part.2.numStyle=   @
qu.1.1.part.2.editing=useHTML@
qu.1.1.part.2.showUnits=false@
qu.1.1.part.2.err=0.01@
qu.1.1.part.2.question=(Unset)@
qu.1.1.part.2.mode=Numeric@
qu.1.1.part.2.grading=toler_abs@
qu.1.1.part.2.negStyle=both@
qu.1.1.part.2.answer.num=$ChiTest@
qu.1.1.part.3.name=sro_id_3@
qu.1.1.part.3.editing=useHTML@
qu.1.1.part.3.choice.5=p-value < 0.01@
qu.1.1.part.3.fixed=@
qu.1.1.part.3.choice.4=0.01 < p-value < 0.025@
qu.1.1.part.3.question=null@
qu.1.1.part.3.choice.3=0.025 < p-value < 0.05@
qu.1.1.part.3.choice.2=0.05 < p-value < 0.10@
qu.1.1.part.3.choice.1=p-value > 0.10@
qu.1.1.part.3.mode=Non Permuting Multiple Choice@
qu.1.1.part.3.display=vertical@
qu.1.1.part.3.answer=5@
qu.1.1.part.4.name=sro_id_4@
qu.1.1.part.4.editing=useHTML@
qu.1.1.part.4.fixed=@
qu.1.1.part.4.question=null@
qu.1.1.part.4.choice.2=There is no significant evidence against the null hypothesis, and therefore the null hypothesis is not rejected.@
qu.1.1.part.4.choice.1=There is very strong evidence against the null hypothesis, and therefore it is rejected in favour of the alternative hypothesis.@
qu.1.1.part.4.mode=Multiple Choice@
qu.1.1.part.4.display=vertical@
qu.1.1.part.4.answer=1@
qu.1.1.question=<p>Suppose there is a random sample of&nbsp;$n observations, divided into&nbsp;four groups.&nbsp; The table below summarizes the count of observations that were seen in each group.</p><p>&nbsp;</p><p><table border="1" cellspacing="1" cellpadding="1" width="300" align="center">    <tbody>        <tr>            <td>            <p align="center"><strong>Group 1</strong></p>            </td>            <td>            <p align="center"><strong>Group 2</strong></p>            </td>            <td>            <p align="center"><strong>Group 3</strong></p>            </td>            <td>            <p align="center"><strong>Group 4</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center">$Obs1</p>            </td>            <td>            <p align="center">$Obs2</p>            </td>            <td>            <p align="center">$Obs3</p>            </td>            <td>            <p align="center">$Obs4</p>            </td>        </tr>    </tbody></table></p><p>&nbsp;</p><p>We are interested in testing the null hypothesis <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>H</mi><mrow><mn>0</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&colon;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><msub><mi>p</mi><mrow><mn>1</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0.5</mn><mo separator='true' lspace='0.0em' rspace='0.3333333em'>&comma;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><msub><mi>p</mi><mrow><mn>2</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0.2</mn><mo separator='true' lspace='0.0em' rspace='0.3333333em'>&comma;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><msub><mi>p</mi><mrow><mn>3</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0.1</mn><mo separator='true' lspace='0.0em' rspace='0.3333333em'>&comma;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><msub><mi>p</mi><mrow><mn>4</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0.2</mn></mrow></mstyle></math>.</p><p>&nbsp;</p><p>&nbsp;</p><p>a)&nbsp; What is the appropriate alternative hypothesis?</p><p>&nbsp;</p><p><span>&nbsp;</span><1><span>&nbsp;</span></p><p>&nbsp;</p><p>&nbsp;</p><p><span><span><span><span><span>b)&nbsp; What is the value of the test statistic?</span></span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span><span>Round your response to at least&nbsp;3 decimal places.</span></span></span></span></span></p><p><span><span><span><span><span><span>&nbsp;</span><2><span>&nbsp;</span>&nbsp;</span></span></span></span></span></p><p>&nbsp;</p><p>&nbsp;</p><p><span><span><span><span><span>c)&nbsp; The p-value falls within which one of the following ranges:</span></span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span><span><span>&nbsp;</span><3><span>&nbsp;</span></span></span></span></span></span></p><p>&nbsp;</p><p>&nbsp;</p><p><span><span><span><span><span><span>d)&nbsp; What conclusion can be made at the 5% level of significance?</span></span></span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span><span><span><span>&nbsp;</span><4><span>&nbsp;</span></span></span></span></span></span></span></p>@

qu.1.2.mode=Inline@
qu.1.2.name=Calculate observed counts, expected counts@
qu.1.2.comment=<p>a)&nbsp; If there are 500 observations, and there are $p1P % in Group 1, $p2P % in Group 2, $p3P % in Group 3, and $p4P % in Group 4, then the observed counts are:</p>
<p>Group 1: $p1D&nbsp;x 500 = $Obs1</p>
<p>Group 2: $p2D x 500 = $Obs2</p>
<p>Group 3: $p3D x 500 = $Obs3</p>
<p>Group 4: $p4D x 500 = $Obs4</p>
<p>&nbsp;</p>
<p>b)&nbsp; If it is hypothesized there is an equal percentage of observations in each group, then with 4 groups we would expect to see 25 % of the observations in each group.&nbsp; Therefore, the expected count of observations in each group is 0.25 x 500 = 125.</p>@
qu.1.2.editing=useHTML@
qu.1.2.solution=@
qu.1.2.algorithm=$p1=rint(1, 8);
$p2=rint(1, 9-$p1);
$p3=rint(1, 10-($p1 + $p2));
$p4=10-($p1+$p2+$p3);
$p1P=$p1*10;
$p2P=$p2*10;
$p3P=$p3*10;
$p4P=$p4*10;
$p1D=$p1/10;
$p2D=$p2/10;
$p3D=$p3/10;
$p4D=$p4/10;
$Obs1=500*$p1D;
$Obs2=500*$p2D;
$Obs3=500*$p3D;
$Obs4=500*$p4D;
$Expected=500*0.25;@
qu.1.2.uid=47b1ba56-4dd4-4874-802d-6f543e03bb25@
qu.1.2.info=  Course=Introductory Statistics;
  Topic=Goodness-of-Fit Tests;
  Author=Lorna Deeth;
  Difficulty=Easy;
  Features=None;
  Type=Calculation;
@
qu.1.2.weighting=1,1,1,1,1@
qu.1.2.numbering=alpha@
qu.1.2.part.1.name=sro_id_1@
qu.1.2.part.1.answer.units=@
qu.1.2.part.1.numStyle=   @
qu.1.2.part.1.editing=useHTML@
qu.1.2.part.1.showUnits=false@
qu.1.2.part.1.question=(Unset)@
qu.1.2.part.1.mode=Numeric@
qu.1.2.part.1.grading=exact_value@
qu.1.2.part.1.negStyle=both@
qu.1.2.part.1.answer.num=$Obs1@
qu.1.2.part.2.name=sro_id_2@
qu.1.2.part.2.answer.units=@
qu.1.2.part.2.numStyle=   @
qu.1.2.part.2.editing=useHTML@
qu.1.2.part.2.showUnits=false@
qu.1.2.part.2.question=(Unset)@
qu.1.2.part.2.mode=Numeric@
qu.1.2.part.2.grading=exact_value@
qu.1.2.part.2.negStyle=both@
qu.1.2.part.2.answer.num=$Obs2@
qu.1.2.part.3.name=sro_id_3@
qu.1.2.part.3.answer.units=@
qu.1.2.part.3.numStyle=   @
qu.1.2.part.3.editing=useHTML@
qu.1.2.part.3.showUnits=false@
qu.1.2.part.3.question=(Unset)@
qu.1.2.part.3.mode=Numeric@
qu.1.2.part.3.grading=exact_value@
qu.1.2.part.3.negStyle=both@
qu.1.2.part.3.answer.num=$Obs3@
qu.1.2.part.4.name=sro_id_4@
qu.1.2.part.4.answer.units=@
qu.1.2.part.4.numStyle=   @
qu.1.2.part.4.editing=useHTML@
qu.1.2.part.4.showUnits=false@
qu.1.2.part.4.question=(Unset)@
qu.1.2.part.4.mode=Numeric@
qu.1.2.part.4.grading=exact_value@
qu.1.2.part.4.negStyle=both@
qu.1.2.part.4.answer.num=$Obs4@
qu.1.2.part.5.name=sro_id_5@
qu.1.2.part.5.answer.units=@
qu.1.2.part.5.numStyle=   @
qu.1.2.part.5.editing=useHTML@
qu.1.2.part.5.showUnits=false@
qu.1.2.part.5.question=(Unset)@
qu.1.2.part.5.mode=Numeric@
qu.1.2.part.5.grading=exact_value@
qu.1.2.part.5.negStyle=both@
qu.1.2.part.5.answer.num=125@
qu.1.2.question=<p>Suppose there is a random sample of 500 observations, divided into four groups.&nbsp; It is seen that Group 1 contains $p1P % of the observations, Group 2 contains $p2P % of the observations, Group 3 contains $p3P % of the observations, and Group 4 contains $p4P % of the observations.</p><p>&nbsp;</p><p>a)&nbsp; What are the observed <strong>counts</strong> of observations in each of the 4 groups?</p><p>&nbsp;</p><p>Group 1:&nbsp;<span>&nbsp;</span><1><span>&nbsp;</span></p><p><span>Group 2:&nbsp;<span>&nbsp;</span><2><span>&nbsp;</span></span></p><p><span><span>Group 3:&nbsp;<span>&nbsp;</span><3><span>&nbsp;</span></span></span></p><p><span><span><span>Group 4:&nbsp;<span>&nbsp;</span><4><span>&nbsp;</span></span></span></span></p><p>&nbsp;</p><p>&nbsp;</p><p><span><span><span><span>b)&nbsp; What is the expected count for each of the groups, if it is hypothesized that there is an equal percent of the observations in each group?</span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span>Expected:&nbsp;<span>&nbsp;</span><5><span>&nbsp;</span></span></span></span></span></p>@

qu.1.3.mode=Inline@
qu.1.3.name=Calculate test statistic, conclusion@
qu.1.3.comment=<p>a)&nbsp; The test statistic is given by the formula <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi mathcolor='#800080'>i</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>1</mn></mrow><mrow><mn>4</mn></mrow></munderover><mrow><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><msub><mi mathvariant='normal'>O</mi><mrow><mi>i</mi></mrow></msub><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><msub><mi>E</mi><mrow><mi>i</mi></mrow></msub></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><msub><mi>E</mi><mrow><mi>i</mi></mrow></msub></mrow></mfrac></mrow></mrow></mstyle></math>.&nbsp; Substituting in the values, we get <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs1</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp1</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><mi>$Exp1</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs2</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp2</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><mi>$Exp2</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs3</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp3</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><mi>$Exp3</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$ChiTest</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>b)&nbsp; The p-value the area under a <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>&nbsp;distribution, with 2 degrees of freedom, to the right of the test statistic.&nbsp; Using computer software, we can find the exact p-value to be $pvalue.&nbsp; Therefore, at the 5% level of significance, there is insufficient evidence to reject the null hypothesis.</p>@
qu.1.3.editing=useHTML@
qu.1.3.solution=@
qu.1.3.algorithm=$n=switch(rint(3), 100, 200, 300);
$p1=rand(0.45, 0.55, 2);
$p2=rand(0.15, 0.25, 2);
$p3=1-($p1+$p2);
$Obs1=$n*$p1;
$Obs2=$n*$p2;
$Obs3=$n*$p3;
$Exp1=$n*0.5;
$Exp2=$n*0.2;
$Exp3=$n*0.3;
$ChiTest=(($Obs1-$Exp1)^2/$Exp1)+(($Obs2-$Exp2)^2/$Exp2)+(($Obs3-$Exp3)^2/$Exp3);
$Chi=numfmt("#.00000", $ChiTest);
$LowerTail=maple("
X:=Statistics[CDF](ChiSquare(2),$ChiTest):
X
");
$pvalue=1-$LowerTail;
condition:gt($pvalue,0.50);@
qu.1.3.uid=f5800375-5b85-48bf-96f5-498a99236bca@
qu.1.3.info=  Course=Introductory Statistics;
  Topic=Goodness-of-Fit Tests;
  Author=Lorna Deeth;
  Difficulty=Hard;
  Features=None;
  Type=Calculation;
@
qu.1.3.weighting=1,1@
qu.1.3.numbering=alpha@
qu.1.3.part.1.name=sro_id_1@
qu.1.3.part.1.answer.units=@
qu.1.3.part.1.numStyle=   @
qu.1.3.part.1.editing=useHTML@
qu.1.3.part.1.showUnits=false@
qu.1.3.part.1.err=0.01@
qu.1.3.part.1.question=(Unset)@
qu.1.3.part.1.mode=Numeric@
qu.1.3.part.1.grading=toler_abs@
qu.1.3.part.1.negStyle=both@
qu.1.3.part.1.answer.num=$ChiTest@
qu.1.3.part.2.name=sro_id_2@
qu.1.3.part.2.editing=useHTML@
qu.1.3.part.2.fixed=@
qu.1.3.part.2.question=null@
qu.1.3.part.2.choice.2=There is no significant evidence against the null hypothesis, and therefore there is no significant&nbsp;evidence that any of the proportions is not correct.@
qu.1.3.part.2.choice.1=There is very strong evidence against the null hypothesis, and therefore it is rejected in favour of the alternative hypothesis that&nbsp;at least one proportion is not correct.@
qu.1.3.part.2.mode=Multiple Choice@
qu.1.3.part.2.display=vertical@
qu.1.3.part.2.answer=2@
qu.1.3.question=<p>Suppose there is a random sample of&nbsp;$n observations, divided into&nbsp;three groups.&nbsp; The table below summarizes the count of observations that were seen in each group.</p><p>&nbsp;</p><p><table border="1" cellspacing="1" cellpadding="1" width="300" align="center">    <tbody>        <tr>            <td>            <p align="center"><strong>Group 1</strong></p>            </td>            <td>            <p align="center"><strong>Group 2</strong></p>            </td>            <td>            <p align="center"><strong>Group 3</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center">$Obs1</p>            </td>            <td>            <p align="center">$Obs2</p>            </td>            <td>            <p align="center">$Obs3</p>            </td>        </tr>    </tbody></table></p><p>&nbsp;</p><p>We are interested in testing the null hypothesis <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>H</mi><mrow><mn>0</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&colon;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><msub><mi>p</mi><mrow><mn>1</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0.5</mn><mo separator='true' lspace='0.0em' rspace='0.3333333em'>&comma;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><msub><mi>p</mi><mrow><mn>2</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0.2</mn><mo separator='true' lspace='0.0em' rspace='0.3333333em'>&comma;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><msub><mi>p</mi><mrow><mn>3</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0.3</mn></mrow></mstyle></math>, against the alternative hypothesis <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>H</mi><mrow><mi>A</mi></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&colon;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>At</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>least</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>one</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>proportion</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>is</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>incorrect</mi></mrow></mstyle></math>.</p><p>&nbsp;</p><p><span><span><span><span><span>a)&nbsp; What is the value of the test statistic?</span></span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span><span>Round your response to at least 2 decimal places.</span></span></span></span></span></p><p><span><span><span><span><span><span>&nbsp;</span><1><span>&nbsp;</span>&nbsp;</span></span></span></span></span></p><p>&nbsp;</p><p>&nbsp;</p><p><span><span><span><span><span><span>b)&nbsp; What conclusion can be made at the 5% level of significance?</span></span></span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span><span><span><span>&nbsp;</span><2><span>&nbsp;</span></span></span></span></span></span></span></p>@

qu.1.4.mode=Multiple Selection@
qu.1.4.name=Definitions 1: Goodness-of-Fit Tests@
qu.1.4.comment=@
qu.1.4.editing=useHTML@
qu.1.4.solution=@
qu.1.4.algorithm=@
qu.1.4.uid=23a88d8f-9747-4601-b152-db9e527e4d61@
qu.1.4.info=  Course=Introductory Statistics;
  Topic=Goodness-of-Fit Tests;
  Author=Lorna Deeth;
  Difficulty=Medium;
  Features=None;
  Type=Concept;
@
qu.1.4.question=<p>Which of the following statements are true?</p>
<p>&nbsp;</p>
<p>Note that there may be more than one correct answer; select all that are true.</p>@
qu.1.4.answer=1, 2@
qu.1.4.choice.1=If the null hypothesis is false, then large differences between the observed and expected values may exist.@
qu.1.4.choice.2=To determine the expected frequency for each cell, we multiply the total number of observations by the probability of an observation being in that particular cell.@
qu.1.4.choice.3=In a goodness-of-fit test, the null hypothesis is that all of the hypothesized proportions are the same, against the alternative hypothesis that they are all different.@
qu.1.4.choice.4=The sum of the observed values in each of the cells can be greater than n, the total number of observations.@
qu.1.4.fixed=@

qu.1.5.mode=Inline@
qu.1.5.name=Definitions 1&2: Random selection of True/False@
qu.1.5.comment=@
qu.1.5.editing=useHTML@
qu.1.5.solution=@
qu.1.5.algorithm=$k1=rint(8);
$k2=rint(8);
$k3=rint(8);
$k4=rint(8);
$k5=rint(8);
$z=maple("S := $k1,$k2,$k3,$k4,$k5:
floor( nops({S})/nops([S]) )");
condition: $z;
$a=("'If the null hypothesis is false, then large differences between the observed and expected values may exist.'");
$b=("'To determine the expected frequency for each cell, we multiply the total number of observations by the probability of an observation being in that particular cell.'");
$c=("'In a one-way table, each observed value can fall into only one of the given classifications.'");
$d=("'The sum of the hypothesized probabilities must be equal to 1.'");
$e=("'In a goodness-of-fit test, the null hypothesis is that all of the hypothesized proportions are the same, against the alternate hypothesis that they are all different.'");
$f=("'For goodness-of-fit tests, if the chi-square test statistic is greater than 1 then there is significant evidence against the null hypothesis.'");
$g=("'If the null hypothesis is true, the chi-square test statistic will follow a chi-square distribution with k degrees of freedom, where k is the number of categories.'");
$h=("'The sum of the observed values in each of the cells can be greater than n, the total number of observations.'");
$Answers=["'True'","'True'","'True'","'True'","'False'","'False'","'False'","'False'"];
$Distractors=["'False'","'False'","'False'","'False'","'True'","'True'","'True'","'True'"];
$Q1=switch($k1, $a,$b,$c,$d,$e,$f,$g,$h);
$A1=switch($k1, $Answers);
$D1=switch($k1, $Distractors);
$Q2=switch($k2, $a,$b,$c,$d,$e,$f,$g,$h);
$A2=switch($k2, $Answers);
$D2=switch($k2, $Distractors);
$Q3=switch($k3, $a,$b,$c,$d,$e,$f,$g,$h);
$A3=switch($k3, $Answers);
$D3=switch($k3, $Distractors);
$Q4=switch($k4, $a,$b,$c,$d,$e,$f,$g,$h);
$A4=switch($k4, $Answers);
$D4=switch($k4, $Distractors);
$Q5=switch($k5, $a,$b,$c,$d,$e,$f,$g,$h);
$A5=switch($k5, $Answers);
$D5=switch($k5, $Distractors);@
qu.1.5.uid=d8df1618-d88e-4355-ae7b-86c622c70338@
qu.1.5.info=  Course=Introductory Statistics;
  Topic=Goodness-of-Fit Tests;
  Author=Lorna Deeth;
  Difficulty=Medium;
  Features=None;
  Type=Concept;
@
qu.1.5.weighting=1,1,1,1,1@
qu.1.5.numbering=alpha@
qu.1.5.part.1.grader=exact@
qu.1.5.part.1.name=sro_id_1@
qu.1.5.part.1.editing=useHTML@
qu.1.5.part.1.display.permute=true@
qu.1.5.part.1.question=(Unset)@
qu.1.5.part.1.answer.2=$D1@
qu.1.5.part.1.answer.1=$A1@
qu.1.5.part.1.mode=List@
qu.1.5.part.1.display=menu@
qu.1.5.part.1.credit.2=0.0@
qu.1.5.part.1.credit.1=1.0@
qu.1.5.part.2.grader=exact@
qu.1.5.part.2.name=sro_id_2@
qu.1.5.part.2.editing=useHTML@
qu.1.5.part.2.display.permute=true@
qu.1.5.part.2.question=(Unset)@
qu.1.5.part.2.answer.2=$D2@
qu.1.5.part.2.answer.1=$A2@
qu.1.5.part.2.mode=List@
qu.1.5.part.2.display=menu@
qu.1.5.part.2.credit.2=0.0@
qu.1.5.part.2.credit.1=1.0@
qu.1.5.part.3.grader=exact@
qu.1.5.part.3.name=sro_id_3@
qu.1.5.part.3.editing=useHTML@
qu.1.5.part.3.display.permute=true@
qu.1.5.part.3.question=(Unset)@
qu.1.5.part.3.answer.2=$D3@
qu.1.5.part.3.answer.1=$A3@
qu.1.5.part.3.mode=List@
qu.1.5.part.3.display=menu@
qu.1.5.part.3.credit.2=0.0@
qu.1.5.part.3.credit.1=1.0@
qu.1.5.part.4.grader=exact@
qu.1.5.part.4.name=sro_id_4@
qu.1.5.part.4.editing=useHTML@
qu.1.5.part.4.display.permute=true@
qu.1.5.part.4.question=(Unset)@
qu.1.5.part.4.answer.2=$D4@
qu.1.5.part.4.answer.1=$A4@
qu.1.5.part.4.mode=List@
qu.1.5.part.4.display=menu@
qu.1.5.part.4.credit.2=0.0@
qu.1.5.part.4.credit.1=1.0@
qu.1.5.part.5.grader=exact@
qu.1.5.part.5.name=sro_id_5@
qu.1.5.part.5.editing=useHTML@
qu.1.5.part.5.display.permute=true@
qu.1.5.part.5.question=(Unset)@
qu.1.5.part.5.answer.2=$D5@
qu.1.5.part.5.answer.1=$A5@
qu.1.5.part.5.mode=List@
qu.1.5.part.5.display=menu@
qu.1.5.part.5.credit.2=0.0@
qu.1.5.part.5.credit.1=1.0@
qu.1.5.question=<p>Identify each of the following statements as either true of false.</p><p>&nbsp;</p><p>a)&nbsp;<span>&nbsp;</span><1><span>&nbsp;</span> $Q1</p><p>&nbsp;</p><p>b)&nbsp;<span>&nbsp;</span><2><span>&nbsp;</span> $Q2</p><p>&nbsp;</p><p>c)&nbsp;<span>&nbsp;</span><3><span>&nbsp;</span> $Q3</p><p>&nbsp;</p><p>d)&nbsp;<span>&nbsp;</span><4><span>&nbsp;</span> $Q4</p><p>&nbsp;</p><p>e)&nbsp;<span>&nbsp;</span><5><span>&nbsp;</span> $Q5</p>@

qu.1.6.mode=Multiple Selection@
qu.1.6.name=Definitions 2: Goodness-of-Fit Tests@
qu.1.6.comment=@
qu.1.6.editing=useHTML@
qu.1.6.solution=@
qu.1.6.algorithm=@
qu.1.6.uid=083721e7-e783-4237-bb91-3146f2dfafc5@
qu.1.6.info=  Course=Introductory Statistics;
  Topic=Goodness-of-Fit Tests;
  Author=Lorna Deeth;
  Difficulty=Medium;
  Features=None;
  Type=Concept;
@
qu.1.6.question=<p>Which of the following statements are true?</p>
<p>&nbsp;</p>
<p>Note that there may be more than one correct answer; select all that are true.</p>@
qu.1.6.answer=1, 2@
qu.1.6.choice.1=In a one-way table, each observed value can fall into only one of the given classifications.@
qu.1.6.choice.2=The sum of the hypothesized probabilities must be equal to 1.@
qu.1.6.choice.3=For goodness-of-fit tests, if the  <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math> test statistic is greater than 1 then there is significant evidence against the null hypothesis.@
qu.1.6.choice.4=If the null hypothesis is true, the test statistic will follow a <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math> distribution with k degrees of freedom, where k is the number of categories.@
qu.1.6.fixed=@

qu.1.7.mode=Inline@
qu.1.7.name=Calculate expected count, test statistic, degrees of freedom and conclusion@
qu.1.7.comment=<p>a)&nbsp; If it is hypothesized there is an equal percentage of observations in each group, then with 4 groups we would expect to see 25 % of the observations in each group.&nbsp; Therefore, the expected count of observations in each group is 0.25 x&nbsp;$n = $Expected.</p>
<p>&nbsp;</p>
<p>b)&nbsp; The test statistic is given by the formula <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi mathcolor='#800080'>i</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>1</mn></mrow><mrow><mn>4</mn></mrow></munderover><mrow><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><msub><mi mathvariant='normal'>O</mi><mrow><mi>i</mi></mrow></msub><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><msub><mi>E</mi><mrow><mi>i</mi></mrow></msub></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><msub><mi>E</mi><mrow><mi>i</mi></mrow></msub></mrow></mfrac></mrow></mrow></mstyle></math>.&nbsp; Substituting in the values, we get <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs1</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Expected</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Expected</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs2</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Expected</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Expected</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs3</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Expected</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><mi>$Expected</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs4</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Expected</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Expected</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$ChiTest</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math></p>
<p>&nbsp;</p>
<p>c)&nbsp; The appropriate degrees of freedom for the test statistic is <em>(k - 1)</em>, where <em>k</em> is the number of groups.&nbsp; Therefore, the appropriate degrees of freedom is<em>&nbsp;4 - 1 = 3</em>.</p>
<p>&nbsp;</p>
<p>d)&nbsp; Since the <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>test statistic = $ChiTest is very large, at 3 degrees of freedom the p-value is very very small (close to 0).&nbsp; Therefore, there is strong evidence at the 5% level of significance that at least one of the proportions is not equal to 0.25.</p>@
qu.1.7.editing=useHTML@
qu.1.7.solution=@
qu.1.7.algorithm=$n=switch(rint(3), 400, 500, 600);
$p1=rint(1, 8);
$p2=rint(1, 9-$p1);
$p3=rint(1, 10-($p1 + $p2));
$p4=10-($p1+$p2+$p3);
$p1D=$p1/10;
$p2D=$p2/10;
$p3D=$p3/10;
$p4D=$p4/10;
$Obs1=$n*$p1D;
$Obs2=$n*$p2D;
$Obs3=$n*$p3D;
$Obs4=$n*$p4D;
$Expected=$n*0.25;
$ChiTest=(($Obs1-$Expected)^2/$Expected)+(($Obs2-$Expected)^2/$Expected)+(($Obs3-$Expected)^2/$Expected)+(($Obs4-$Expected)^2/$Expected);@
qu.1.7.uid=f5ef2dd8-8326-49e0-830d-38d3f06ca1a2@
qu.1.7.info=  Course=Introductory Statistics;
  Topic=Goodness-of-Fit Tests;
  Author=Lorna Deeth;
  Difficulty=Medium;
  Features=None;
  Type=Calculation;
@
qu.1.7.weighting=1,1,1,1@
qu.1.7.numbering=alpha@
qu.1.7.part.1.name=sro_id_1@
qu.1.7.part.1.answer.units=@
qu.1.7.part.1.numStyle=   @
qu.1.7.part.1.editing=useHTML@
qu.1.7.part.1.showUnits=false@
qu.1.7.part.1.question=(Unset)@
qu.1.7.part.1.mode=Numeric@
qu.1.7.part.1.grading=exact_value@
qu.1.7.part.1.negStyle=both@
qu.1.7.part.1.answer.num=$Expected@
qu.1.7.part.2.name=sro_id_2@
qu.1.7.part.2.answer.units=@
qu.1.7.part.2.numStyle=   @
qu.1.7.part.2.editing=useHTML@
qu.1.7.part.2.showUnits=false@
qu.1.7.part.2.err=0.01@
qu.1.7.part.2.question=(Unset)@
qu.1.7.part.2.mode=Numeric@
qu.1.7.part.2.grading=toler_abs@
qu.1.7.part.2.negStyle=both@
qu.1.7.part.2.answer.num=$ChiTest@
qu.1.7.part.3.name=sro_id_3@
qu.1.7.part.3.answer.units=@
qu.1.7.part.3.numStyle=   @
qu.1.7.part.3.editing=useHTML@
qu.1.7.part.3.showUnits=false@
qu.1.7.part.3.question=(Unset)@
qu.1.7.part.3.mode=Numeric@
qu.1.7.part.3.grading=exact_value@
qu.1.7.part.3.negStyle=both@
qu.1.7.part.3.answer.num=3@
qu.1.7.part.4.name=sro_id_4@
qu.1.7.part.4.editing=useHTML@
qu.1.7.part.4.fixed=@
qu.1.7.part.4.question=null@
qu.1.7.part.4.choice.2=There is no significant evidence against the null hypothesis, and therefore there is no significant&nbsp;evidence that any of the proportions is not equal to 0.25.@
qu.1.7.part.4.choice.1=There is very strong evidence against the null hypothesis, and therefore it is rejected in favour of the alternative hypothesis that&nbsp;at least one proportion is not equal to 0.25.@
qu.1.7.part.4.mode=Non Permuting Multiple Choice@
qu.1.7.part.4.display=vertical@
qu.1.7.part.4.answer=1@
qu.1.7.question=<p>Suppose there is a random sample of&nbsp;$n observations, divided into four groups.&nbsp; The table below summarizes the count of observations that were seen in each group.</p><p>&nbsp;</p><p><table border="1" cellspacing="1" cellpadding="1" width="300" align="center">    <tbody>        <tr>            <td>            <p align="center"><strong>Group 1</strong></p>            </td>            <td>            <p align="center"><strong>Group 2</strong></p>            </td>            <td>            <p align="center"><strong>Group 3</strong></p>            </td>            <td>            <p align="center"><strong>Group 4</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center">$Obs1</p>            </td>            <td>            <p align="center">$Obs2</p>            </td>            <td>            <p align="center">$Obs3</p>            </td>            <td>            <p align="center">$Obs4</p>            </td>        </tr>    </tbody></table></p><p>&nbsp;</p><p>We are interested in testing the null hypothesis <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>H</mi><mrow><mn>0</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&colon;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><msub><mi>p</mi><mrow><mn>1</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><msub><mi>p</mi><mrow><mn>2</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><msub><mi>p</mi><mrow><mn>3</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><msub><mi>p</mi><mrow><mn>4</mn></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0.25</mn></mrow></mstyle></math>, against the alternative hypothesis <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msub><mi>H</mi><mrow><mi>A</mi></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&colon;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>At</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>least</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>one</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>proportion</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>is</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>incorrect</mi></mrow></mstyle></math>.</p><p>&nbsp;</p><p>a<span><span><span><span>)&nbsp; What is the expected count for each of the groups?</span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span>Expected:&nbsp;<span>&nbsp;</span><1></span></span></span></span></p><p>&nbsp;</p><p>&nbsp;</p><p><span><span><span><span><span>b)&nbsp; What is the value of the test statistic?</span></span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span><span>Round your response to at least 2 decimal places.</span></span></span></span></span></p><p><span><span><span><span><span><span>&nbsp;</span><2><span>&nbsp;</span>&nbsp;</span></span></span></span></span></p><p>&nbsp;</p><p>&nbsp;</p><p><span><span><span><span><span>c)&nbsp; What are the appropriate degrees of freedom?</span></span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span><span><span>&nbsp;</span><3><span>&nbsp;</span></span></span></span></span></span></p><p>&nbsp;</p><p>&nbsp;</p><p><span><span><span><span><span><span>d)&nbsp; What conclusion can be made at the 5% level of significance?</span></span></span></span></span></span></p><p>&nbsp;</p><p><span><span><span><span><span><span><span>&nbsp;</span><4><span>&nbsp;</span></span></span></span></span></span></span></p>@

qu.2.topic=Contingency Tables@

qu.2.1.mode=Multiple Selection@
qu.2.1.name=Definitions 1: Contingency Tables@
qu.2.1.comment=@
qu.2.1.editing=useHTML@
qu.2.1.solution=@
qu.2.1.algorithm=@
qu.2.1.uid=91ab5950-3795-4675-8c4c-8df43a604980@
qu.2.1.info=  Course=Introductory Statistics;
  Topic=Contingency Tables;
  Author=Lorna Deeth;
  Difficulty=Medium;
  Features=None;
  Type=Concept;
@
qu.2.1.question=<p>Which of the following statements are true?</p>
<p>&nbsp;</p>
<p>Note that there may be more than one correct answer; select all that are true.</p>@
qu.2.1.answer=1, 2@
qu.2.1.choice.1=A very large <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math> test statistic suggests that there is evidence against the null hypothesis.@
qu.2.1.choice.2=If you had a two-way table with 15 rows and 20 columns, the appropriate degrees of freedom for the <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math> distribution would be 266.@
qu.2.1.choice.3=In hypothesis testing on a two-way table, the null hypothesis is that the two factors are in some way related.@
qu.2.1.choice.4=In order for the inference procedures for a two-way table to be valid, the population from which the sample is drawn must be normally distributed.@
qu.2.1.fixed=@

qu.2.2.mode=Inline@
qu.2.2.name=Calculate degrees of freedom, test statistic, conclusion@
qu.2.2.comment=<p>a)&nbsp; The degrees of freedom for a contingency table are given by <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>df</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mo fence='true' lspace='0.1666667em' rspace='0.1666667em' stretchy='true'>&lpar;</mo><mo lspace='0.0em' rspace='0.0em'>&num;</mo><mi> rows - 1) X (# columns - 1)</mi></mrow></mstyle></math>.&nbsp; In this case, as there are 2 rows and 3 columns, the degrees of freedom for the <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>statistic are <em>1 X 2 = 2.</em></p>
<p>&nbsp;</p>
<p>b)&nbsp; To find the test statistic, we first need to find the expected counts.&nbsp;&nbsp;Using the formula <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>Expected</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Count</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mfrac><mrow><mi>Row</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Total</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>X</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Column</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Total</mi></mrow><mrow><mi>Overall</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Total</mi></mrow></mfrac></mrow></mstyle></math>, we get:&nbsp;</p>
<p>
<table border="1" cellspacing="1" cellpadding="1" width="400" align="center">
    <tbody>
        <tr>
            <td>&nbsp;</td>
            <td colspan="5">
            <p align="center"><strong>Factor A</strong></p>
            </td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Factor B</strong></p>
            </td>
            <td colspan="3">
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 3</strong></p>
            </td>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td colspan="3"><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row123</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col14</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp1</mi></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math></td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row123</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col25</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp2</mi></mrow></mstyle></math></td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row123</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col36</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp3</mi></mrow></mstyle></math></td>
            <td>$Row123</td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td colspan="3"><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row456</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col14</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp4</mi></mrow></mstyle></math></td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row456</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col25</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp5</mi></mrow></mstyle></math></td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row456</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col36</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp6</mi></mrow></mstyle></math></td>
            <td>$Row456</td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
            <td colspan="3">$Col14</td>
            <td>$Col25</td>
            <td>$Col36</td>
            <td>$n</td>
        </tr>
    </tbody>
</table>
</p>
<p>&nbsp;The test statistic is given by the general&nbsp;formula <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi mathcolor='#800080'>i</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>1</mn></mrow><mrow><mi>n</mi></mrow></munderover><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><msub><mi>Observed</mi><mrow><mi>i</mi></mrow></msub><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><msub><mi>Expected</mi><mrow><mi>i</mi></mrow></msub></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><msub><mi>Expected</mi><mrow><mi>i</mi></mrow></msub></mrow></mfrac></mrow></mstyle></math>.&nbsp; Substituting in the appropriate values, we get <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs1</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp1</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp1</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs2</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp2</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp2</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs3</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp3</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp3</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs4</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp4</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp4</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs5</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp5</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp5</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs6</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp6</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp6</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$ChiTest</mi></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math>.</p>
<p>&nbsp;</p>
<p>c)&nbsp; Recall that the null hypothesis is that the two factors are independent of each other, versus the alternate that the two factors are not independent (i.e. they are dependent).&nbsp; In order to determine whether or not the null hypothesis is rejected at the 5% level of significance, we need to calculate the p-value.&nbsp; In a <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>&nbsp;test for independence, the p-value is the area under the <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>distribution with&nbsp;2 degrees of freedom,&nbsp;to the right of the test statistic.&nbsp; Using computer software, we can find the exact p-value to be $pvalue.&nbsp; Since the p-value is&nbsp;greater than <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>&alpha;</mi><mo mathvariant='italic' lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn mathvariant='italic'>0.05</mn></mrow></mstyle></math>, there is insufficient evidence to reject the null hypothesis, at the 5% level of significance.</p>@
qu.2.2.editing=useHTML@
qu.2.2.solution=@
qu.2.2.algorithm=$Obs1=range(10,15);
$Obs2=range(25,30);
$Obs3=range(30,35);
$Obs4=range(30,35);
$Obs5=range(40,45);
$Obs6=range(45,50);
$n=$Obs1+$Obs2+$Obs3+$Obs4+$Obs5+$Obs6;
$Row123=$Obs1+$Obs2+$Obs3;
$Row456=$Obs4+$Obs5+$Obs6;
$Col14=$Obs1+$Obs4;
$Col25=$Obs2+$Obs5;
$Col36=$Obs3+$Obs6;
$Exp1=$Row123*$Col14/$n;
$Exp2=$Row123*$Col25/$n;
$Exp3=$Row123*$Col36/$n;
$Exp4=$Row456*$Col14/$n;
$Exp5=$Row456*$Col25/$n;
$Exp6=$Row456*$Col36/$n;
$ChiTest=(($Obs1-$Exp1)^2/$Exp1)+(($Obs2-$Exp2)^2/$Exp2)+(($Obs3-$Exp3)^2/$Exp3)+(($Obs4-$Exp4)^2/$Exp4)+(($Obs5-$Exp5)^2/$Exp5)+(($Obs6-$Exp6)^2/$Exp6);
$Tail=maple("
X:=Statistics[CDF](ChiSquare(2), $ChiTest):
X
");
$pvalue=1-$Tail;
condition:gt($pvalue,0.10);@
qu.2.2.uid=ce155e70-625e-4f74-b6a0-e75b4bf94df7@
qu.2.2.info=  Course=Introductory Statistics;
  Topic=Contingency Tables;
  Author=Lorna Deeth;
  Difficulty=Hard;
  Features=None;
  Type=Calculation;
@
qu.2.2.weighting=1,1,1@
qu.2.2.numbering=alpha@
qu.2.2.part.1.name=sro_id_1@
qu.2.2.part.1.editing=useHTML@
qu.2.2.part.1.fixed=@
qu.2.2.part.1.choice.4=6&nbsp;degrees of freedom@
qu.2.2.part.1.question=null@
qu.2.2.part.1.choice.3=4&nbsp;degrees of freedom@
qu.2.2.part.1.choice.2=2 degrees of freedom@
qu.2.2.part.1.choice.1=1 degree of freedom@
qu.2.2.part.1.mode=Non Permuting Multiple Choice@
qu.2.2.part.1.display=vertical@
qu.2.2.part.1.answer=2@
qu.2.2.part.2.name=sro_id_2@
qu.2.2.part.2.answer.units=@
qu.2.2.part.2.numStyle=   @
qu.2.2.part.2.editing=useHTML@
qu.2.2.part.2.showUnits=false@
qu.2.2.part.2.err=0.1@
qu.2.2.part.2.question=(Unset)@
qu.2.2.part.2.mode=Numeric@
qu.2.2.part.2.grading=toler_abs@
qu.2.2.part.2.negStyle=both@
qu.2.2.part.2.answer.num=$ChiTest@
qu.2.2.part.3.name=sro_id_3@
qu.2.2.part.3.editing=useHTML@
qu.2.2.part.3.fixed=@
qu.2.2.part.3.question=null@
qu.2.2.part.3.choice.2=There is sufficient evidence to suggest that the two factors are not independent of each other.@
qu.2.2.part.3.choice.1=There is insufficient evidence to suggest that the two factors are not independent of each other.@
qu.2.2.part.3.mode=Multiple Choice@
qu.2.2.part.3.display=vertical@
qu.2.2.part.3.answer=1@
qu.2.2.question=<p>A random sample of&nbsp;$n observations&nbsp;is collected, and each&nbsp;observation&nbsp;is classified into one of the&nbsp;six possible categories seen in the table below, based on its response to some arbitrary factors A and B.</p><p>&nbsp;</p><p><table border="1" cellspacing="1" cellpadding="1" width="300" align="center">    <tbody>        <tr>            <td>            <p align="left">&nbsp;</p>            </td>            <td colspan="3">            <p align="center"><strong>Factor A</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Factor B</strong></p>            </td>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>            <td>            <p align="center"><strong>Level 3</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td>$Obs1</td>            <td>$Obs2</td>            <td>$Obs3</td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>            <td>$Obs4</td>            <td>$Obs5</td>            <td>$Obs6</td>        </tr>    </tbody></table></p><p>&nbsp;</p><p>We are interested in carrying out a hypothesis test on the independence of the two factors, at the 5% level of significance.</p><p>&nbsp;</p><p>&nbsp;</p><p>a)&nbsp; If the null hypothesis is true, what are the degrees of freedom for the <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>distribution?</p><p>&nbsp;</p><p><span>&nbsp;</span><1><span>&nbsp;</span>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>b)&nbsp; Calculate the value of the <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>&nbsp;test statistic.</p><p>&nbsp;</p><p>Round your response to at least 3 decimal places.</p><p><span>&nbsp;</span><2><span>&nbsp;</span></p><p>&nbsp;</p><p>&nbsp;</p><p><span>c)&nbsp; What&nbsp;conclusion can be made regarding the independence of the factors, at the 5% level of significance?</span></p><p>&nbsp;</p><p><span><span>&nbsp;</span><3><span>&nbsp;</span></span></p>@

qu.2.3.mode=Inline@
qu.2.3.name=Definitions 1&2: Random selection of True/False@
qu.2.3.comment=@
qu.2.3.editing=useHTML@
qu.2.3.solution=@
qu.2.3.algorithm=$k1=rint(8);
$k2=rint(8);
$k3=rint(8);
$k4=rint(8);
$k5=rint(8);
$z=maple("S := $k1,$k2,$k3,$k4,$k5:
floor( nops({S})/nops([S]) )");
condition: $z;
$a=("'A very large chi-square test statistic suggests that there is evidence against the null hypothesis.'");
$b=("'If you had a two-way table with 15 rows and 20 columns, the appropriate degrees of freedom for the chi-Square distribution would be 266.'");
$c=("'Using a chi-square distribution for hypothesis testing on count data is most reliable when the sample size is large.'");
$d=("'The expected count for each cell in a two-way table can never be less than 0.'");
$e=("'In hypothesis testing on a two-way table, the null hypothesis is that the two factors are in some way related.'");
$f=("'In order for the inference procedures for a two-way table to be valid, the population from which the sample is drawn must be normally distributed.'");
$g=("'In a two-way table, the number of rows must be less than or equal to the number of columns.'");
$h=("'For hypothesis testing on a two-way table, the p-value is calculated as the area to the right of the test statistic, multiplied by 2.'");
$Answers=["'True'","'True'","'True'","'True'","'False'","'False'","'False'","'False'"];
$Distractors=["'False'","'False'","'False'","'False'","'True'","'True'","'True'","'True'"];
$Q1=switch($k1, $a,$b,$c,$d,$e,$f,$g,$h);
$A1=switch($k1, $Answers);
$D1=switch($k1, $Distractors);
$Q2=switch($k2, $a,$b,$c,$d,$e,$f,$g,$h);
$A2=switch($k2, $Answers);
$D2=switch($k2, $Distractors);
$Q3=switch($k3, $a,$b,$c,$d,$e,$f,$g,$h);
$A3=switch($k3, $Answers);
$D3=switch($k3, $Distractors);
$Q4=switch($k4, $a,$b,$c,$d,$e,$f,$g,$h);
$A4=switch($k4, $Answers);
$D4=switch($k4, $Distractors);
$Q5=switch($k5, $a,$b,$c,$d,$e,$f,$g,$h);
$A5=switch($k5, $Answers);
$D5=switch($k5, $Distractors);@
qu.2.3.uid=e01370f5-57c3-4269-a321-fb33f988809f@
qu.2.3.info=  Course=Introductory Statistics;
  Topic=Contingency Tables;
  Author=Lorna Deeth;
  Difficulty=Medium;
  Features=None;
  Type=Concept;
@
qu.2.3.weighting=1,1,1,1,1@
qu.2.3.numbering=alpha@
qu.2.3.part.1.grader=exact@
qu.2.3.part.1.name=sro_id_1@
qu.2.3.part.1.editing=useHTML@
qu.2.3.part.1.display.permute=true@
qu.2.3.part.1.question=(Unset)@
qu.2.3.part.1.answer.2=$D1@
qu.2.3.part.1.answer.1=$A1@
qu.2.3.part.1.mode=List@
qu.2.3.part.1.display=menu@
qu.2.3.part.1.credit.2=0.0@
qu.2.3.part.1.credit.1=1.0@
qu.2.3.part.2.grader=exact@
qu.2.3.part.2.name=sro_id_2@
qu.2.3.part.2.editing=useHTML@
qu.2.3.part.2.display.permute=true@
qu.2.3.part.2.question=(Unset)@
qu.2.3.part.2.answer.2=$D2@
qu.2.3.part.2.answer.1=$A2@
qu.2.3.part.2.mode=List@
qu.2.3.part.2.display=menu@
qu.2.3.part.2.credit.2=0.0@
qu.2.3.part.2.credit.1=1.0@
qu.2.3.part.3.grader=exact@
qu.2.3.part.3.name=sro_id_3@
qu.2.3.part.3.editing=useHTML@
qu.2.3.part.3.display.permute=true@
qu.2.3.part.3.question=(Unset)@
qu.2.3.part.3.answer.2=$D3@
qu.2.3.part.3.answer.1=$A3@
qu.2.3.part.3.mode=List@
qu.2.3.part.3.display=menu@
qu.2.3.part.3.credit.2=0.0@
qu.2.3.part.3.credit.1=1.0@
qu.2.3.part.4.grader=exact@
qu.2.3.part.4.name=sro_id_4@
qu.2.3.part.4.editing=useHTML@
qu.2.3.part.4.display.permute=true@
qu.2.3.part.4.question=(Unset)@
qu.2.3.part.4.answer.2=$D4@
qu.2.3.part.4.answer.1=$A4@
qu.2.3.part.4.mode=List@
qu.2.3.part.4.display=menu@
qu.2.3.part.4.credit.2=0.0@
qu.2.3.part.4.credit.1=1.0@
qu.2.3.part.5.grader=exact@
qu.2.3.part.5.name=sro_id_5@
qu.2.3.part.5.editing=useHTML@
qu.2.3.part.5.display.permute=true@
qu.2.3.part.5.question=(Unset)@
qu.2.3.part.5.answer.2=$D5@
qu.2.3.part.5.answer.1=$A5@
qu.2.3.part.5.mode=List@
qu.2.3.part.5.display=menu@
qu.2.3.part.5.credit.2=0.0@
qu.2.3.part.5.credit.1=1.0@
qu.2.3.question=<p>Identify each of the following statements as either true or false.</p><p>&nbsp;</p><p>a)&nbsp;<span>&nbsp;</span><1><span>&nbsp;</span> $Q1</p><p>&nbsp;</p><p>b)&nbsp;<span>&nbsp;</span><2><span>&nbsp;</span> $Q2</p><p>&nbsp;</p><p>c)&nbsp;<span>&nbsp;</span><3><span>&nbsp;</span> $Q3</p><p>&nbsp;</p><p>d)&nbsp;<span>&nbsp;</span><4><span>&nbsp;</span> $Q4</p><p>&nbsp;</p><p>e)&nbsp;<span>&nbsp;</span><5><span>&nbsp;</span> $Q5</p>@

qu.2.4.mode=Multiple Selection@
qu.2.4.name=Definitions 2: Contingency Tables@
qu.2.4.comment=@
qu.2.4.editing=useHTML@
qu.2.4.solution=@
qu.2.4.algorithm=@
qu.2.4.uid=4c9a5762-8a18-4f3c-a765-d8960d15fc46@
qu.2.4.info=  Course=Introductory Statistics;
  Topic=Contingency Tables;
  Author=Lorna Deeth;
  Difficulty=Medium;
  Features=None;
  Type=Concept;
@
qu.2.4.question=<p>Which of the following statements are true?</p>
<p>&nbsp;</p>
<p>Note that there may be more than one correct answer; select all that are true.</p>@
qu.2.4.answer=1, 2@
qu.2.4.choice.1=Using a  <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math> distribution for hypothesis testing on count data is most reliable when the sample size is large.@
qu.2.4.choice.2=The expected count for each cell in a two-way table can never be less than 0.@
qu.2.4.choice.3=In a two-way table, the number of rows must be less than or equal to the number of columns.@
qu.2.4.choice.4=For hypothesis testing on a two-way table, the p-value is calculated as the area to the right of the test statistic, multiplied by 2.@
qu.2.4.fixed=@

qu.2.5.mode=Inline@
qu.2.5.name=Calculate expected values, test statistic, conclusion@
qu.2.5.comment=<p>a)&nbsp; To find the expected counts, we need to use the formula <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>Expected</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Count</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mfrac><mrow><mi>Row</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Total</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>X</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Column</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Total</mi></mrow><mrow><mi>Overall</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Total</mi></mrow></mfrac></mrow></mstyle></math>.&nbsp; Completing the given table to include row and column totals, we get:</p>
<p>&nbsp;</p>
<p>
<table border="1" cellspacing="1" cellpadding="1" width="300" align="center">
    <tbody>
        <tr>
            <td>&nbsp;</td>
            <td colspan="2">
            <p align="center"><strong>Factor A</strong></p>
            </td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Factor B</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td>
            <p align="center">$Obs1</p>
            </td>
            <td>
            <p align="center">$Obs2</p>
            </td>
            <td>
            <p align="center">$Row12</p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td>
            <p align="center">$Obs3</p>
            </td>
            <td>
            <p align="center">$Obs4</p>
            </td>
            <td>
            <p align="center">$Row34</p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
            <td>
            <p align="center">$Col13</p>
            </td>
            <td>
            <p align="center">$Col24</p>
            </td>
            <td>
            <p align="center">$n</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>&nbsp;</p>
<p>Using the above formula, we can determine the expected frequency in each cell of the table:</p>
<p>&nbsp;</p>
<p>
<table border="1" cellspacing="1" cellpadding="1" width="400" align="center">
    <tbody>
        <tr>
            <td>&nbsp;</td>
            <td colspan="2">
            <p align="center"><strong>Factor A</strong></p>
            </td>
            <td>
            <p align="center">&nbsp;</p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Factor B</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row12</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col13</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp1</mi></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math></td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row12</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col24</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp2</mi></mrow></mstyle></math></td>
            <td>$Row12</td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row34</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col13</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp3</mi></mrow></mstyle></math></td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row34</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col24</mi></mrow><mrow><mi>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp4</mi></mrow></mstyle></math></td>
            <td>$Row34</td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
            <td>$Col13</td>
            <td>$Col24</td>
            <td>$n</td>
        </tr>
    </tbody>
</table>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>b)&nbsp; The test statistic is given by the general&nbsp;formula <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi mathcolor='#800080'>i</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>1</mn></mrow><mrow><mi>n</mi></mrow></munderover><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><msub><mi>Observed</mi><mrow><mi>i</mi></mrow></msub><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><msub><mi>Expected</mi><mrow><mi>i</mi></mrow></msub></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><msub><mi>Expected</mi><mrow><mi>i</mi></mrow></msub></mrow></mfrac></mrow></mstyle></math>.&nbsp; Substituting in the appropriate values, we get <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs1</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp1</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp1</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs2</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp2</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp2</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs3</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp3</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp3</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>$Obs4</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$Exp4</mi></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><mi>$Exp4</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$ChiTest</mi></mrow></mstyle></math>.</p>
<p>&nbsp;</p>
<p>c)&nbsp; In order to determine whether or not the null hypothesis is rejected at the 10% level of significance, we need to calculate the p-value.&nbsp; In a <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>&nbsp;test for independence, the p-value is the area under the <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>distribution with <em>(2-1) X (2-1) =&nbsp;1</em> degree of freedom,&nbsp;to the right of the test statistic.&nbsp; Using computer software, we can find the exact p-value to be $pvalue.&nbsp; Since the p-value is less than <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>&alpha;</mi><mo mathvariant='italic' lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn mathvariant='italic'>0.10</mn></mrow></mstyle></math>, there is sufficient evidence to reject the null hypothesis at the 10% level of significance.</p>@
qu.2.5.editing=useHTML@
qu.2.5.solution=@
qu.2.5.algorithm=$Obs1=range(10,15);
$Obs2=range(25,30);
$Obs3=range(30,35);
$Obs4=range(30,35);
$n=$Obs1+$Obs2+$Obs3+$Obs4;
$Row12=$Obs1+$Obs2;
$Row34=$Obs3+$Obs4;
$Col13=$Obs1+$Obs3;
$Col24=$Obs2+$Obs4;
$Exp1=$Row12*$Col13/$n;
$Exp2=$Row12*$Col24/$n;
$Exp3=$Row34*$Col13/$n;
$Exp4=$Row34*$Col24/$n;
$ChiTest=(($Obs1-$Exp1)^2/$Exp1)+(($Obs2-$Exp2)^2/$Exp2)+(($Obs3-$Exp3)^2/$Exp3)+(($Obs4-$Exp4)^2/$Exp4);
$Tail=maple("
X:=Statistics[CDF](ChiSquare(1), $ChiTest):
X
");
$pvalue=1-$Tail;
condition:lt($pvalue,0.10);@
qu.2.5.uid=591fd9df-0279-41b0-8273-fb8c80382398@
qu.2.5.info=  Course=Introductory Statistics;
  Topic=Contingency Tables;
  Author=Lorna Deeth;
  Difficulty=Medium;
  Features=None;
  Type=Calculation;
@
qu.2.5.weighting=1,1,1,1,1,1@
qu.2.5.numbering=alpha@
qu.2.5.part.1.name=sro_id_1@
qu.2.5.part.1.answer.units=@
qu.2.5.part.1.numStyle=   @
qu.2.5.part.1.editing=useHTML@
qu.2.5.part.1.showUnits=false@
qu.2.5.part.1.err=0.01@
qu.2.5.part.1.question=(Unset)@
qu.2.5.part.1.mode=Numeric@
qu.2.5.part.1.grading=toler_abs@
qu.2.5.part.1.negStyle=both@
qu.2.5.part.1.answer.num=$Exp1@
qu.2.5.part.2.name=sro_id_2@
qu.2.5.part.2.answer.units=@
qu.2.5.part.2.numStyle=   @
qu.2.5.part.2.editing=useHTML@
qu.2.5.part.2.showUnits=false@
qu.2.5.part.2.err=0.01@
qu.2.5.part.2.question=(Unset)@
qu.2.5.part.2.mode=Numeric@
qu.2.5.part.2.grading=toler_abs@
qu.2.5.part.2.negStyle=both@
qu.2.5.part.2.answer.num=$Exp2@
qu.2.5.part.3.name=sro_id_3@
qu.2.5.part.3.answer.units=@
qu.2.5.part.3.numStyle=   @
qu.2.5.part.3.editing=useHTML@
qu.2.5.part.3.showUnits=false@
qu.2.5.part.3.err=0.01@
qu.2.5.part.3.question=(Unset)@
qu.2.5.part.3.mode=Numeric@
qu.2.5.part.3.grading=toler_abs@
qu.2.5.part.3.negStyle=both@
qu.2.5.part.3.answer.num=$Exp3@
qu.2.5.part.4.name=sro_id_4@
qu.2.5.part.4.answer.units=@
qu.2.5.part.4.numStyle=   @
qu.2.5.part.4.editing=useHTML@
qu.2.5.part.4.showUnits=false@
qu.2.5.part.4.err=0.01@
qu.2.5.part.4.question=(Unset)@
qu.2.5.part.4.mode=Numeric@
qu.2.5.part.4.grading=toler_abs@
qu.2.5.part.4.negStyle=both@
qu.2.5.part.4.answer.num=$Exp4@
qu.2.5.part.5.name=sro_id_5@
qu.2.5.part.5.answer.units=@
qu.2.5.part.5.numStyle=   @
qu.2.5.part.5.editing=useHTML@
qu.2.5.part.5.showUnits=false@
qu.2.5.part.5.err=0.1@
qu.2.5.part.5.question=(Unset)@
qu.2.5.part.5.mode=Numeric@
qu.2.5.part.5.grading=toler_abs@
qu.2.5.part.5.negStyle=both@
qu.2.5.part.5.answer.num=$ChiTest@
qu.2.5.part.6.name=sro_id_6@
qu.2.5.part.6.editing=useHTML@
qu.2.5.part.6.fixed=@
qu.2.5.part.6.question=null@
qu.2.5.part.6.choice.2=There is insufficient evidence to reject the null hypothesis, at the 10% level of significance.@
qu.2.5.part.6.choice.1=There is sufficient evidence to reject the null hypothesis, at the 10% level of significance.@
qu.2.5.part.6.mode=Multiple Choice@
qu.2.5.part.6.display=vertical@
qu.2.5.part.6.answer=1@
qu.2.5.question=<p>A random sample of&nbsp;$n observations&nbsp;is collected, and each&nbsp;observation&nbsp;is classified into one of the four possible categories seen in the table below, based on each response to some arbitrary factors A and B.</p><p>&nbsp;</p><p><table border="1" cellspacing="1" cellpadding="1" width="300" align="center">    <tbody>        <tr>            <td>            <p align="center">&nbsp;</p>            </td>            <td colspan="2">            <p align="center"><strong>Factor A</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Factor B</strong></p>            </td>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td>            <p align="center">$Obs1</p>            </td>            <td>            <p align="center">$Obs2</p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>            <td>            <p align="center">$Obs3</p>            </td>            <td>            <p align="center">$Obs4</p>            </td>        </tr>    </tbody></table></p><p>&nbsp;</p><p>&nbsp;</p><p>a)&nbsp; Determine the <strong>expected</strong> number of observations for each cell.&nbsp; Fill them into the table below.</p><p>&nbsp;</p><p>Round each of your values to&nbsp;at least 3 decimal places before entering them into the table.</p><p>&nbsp;</p><p><table border="1" cellspacing="1" cellpadding="1" width="400" align="center">    <tbody>        <tr>            <td>&nbsp;</td>            <td colspan="2">            <p align="center"><strong>Factor A</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Factor B</strong></p>            </td>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td><span>&nbsp;<span>&nbsp;</span><1><span>&nbsp;</span></span></td>            <td><span>&nbsp;<span>&nbsp;</span><2><span>&nbsp;</span></span></td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>            <td><span>&nbsp;<span>&nbsp;</span><3><span>&nbsp;</span></span></td>            <td><span>&nbsp;<span>&nbsp;</span><4><span>&nbsp;</span></span></td>        </tr>    </tbody></table></p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>b)&nbsp; Calculate the value of the <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>&chi;</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math>&nbsp;test statistic.</p><p>&nbsp;</p><p>Round your response to at least 3 decimal places.</p><p><span>&nbsp;</span><5><span>&nbsp;</span></p><p>&nbsp;</p><p>&nbsp;</p><p><span>c)&nbsp; What is the appropriate conclusion that can be made, at the 10% level of significance?</span></p><p>&nbsp;</p><p><span><span>&nbsp;</span><6><span>&nbsp;</span></span></p>@

qu.2.6.mode=Inline@
qu.2.6.name=Calculate expected values for two-way table@
qu.2.6.comment=<p>To find the expected counts, we need to use the formula <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>Expected</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Count</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mfrac><mrow><mi>Row</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Total</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>X</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Column</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Total</mi></mrow><mrow><mi>Overall</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Total</mi></mrow></mfrac></mrow></mstyle></math>.&nbsp; Completing the given table to include row and column totals, we get:</p>
<p>&nbsp;</p>
<p>
<table border="1" cellspacing="1" cellpadding="1" width="300" align="center">
    <tbody>
        <tr>
            <td>&nbsp;</td>
            <td colspan="2">
            <p align="center"><strong>Factor A</strong></p>
            </td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Factor B</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td>
            <p align="center">$Obs1</p>
            </td>
            <td>
            <p align="center">$Obs2</p>
            </td>
            <td>
            <p align="center">$Row12</p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td>
            <p align="center">$Obs3</p>
            </td>
            <td>
            <p align="center">$Obs4</p>
            </td>
            <td>
            <p align="center">$Row34</p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
            <td>
            <p align="center">$Col13</p>
            </td>
            <td>
            <p align="center">$Col24</p>
            </td>
            <td>
            <p align="center">100</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p>&nbsp;</p>
<p>Using the above formula, we can determine the expected frequency in each cell of the table:</p>
<p>&nbsp;</p>
<p>
<table border="1" cellspacing="1" cellpadding="1" width="400" align="center">
    <tbody>
        <tr>
            <td>&nbsp;</td>
            <td colspan="2">
            <p align="center"><strong>Factor A</strong></p>
            </td>
            <td>
            <p align="center">&nbsp;</p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Factor B</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 1</strong></p>
            </td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row12</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col13</mi></mrow><mrow><mn>100</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp1</mi></mrow></mstyle></math></td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row12</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col24</mi></mrow><mrow><mn>100</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp2</mi></mrow></mstyle></math></td>
            <td>$Row12</td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Level 2</strong></p>
            </td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row34</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col13</mi></mrow><mrow><mn>100</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp3</mi></mrow></mstyle></math></td>
            <td><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>$Row34</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>$Col24</mi></mrow><mrow><mn>100</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$Exp4</mi></mrow></mstyle></math></td>
            <td>$Row34</td>
        </tr>
        <tr>
            <td>
            <p align="center"><strong>Total</strong></p>
            </td>
            <td>$Col13</td>
            <td>$Col24</td>
            <td>100</td>
        </tr>
    </tbody>
</table>
</p>
<p>&nbsp;</p>@
qu.2.6.editing=useHTML@
qu.2.6.solution=@
qu.2.6.algorithm=$Obs1=range(1,96);
$Obs2=range(1, 98-$Obs1);
$Obs3=range(1, 99-($Obs1+$Obs2));
$Obs4=100-($Obs1+$Obs2+$Obs3);
$Row12=$Obs1+$Obs2;
$Row34=$Obs3+$Obs4;
$Col13=$Obs1+$Obs3;
$Col24=$Obs2+$Obs4;
$Exp1=$Row12*$Col13/100;
$Exp2=$Row12*$Col24/100;
$Exp3=$Row34*$Col13/100;
$Exp4=$Row34*$Col24/100;@
qu.2.6.uid=3872b05c-5536-4557-9505-060d21c48514@
qu.2.6.info=  Course=Introductory Statistics;
  Topic=Contingency Tables;
  Author=Lorna Deeth;
  Difficulty=Easy;
  Features=None;
  Type=Calculation;
@
qu.2.6.weighting=1,1,1,1@
qu.2.6.numbering=alpha@
qu.2.6.part.1.name=sro_id_1@
qu.2.6.part.1.answer.units=@
qu.2.6.part.1.numStyle=   @
qu.2.6.part.1.editing=useHTML@
qu.2.6.part.1.showUnits=false@
qu.2.6.part.1.err=0.1@
qu.2.6.part.1.question=(Unset)@
qu.2.6.part.1.mode=Numeric@
qu.2.6.part.1.grading=toler_abs@
qu.2.6.part.1.negStyle=both@
qu.2.6.part.1.answer.num=$Exp1@
qu.2.6.part.2.name=sro_id_2@
qu.2.6.part.2.answer.units=@
qu.2.6.part.2.numStyle=   @
qu.2.6.part.2.editing=useHTML@
qu.2.6.part.2.showUnits=false@
qu.2.6.part.2.err=0.1@
qu.2.6.part.2.question=(Unset)@
qu.2.6.part.2.mode=Numeric@
qu.2.6.part.2.grading=toler_abs@
qu.2.6.part.2.negStyle=both@
qu.2.6.part.2.answer.num=$Exp2@
qu.2.6.part.3.name=sro_id_3@
qu.2.6.part.3.answer.units=@
qu.2.6.part.3.numStyle=   @
qu.2.6.part.3.editing=useHTML@
qu.2.6.part.3.showUnits=false@
qu.2.6.part.3.err=0.1@
qu.2.6.part.3.question=(Unset)@
qu.2.6.part.3.mode=Numeric@
qu.2.6.part.3.grading=toler_abs@
qu.2.6.part.3.negStyle=both@
qu.2.6.part.3.answer.num=$Exp3@
qu.2.6.part.4.name=sro_id_4@
qu.2.6.part.4.answer.units=@
qu.2.6.part.4.numStyle=   @
qu.2.6.part.4.editing=useHTML@
qu.2.6.part.4.showUnits=false@
qu.2.6.part.4.err=0.1@
qu.2.6.part.4.question=(Unset)@
qu.2.6.part.4.mode=Numeric@
qu.2.6.part.4.grading=toler_abs@
qu.2.6.part.4.negStyle=both@
qu.2.6.part.4.answer.num=$Exp4@
qu.2.6.question=<p>A random sample of 100 observations&nbsp;is collected, and each one&nbsp;is classified into one of the four possible categories seen in the table below, based on each observation's response to some arbitrary factors A and B.</p><p>&nbsp;</p><p><table border="1" cellspacing="1" cellpadding="1" width="300" align="center">    <tbody>        <tr>            <td>            <p align="center">&nbsp;</p>            </td>            <td colspan="2">            <p align="center"><strong>Factor A</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Factor B</strong></p>            </td>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td>            <p align="center">$Obs1</p>            </td>            <td>            <p align="center">$Obs2</p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>            <td>            <p align="center">$Obs3</p>            </td>            <td>            <p align="center">$Obs4</p>            </td>        </tr>    </tbody></table></p><p>&nbsp;</p><p>Determine the <strong>expected</strong> number of observations for each cell.&nbsp; Fill them into the table below.</p><p>&nbsp;</p><p>Round each of your values to at least 2 decimal places before entering them into the table.</p><p>&nbsp;</p><p>&nbsp;</p><p><table border="1" cellspacing="1" cellpadding="1" width="400" align="center">    <tbody>        <tr>            <td>&nbsp;</td>            <td colspan="2">            <p align="center"><strong>Factor A</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Factor B</strong></p>            </td>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 1</strong></p>            </td>            <td><span>&nbsp;<span>&nbsp;</span><1><span>&nbsp;</span></span></td>            <td><span>&nbsp;<span>&nbsp;</span><2><span>&nbsp;</span></span></td>        </tr>        <tr>            <td>            <p align="center"><strong>Level 2</strong></p>            </td>            <td><span>&nbsp;<span>&nbsp;</span><3><span>&nbsp;</span></span></td>            <td><span>&nbsp;<span>&nbsp;</span><4><span>&nbsp;</span></span></td>        </tr>    </tbody></table></p><p>&nbsp;</p>@

