// Numbas version: exam_results_page_options {"name": "Two factor ANOVA - Mock Test - SES2003", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "name": "Two factor ANOVA - Mock Test - SES2003", "advice": "

We have two factors: {factor1_name} and {factor2_name}.

\n

{capitalise(factor1_name)} has two levels: {factor1_levels[0]} and {factor1_levels[1]}.

\n

{capitalise(factor2_name)} has two levels: {factor2_levels[0]} and {factor2_levels[1]}.

\n

First Step

\n

First regard the different treatment combinations as a set of independent samples and analyse as for a one-way analysis with unrelated measurements. From this analysis, we obtain the Total Sum of Squares, the Between Treatments Sum of Squares ($\\mathit{BTSS}$) and Residual Sum of Squares ($\\mathit{RSS}$). Note that the degrees of freedom for this step are $\\var{n-4} = \\var{n}-4$ as there are $4$ treatments.

\n

You should obtain

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
 $\\overline{x_i}$$T_i$$\\sum x^2$$n_i$
{capitalise(factor1_levels[0])}, {factor2_levels[0]}$\\var{mean1}$$\\var{t[0]}$$\\var{ssq[0]}$$\\var{num_samples}$
{capitalise(factor1_levels[0])}, {factor2_levels[1]}$\\var{mean2}$$\\var{t[1]}$$\\var{ssq[1]}$$\\var{num_samples}$
{capitalise(factor1_levels[1])}, {factor2_levels[0]}$\\var{mean3}$$\\var{t[2]}$$\\var{ssq[2]}$$\\var{num_samples}$
{capitalise(factor1_levels[1])}, {factor2_levels[1]}$\\var{mean4}$$\\var{t[3]}$$\\var{ssq[3]}$$\\var{num_samples}$
  $G = \\var{g}$Sum of Squares = $\\var{ss}$$N=\\var{n}$
\n

From this we obtain:

\n

\\[ \\mathit{BTSS} = \\sum \\frac{T_i^2}{\\var{num_samples}} - \\frac{G^2}{\\var{n}} = \\frac{\\var{t[0]}^2}{\\var{num_samples}}+\\frac{\\var{t[1]}^2}{\\var{num_samples}}+\\frac{\\var{t[2]}^2}{\\var{num_samples}}+\\frac{\\var{t[3]}^2}{\\var{num_samples}}-\\frac{\\var{g}^2}{\\var{n}}=\\var{btss}\\]

\n

\\[\\mathit{TSS} = \\sum \\sum x^2- \\frac{G^2}{\\var{n}}=\\var{ss}- \\frac{\\var{g}^2}{\\var{n}}=\\var{tss} \\]

\n

both to 2 decimal places.

\n

\\[\\mathit{RSS} = \\mathit{TSS} - \\mathit{BTSS} = \\var{tss} - \\var{btss} = \\var{rss} \\]

\n

Second Step

\n

Now ignore the {factor2_name} factor and calculate totals $T_i$ for each level of {factor1_name}. From these totals calculate a variance estimate for {factor1_name} using the same method as before. The degrees of freedom will be one fewer than the number of levels of {factor2_name} and is therefore $1$.

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{capitalise(factor1_levels[0])} ({factor2_levels[0]} and {factor2_levels[1]})$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$$\\var{r2[5]}$$\\var{r2[6]}$$\\var{r2[7]}$$\\var{r2[8]}$$\\var{r2[9]}$
{capitalise(factor1_levels[1])} ({factor2_levels[0]} and {factor2_levels[1]})$\\var{r3[0]}$$\\var{r3[1]}$$\\var{r3[2]}$$\\var{r3[3]}$$\\var{r3[4]}$$\\var{r3[5]}$$\\var{r3[6]}$$\\var{r3[7]}$$\\var{r3[8]}$$\\var{r3[9]}$$\\var{r3[0]}$$\\var{r4[1]}$$\\var{r4[2]}$$\\var{r4[3]}$$\\var{r4[4]}$$\\var{r4[5]}$$\\var{r4[6]}$$\\var{r4[7]}$$\\var{r4[8]}$$\\var{r4[9]}$
\n

You should produce the following data from this table:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
 $T_i$$\\sum x^2$$n_i$ (number of observations)
{capitalise(factor1_levels[0])} ({factor2_levels[0]} and {factor2_levels[1]})$\\var{f1t[0]}$$\\var{f1ssq[0]}$$\\var{2*num_samples}$
{capitalise(factor1_levels[1])} ({factor2_levels[0]} and {factor2_levels[1]})$\\var{f1t[1]}$$\\var{f1ssq[1]}$$\\var{2*num_samples}$
 $G = \\var{g}$Sum of Squares = $\\var{f1ss}$$N = \\var{n}$
\n

So we can calculate:

\n

\\[\\text{Variance estimate for }\\var{factor1_name} = \\sum \\frac{T_i^2}{\\var{2*num_samples}}- \\frac{G^2}{\\var{n}}=\\frac{\\var{f1t[0]}^2}{\\var{2*num_samples}}+\\frac{\\var{f1t[1]}^2}{\\var{2*num_samples}}-\\frac{\\var{g}^2}{\\var{n}}=\\var{f1btss}\\]

\n

Third Step

\n

Repeat step 2 with the factors switched, i.e. use the totals $T_i$ for the {factor2_name} factor levels, ignoring {factor1_name}. This gives a Between Treatments Sum of Squares. Again, the degrees of freedom will be one fewer than the number of levels of {factor1_name}, i.e. $2 - 1 = 1$.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{capitalise(factor2_levels[0])} ({factor1_levels[0]} and {factor1_levels[1]})$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$$\\var{r2[0]}$$\\var{r3[1]}$$\\var{r3[2]}$$\\var{r3[3]}$$\\var{r3[4]}$$\\var{r3[5]}$$\\var{r3[6]}$$\\var{r3[7]}$$\\var{r3[8]}$$\\var{r3[9]}$
{capitalise(factor2_levels[1])} ({factor1_levels[0]} and {factor1_levels[1]})$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$$\\var{r2[5]}$$\\var{r2[6]}$$\\var{r2[7]}$$\\var{r2[8]}$$\\var{r2[9]}$$\\var{r4[0]}$$\\var{r4[1]}$$\\var{r4[2]}$$\\var{r4[3]}$$\\var{r4[4]}$$\\var{r4[5]}$$\\var{r4[6]}$$\\var{r4[7]}$$\\var{r4[8]}$$\\var{r4[9]}$
\n

You should obtain the following data from this table:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
 $T_i$$\\sum x^2$$n_i$ (number of observations)
{capitalise(factor2_levels[0])} ({factor1_levels[0]} and {factor1_levels[1]})$\\var{f2t[0]}$$\\var{f2ssq[0]}$$\\var{2*num_samples}$
{capitalise(factor2_levels[1])} ({factor1_levels[0]} and {factor1_levels[1]})$\\var{f2t[1]}$$\\var{f2ssq[1]}$$\\var{2*num_samples}$
 $G = \\var{g}$Sum of Squares = $\\var{f2ss}$$N = \\var{n}$
\n

So we can calculate:

\n

\\[ \\text{Variance estimate for }\\var{factor2_name} = \\sum \\frac{T_i^2}{\\var{2*num_samples}}- \\frac{G^2}{\\var{n}}=\\frac{\\var{f2t[0]}^2}{\\var{2*num_samples}}+\\frac{\\var{f2t[1]}^2}{\\var{2*num_samples}}-\\frac{\\var{g}^2}{\\var{n}}=\\var{f2btss}\\]

\n

Fourth Step

\n

Now determine a Sum of Squares for Interaction by subtracting the sums of squares obtained for {factor1_name} (Step 2) and {factor2_name} (step 3) from the overall Between Treatments Sum of squares obtained in Step 1. The degrees of freedom is also obtained by subtraction and is 1.

\n

This gives: 

\n

\\[\\text{Variance estimate for the interaction}= \\var{btss}-\\var{f1btss}-\\var{f2btss} = \\var{interactionss}\\]

\n

The ANOVA Table

\n

We now have all the terms required to construct the ANOVA table and hence test the null hypothesis relating to each factor and to the interaction. Note that the $\\mathit{VR}$ values are obtained by dividing the $\\mathit{RMS}$ value into the $\\mathit{MS}$ values for the factors and the interaction.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
SourcedfSSMSVRDecision
{capitalise(factor1_name)}$1$$\\var{f1btss}$$\\var{f1btss}$$\\var{f1vr}${dec(f1vr)} that {measurement_name} is independent of {factor1_name}.
{capitalise(factor2_name)}$1$$\\var{f2btss}$$\\var{f2btss}$$\\var{f2vr}${dec(f2vr)} that {measurement_name} is independent of {factor2_name}.
Interaction$1$$\\var{interactionss}$$\\var{interactionss}$$\\var{ivr}${dec(ivr)} that {factor1_name} and {factor2_name} are independent in terms of {measurement_name}.
Residual$\\var{n-4}$$\\var{rss}$$\\var{mrs}$- 
Total$\\var{n-1}$$\\var{precround(f1btss+f2btss+interactionss+rss,2)}$-- 
", "variable_groups": [{"variables": ["measurement_name", "factor1_name", "factor1_levels", "factor2_name", "factor2_levels", "mu1", "mu2_diff", "mu3", "mu4_diff", "sig1", "sig2", "num_samples"], "name": "Editable variables"}, {"variables": ["r1", "r2", "r3", "r4"], "name": "Sample data"}, {"variables": ["n", "f1btss", "f1vr", "f2btss", "f2vr", "ivr", "rss", "mrs", "mean1", "mean2", "mean3", "mean4"], "name": "Statistics"}], "variables": {"mu1": {"name": "mu1", "definition": "random(13..17#0.5)", "group": "Editable variables", "templateType": "randrange", "description": "

The population mean of sample 1

"}, "mu2_diff": {"name": "mu2_diff", "definition": "random(2..3#0.2)", "group": "Editable variables", "templateType": "randrange", "description": "

Difference between the population means of samples 1 and 2 (mu1 and mu2)

"}, "r4": {"name": "r4", "definition": "repeat(round(normalsample(mu4,sig1)),num_samples)", "group": "Sample data", "templateType": "anything", "description": ""}, "num_samples": {"name": "num_samples", "definition": "10", "group": "Editable variables", "templateType": "number", "description": "

The number of measurements in each sample.

"}, "mu4": {"name": "mu4", "definition": "mu3-mu4_diff", "group": "Ungrouped variables", "templateType": "anything", "description": "

Population mean of sample 4

"}, "ivr": {"name": "ivr", "definition": "precround(interactionss/mrs,2)", "group": "Statistics", "templateType": "anything", "description": ""}, "w0": {"name": "w0", "definition": "switch(vvr[0]>=12.88,[1,0,0,0,0],vvr[0]>=7.41,[0,1,0,0,0],vvr[0]>=4.12,[0,0,1,0,0],vvr[0]>=2.86,[0,0,0,1,0],[0,0,0,0,1])", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f2vr": {"name": "f2vr", "definition": "precround(f2btss/mrs,2)", "group": "Statistics", "templateType": "anything", "description": "

Variance ratio ($\\mathit{VR}$) of Factor 1

"}, "factor2_name": {"name": "factor2_name", "definition": "\"stimulus\"", "group": "Editable variables", "templateType": "string", "description": "

The name of Factor 2

"}, "mean4": {"name": "mean4", "definition": "precround(mean(r4),2)", "group": "Statistics", "templateType": "anything", "description": "

Sample mean of sample 4

"}, "t": {"name": "t", "definition": "[sum(r1),sum(r2),sum(r3),sum(r4)]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "stovern": {"name": "stovern", "definition": "sum(tsqovern)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f1rss": {"name": "f1rss", "definition": "precround(f1ss-f1stovern,2)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f2ssq": {"name": "f2ssq", "definition": "[sum(map(x^2,x,f2L1)),sum(map(x^2,x,f2L2))]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "mean2": {"name": "mean2", "definition": "precround(mean(r2),2)", "group": "Statistics", "templateType": "anything", "description": "

Sample mean of sample 2

"}, "mrs": {"name": "mrs", "definition": "precround(RSS/36,2)", "group": "Statistics", "templateType": "anything", "description": ""}, "sig2": {"name": "sig2", "definition": "random(2..3#0.2)", "group": "Editable variables", "templateType": "randrange", "description": "

Standard deviation in sample 2.

"}, "f2t": {"name": "f2t", "definition": "[sum(f2L1),sum(f2L2)]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "rss": {"name": "rss", "definition": "precround(ss-stovern,2)", "group": "Statistics", "templateType": "anything", "description": ""}, "interactionss": {"name": "interactionss", "definition": "btss-f1btss-f2btss", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f2ss": {"name": "f2ss", "definition": "sum(f2ssq)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f1vr": {"name": "f1vr", "definition": "precround(f1btss/mrs,2)", "group": "Statistics", "templateType": "anything", "description": "

Variance ratio ($\\mathit{VR}$) of Factor 1

"}, "tss": {"name": "tss", "definition": "precround(ss-G^2/N,2)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "btss": {"name": "btss", "definition": "precround(stovern-G^2/N,2)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f2stovern": {"name": "f2stovern", "definition": "sum([f2t[0]^2/20,f2t[1]^2/20])", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "w2": {"name": "w2", "definition": "switch(vvr[2]>=12.88,[1,0,0,0,0],vvr[2]>=7.41,[0,1,0,0,0],vvr[2]>=4.12,[0,0,1,0,0],vvr[2]>=2.86,[0,0,0,1,0],[0,0,0,0,1])", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "tol": {"name": "tol", "definition": "0.001", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f1t": {"name": "f1t", "definition": "[sum(f1L1),sum(f1L2)]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "factor2_levels": {"name": "factor2_levels", "definition": "[ \"placebo\", \"anti-perspirant\" ]", "group": "Editable variables", "templateType": "list of strings", "description": "

The names of the levels of Factor 2

"}, "f1btss": {"name": "f1btss", "definition": "precround(f1stovern-g^2/40,2)", "group": "Statistics", "templateType": "anything", "description": "

Between treatments sum of square ($\\mathit{BTSS}$) of Factor 1

"}, "mean3": {"name": "mean3", "definition": "precround(mean(r3),2)", "group": "Statistics", "templateType": "anything", "description": "

Sample mean of sample 3

"}, "w1": {"name": "w1", "definition": "switch(vvr[1]>=12.88,[1,0,0,0,0],vvr[1]>=7.41,[0,1,0,0,0],vvr[1]>=4.12,[0,0,1,0,0],vvr[1]>=2.86,[0,0,0,1,0],[0,0,0,0,1])", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "ssq": {"name": "ssq", "definition": "[sum(map(x^2,x,r1)),sum(map(x^2,x,r2)),sum(map(x^2,x,r3)),sum(map(x^2,x,r4))]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f1l2": {"name": "f1l2", "definition": "r3+r4", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f1stovern": {"name": "f1stovern", "definition": "sum(f1tsqovern)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "w": {"name": "w", "definition": "[w0,w1,w2]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "r2": {"name": "r2", "definition": "repeat(round(normalsample(mu2,sig2)),num_samples)", "group": "Sample data", "templateType": "anything", "description": ""}, "measurement_name": {"name": "measurement_name", "definition": "\"GM\"", "group": "Editable variables", "templateType": "string", "description": "

The name of the value being measured.

"}, "f1l1": {"name": "f1l1", "definition": "r1+r2", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "mu3": {"name": "mu3", "definition": "random(22..26#0.5)", "group": "Editable variables", "templateType": "randrange", "description": "

The population mean of sample 3

"}, "f1ssq": {"name": "f1ssq", "definition": "[sum(map(x^2,x,f1L1)),sum(map(x^2,x,f1L2))]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "vvr": {"name": "vvr", "definition": "[f1vr,f2vr,ivr]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "mean1": {"name": "mean1", "definition": "precround(mean(r1),2)", "group": "Statistics", "templateType": "anything", "description": "

Sample mean of sample 1

"}, "sig1": {"name": "sig1", "definition": "random(2..3#0.2)", "group": "Editable variables", "templateType": "randrange", "description": "

Standard deviation in samples 1, 3 and 4.

"}, "factor1_levels": {"name": "factor1_levels", "definition": "[ \"non-sufferer\", \"sufferer\" ]", "group": "Editable variables", "templateType": "list of strings", "description": "

Names of the levels of Factor 1

"}, "r3": {"name": "r3", "definition": "repeat(round(normalsample(mu3,sig1)),num_samples)", "group": "Sample data", "templateType": "anything", "description": ""}, "r1": {"name": "r1", "definition": "repeat(round(normalsample(mu1,sig1)),num_samples)", "group": "Sample data", "templateType": "anything", "description": ""}, "n": {"name": "n", "definition": "4*num_samples", "group": "Statistics", "templateType": "anything", "description": "

The total number of measurements across all the samples

"}, "ss": {"name": "ss", "definition": "sum(ssq)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f1tsqovern": {"name": "f1tsqovern", "definition": "[f1t[0]^2/20,f1t[1]^2/20]", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "f2l2": {"name": "f2l2", "definition": "r2+r4", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "tsqovern": {"name": "tsqovern", "definition": "map(x^2/num_samples,x,t)", "group": "Ungrouped variables", "templateType": "anything", "description": "

$t^2/n$

"}, "mu4_diff": {"name": "mu4_diff", "definition": "random(5..7#0.2)", "group": "Editable variables", "templateType": "randrange", "description": "

Difference between the population means of samples 3 and 4 (mu3 and mu4)

"}, "f1ss": {"name": "f1ss", "definition": "sum(f1ssq)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "factor1_name": {"name": "factor1_name", "definition": "\"personality\"", "group": "Editable variables", "templateType": "string", "description": "

The name of Factor 1

"}, "mu2": {"name": "mu2", "definition": "mu1-mu2_diff", "group": "Ungrouped variables", "templateType": "anything", "description": "

The population mean of sample 2

"}, "f2btss": {"name": "f2btss", "definition": "precround(f2stovern-g^2/40,2)", "group": "Statistics", "templateType": "anything", "description": "

Between treatments sum of squares ($\\mathit{BTSS}$) of Factor 1

"}, "f2l1": {"name": "f2l1", "definition": "r1+r3", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "g": {"name": "g", "definition": "sum(t)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}}, "tags": [], "parts": [{"unitTests": [], "gaps": [{"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "1", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "1", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.25, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "f1btss+tol", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "f1btss-tol", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.5, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "f1vr+tol", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "f1vr-tol", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.5, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "1", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "1", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.25, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "f2btss+tol", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "f2btss-tol", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.5, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "f2vr+tol", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "f2vr-tol", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.5, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "1", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "1", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.25, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "interactionss+tol", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "interactionss-tol", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.5, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "ivr+tol", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "ivr-tol", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.5, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "n-4", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "n-4", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.25, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "mrs+tol", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "mrs-tol", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.5, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "n-1", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "minValue": "n-1", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 0.5, "mustBeReducedPC": 0, "variableReplacements": [], "scripts": {}, "allowFractions": false, "variableReplacementStrategy": "originalfirst"}], "variableReplacements": [], "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "customMarkingAlgorithm": "", "prompt": "

Now complete the following two factor ANOVA table from this data. Input the $\\mathit{MS}$ and $\\mathit{VR}$ data to 2 decimal places.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
SourcedfSSMSVR
{capitalise(factor1_name)}[[0]]{f1btss}[[1]][[2]]
{capitalise(factor2_name)}[[3]]{f2btss}[[4]][[5]]
Interaction[[6]]{interactionss}[[7]][[8]]
Residual[[9]]{rss}[[10]]-
Total[[11]]{precround(f1btss+f2btss+interactionss+rss,2)}--
\n

", "marks": 0, "sortAnswers": false, "showFeedbackIcon": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst"}, {"unitTests": [], "gaps": [{"type": "m_n_x", "unitTests": [], "warningType": "none", "minMarks": 0, "shuffleAnswers": false, "customMarkingAlgorithm": "", "showFeedbackIcon": true, "choices": ["{measurement_name}: no dependence upon {factor1_name}.", "{measurement_name}: no dependence upon {factor2_name}.", "No interaction between the factors."], "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "minAnswers": 0, "variableReplacements": [], "answers": ["Very strong rejection, $p \\le 0.001$.", "Strong rejection, $0.001\\lt p \\le 0.01$.", "Rejection, $0.01\\lt p \\le 0.05$.", "Accept, but investigate, $0.05\\lt p \\le 0.1$.", "Accept, $p \\gt 0.1$."], "shuffleChoices": false, "maxAnswers": 0, "displayType": "radiogroup", "scripts": {}, "layout": {"expression": "", "type": "all"}, "marks": 0, "maxMarks": 0, "matrix": "w", "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst"}], "variableReplacements": [], "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "customMarkingAlgorithm": "", "prompt": "

Using the following $p$-values for the $F_{1,36}$ statistic find the appropriate significance levels for the factors as given by their $\\mathit{VR}$ value and then comment on the null hypotheses for each factor and the interaction. 

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$10\\%$$5\\%$$1\\%$$0.1\\%$
$2.86$$4.12$$7.41$$12.88$
\n

[[0]]

", "marks": 0, "sortAnswers": false, "showFeedbackIcon": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst"}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Template question. The student is asked to perform a two factor ANOVA to test the null hypotheses that the measurement does not depend on each of the factors, and that there is no interaction between the factors.

"}, "preamble": {"css": "td, th {\n empty-cells:hide;\n}", "js": ""}, "statement": "

Individuals who are identified as having hyperhidrosis suffer from excess sweating. This can be a problem for sport climbers who rely on dry hands for gripping climbing holds. One way to alleviate the problem may be a hand anti-perspirant.

\n

Sweating can be quantified using a \"gravimetric measurement\" (GM), which measures the rate of sweat production in mg/min, by measuring the change in weight of an absorbant paper placed in the palm of an individual's hand.

\n

The following data represent the results of an experiment to compare the responses of individuals considered to be sufferers or non-sufferers, who have been given a hand anti-perspirant or placebo.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{capitalise(factor1_name)}{capitalise(factor2_name)}Gravimetric Measurement (GM), in mg/min
{capitalise(factor1_levels[0])}{capitalise(factor2_levels[0])}$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$
{capitalise(factor2_levels[1])}$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$$\\var{r2[5]}$$\\var{r2[6]}$$\\var{r2[7]}$$\\var{r2[8]}$$\\var{r2[9]}$
{capitalise(factor1_levels[1])}{capitalise(factor2_levels[0])}$\\var{r3[0]}$$\\var{r3[1]}$$\\var{r3[2]}$$\\var{r3[3]}$$\\var{r3[4]}$$\\var{r3[5]}$$\\var{r3[6]}$$\\var{r3[7]}$$\\var{r3[8]}$$\\var{r3[9]}$
{capitalise(factor2_levels[1])}$\\var{r4[0]}$$\\var{r4[1]}$$\\var{r4[2]}$$\\var{r4[3]}$$\\var{r4[4]}$$\\var{r4[5]}$$\\var{r4[6]}$$\\var{r4[7]}$$\\var{r4[8]}$$\\var{r4[9]}$
\n

Carry out a two factor ANOVA on the data to test the following null hypotheses:

\n
    \n
  1. {capitalise(measurement_name)} does not depend upon {factor1_name}.
  2. \n
  3. {capitalise(measurement_name)} does not depend upon {factor2_name}.
  4. \n
  5. There is no interaction between {factor1_name} and {factor2_name} in determining {measurement_name}.
  6. \n
", "variablesTest": {"condition": "", "maxRuns": 100}, "extensions": ["stats"], "ungrouped_variables": ["w1", "w2", "w0", "f1l2", "f1l1", "f1ssq", "tol", "btss", "tss", "f1t", "w", "f2ssq", "f2t", "ssq", "vvr", "f1ss", "interactionss", "tsqovern", "mu4", "g", "mu2", "ss", "f1tsqovern", "f1rss", "f2l1", "f2l2", "stovern", "t", "f1stovern", "f2ss", "f2stovern"], "functions": {"pstdev": {"parameters": [["l", "list"]], "language": "jme", "definition": "sqrt(abs(l)/(abs(l)-1))*stdev(l)", "type": "number"}, "dec": {"parameters": [["vr", "number"]], "language": "jme", "definition": "switch(\n vr>=12.88, \n'Very strongly reject the null hypothesis ($p\\\\le 0.001$)',\n vr>=7.41,\n'Strongly reject the null hypothesis ($0.001 \\\\lt p \\\\le 0.01$)',\n vr>=4.12, \n'Reject the null hypothesis ($0.01 \\\\lt p \\\\le 0.05$)',\n vr>=2.86,\n'Accept the null hypothesis ($0.05 \\\\lt p \\\\le 0.1$)',\n 'Accept the null hypothesis ($p\\\\gt 0.1$)'\n) ", "type": "string"}}, "type": "question", "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}