// Numbas version: exam_results_page_options {"name": "Perform a two-factor ANOVA", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"btss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((stovern*N-G^2)/N,2)", "name": "btss", "description": ""}, "r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu1,sig1)),10)", "name": "r1", "description": ""}, "m4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(r4),2)", "name": "m4", "description": ""}, "ssq": {"templateType": "anything", "group": "Ungrouped variables", "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))]", "name": "ssq", "description": ""}, "f1stovern": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(f1tsqovern)", "name": "f1stovern", "description": ""}, "f2l1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "r1+r3", "name": "f2l1", "description": ""}, "f1btss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((f1stovern*40-g^2)/40,2)", "name": "f1btss", "description": ""}, "sig2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..3#0.2)", "name": "sig2", "description": ""}, "w1": {"templateType": "anything", "group": "Ungrouped variables", "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])", "name": "w1", "description": ""}, "w0": {"templateType": "anything", "group": "Ungrouped variables", "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])", "name": "w0", "description": ""}, "m3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(r3),2)", "name": "m3", "description": ""}, "rss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(ss-stovern,2)", "name": "rss", "description": ""}, "f1ss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(f1ssq)", "name": "f1ss", "description": ""}, "r4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu4,sig1)),10)", "name": "r4", "description": ""}, "f2ss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(f2ssq)", "name": "f2ss", "description": ""}, "f1t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(f1L1),sum(f1L2)]", "name": "f1t", "description": ""}, "w2": {"templateType": "anything", "group": "Ungrouped variables", "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])", "name": "w2", "description": ""}, "m2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(r2),2)", "name": "m2", "description": ""}, "r2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu2,sig2)),10)", "name": "r2", "description": ""}, "ss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(ssq)", "name": "ss", "description": ""}, "g": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(t)", "name": "g", "description": ""}, "f2btss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((f2stovern*40-g^2)/40,2)", "name": "f2btss", "description": ""}, "f1ssq": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(map(x^2,x,f1L1)),sum(map(x^2,x,f1L2))]", "name": "f1ssq", "description": ""}, "w": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[w0,w1,w2]", "name": "w", "description": ""}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "name": "tol", "description": ""}, "tss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((ss*N-G^2)/N,2)", "name": "tss", "description": ""}, "sig1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..3#0.2)", "name": "sig1", "description": ""}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "n1+n2+n3+n4", "name": "n", "description": ""}, "mrs": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(RSS/36,2)", "name": "mrs", "description": ""}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(r1),sum(r2),sum(r3),sum(r4)]", "name": "t", "description": ""}, "ivr": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(interactionss/mrs,2)", "name": "ivr", "description": ""}, "interactionss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "btss-f1btss-f2btss", "name": "interactionss", "description": ""}, "vvr": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[f1vr,f2vr,ivr]", "name": "vvr", "description": ""}, "n2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "10", "name": "n2", "description": ""}, "f1l1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "r1+r2", "name": "f1l1", "description": ""}, "mu1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(20..25#0.5)", "name": "mu1", "description": ""}, "stovern": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(tsqovern)", "name": "stovern", "description": ""}, "mu2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mu1-random(3..5#0.2)", "name": "mu2", "description": ""}, "mu4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mu3-random(1..2#0.1)", "name": "mu4", "description": ""}, "f2stovern": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum([f2t[0]^2/20,f2t[1]^2/20])", "name": "f2stovern", "description": ""}, "f1l2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "r3+r4", "name": "f1l2", "description": ""}, "f1tsqovern": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[f1t[0]^2/20,f1t[1]^2/20]", "name": "f1tsqovern", "description": ""}, "f1rss": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(f1ss-f1stovern,2)", "name": "f1rss", "description": ""}, "f2ssq": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(map(x^2,x,f2L1)),sum(map(x^2,x,f2L2))]", "name": "f2ssq", "description": ""}, "tsqovern": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[t[0]^2/n1,t[1]^2/n2,t[2]^2/n3,t[3]^2/n4]", "name": "tsqovern", "description": ""}, "n1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "10", "name": "n1", "description": ""}, "m1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(r1),2)", "name": "m1", "description": ""}, "f2vr": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(f2btss/mrs,2)", "name": "f2vr", "description": ""}, "r3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu3,sig1)),10)", "name": "r3", "description": ""}, "n3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "10", "name": "n3", "description": ""}, "f2t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[sum(f2L1),sum(f2L2)]", "name": "f2t", "description": ""}, "n4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "10", "name": "n4", "description": ""}, "f2l2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "r2+r4", "name": "f2l2", "description": ""}, "mu3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(22..26#0.5)", "name": "mu3", "description": ""}, "f1vr": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(f1btss/mrs,2)", "name": "f1vr", "description": ""}}, "ungrouped_variables": ["ivr", "f1vr", "f2vr", "w2", "w1", "w0", "f1l2", "f1l1", "n", "mu3", "f1ssq", "f1btss", "m4", "m1", "m3", "m2", "btss", "f2btss", "rss", "tss", "f1t", "r4", "tol", "f2ssq", "ssq", "vvr", "sig1", "sig2", "f1ss", "w", "n2", "interactionss", "tsqovern", "mu4", "mu1", "g", "r2", "mu2", "ss", "f1tsqovern", "r3", "f2ss", "mrs", "f1rss", "f2l1", "f2l2", "r1", "stovern", "t", "f1stovern", "f2t", "n1", "f2stovern", "n3", "n4"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Perform a two-factor ANOVA", "functions": {"dec": {"type": "string", "language": "jme", "definition": "switch(vr>=12.88, 'Very strongly reject the null hypothesis ($p\\\\le 0.001$)',vr>=7.41,'Strongly reject the null hypothesis ($0.001 \\\\lt p \\\\le 0.01$)',vr>=4.12, 'Reject the null hypothesis ($0.01 \\\\lt p \\\\le 0.05$)',vr>=2.86,'Accept the null hypothesis ($0.05 \\\\lt p \\\\le 0.1$)','Accept the null hypothesis($p\\\\gt 0.1$)') ", "parameters": [["vr", "number"]]}, "pstdev": {"type": "number", "language": "jme", "definition": "sqrt(abs(l)/(abs(l)-1))*stdev(l)", "parameters": [["l", "list"]]}}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "1", "maxValue": "1", "marks": 0.25}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "f1btss-tol", "maxValue": "f1btss+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "f1btss-tol", "maxValue": "f1btss+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "f1vr-tol", "maxValue": "f1vr+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "1", "maxValue": "1", "marks": 0.25}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "f2btss-tol", "maxValue": "f2btss+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "f2btss-tol", "maxValue": "f2btss+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "f2vr-tol", "maxValue": "f2vr+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "1", "maxValue": "1", "marks": 0.25}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "interactionss-tol", "maxValue": "interactionss+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "interactionss-tol", "maxValue": "interactionss+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "ivr-tol", "maxValue": "ivr+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "36", "maxValue": "36", "marks": 0.25}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "rss-tol", "maxValue": "rss+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "mrs-tol", "maxValue": "mrs+tol", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "39", "maxValue": "39", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "precround(f1btss+f2btss+interactionss+rss,2)-tol", "maxValue": "precround(f1btss+f2btss+interactionss+rss,2)+tol", "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "m1", "maxValue": "m1", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "m2", "maxValue": "m2", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "m3", "maxValue": "m3", "marks": 0.5}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "m4", "maxValue": "m4", "marks": 0.5}], "type": "gapfill", "prompt": "

Now complete the following two factor ANOVA table from this data. Input the $SS,\\;MS$ and $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
SourcedfSSMSVR
Personality[[0]][[1]][[2]][[3]]
Stimulus[[4]][[5]][[6]][[7]]
P-S interaction[[8]][[9]][[10]][[11]]
Residual[[12]][[13]][[14]]-
Total[[15]][[16]]--
\n

The Calculations.

\n

1. Residual Calculations. When you are calculating $TSS$ and $BTSS$ round them both to 2 decimal places, then calculate $RSS$ by taking away these rounded values. The $RMS$ value is then obtained by dividing this $RSS$ value by the residual degrees of freedom.

\n

2. For Personality, Stimulus and Interaction, calculate the estimations of their variances to 2 decimal places as well. These values go in the $MS$ column.

\n

3. The $VR$ values are obtained by dividing the first three values in the $MS$ column by the $RMS$ value. Enter the $VR$ values to 2 decimal places in the last column.

\n

 

\n

Also input the mean values of the factors at their various levels, input your answers 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
 $\\overline{x}_i$
Normal, Baseline[[17]]
Normal, Stress[[18]]
Antisocial, Baseline[[19]]
Antisocial, Stress[[20]]
", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"layout": {"expression": ""}, "choices": ["GSR: no dependence upon personality.", "GSR: no dependence upon stimulus.", "No interaction between the factors."], "matrix": "w", "type": "m_n_x", "maxAnswers": 0, "shuffleChoices": false, "marks": 0, "scripts": {}, "minMarks": 0, "minAnswers": 0, "maxMarks": 0, "shuffleAnswers": false, "showCorrectAnswer": true, "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$."]}], "type": "gapfill", "prompt": "

Using the following p-values for the $F_{1,36}$ statistic find the appropriate significance levels for the factors as given by their $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 \n
$10\\%$$5\\%$$1\\%$$0.1\\%$
$2.86$$4.12$$7.41$$12.88$
\n

 

\n

[[0]]

", "showCorrectAnswer": true, "marks": 0}], "statement": "

 In a similar fashion to the calculation done in lectures, carry out a two factor ANOVA on the following set of data.

\n

Individuals who are identified as having an antisocial personality disorder may also have reduced physiological responses to anxiety-producing stimuli.

\n

One way of measuring this response is with ”galvanic skin response” (GSR), a measurable reduction in the electrical resistance on the skin. [This is the basis of how a lie detector works.]

\n

The following data represent the results of an experiment to compare the responses of normal and antisocial individuals in regular (baseline) and stress-provoking situations (low score reflects a more anxious individual):

\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
NormalBaseline$\\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]}$
Stress$\\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]}$
AntisocialBaseline$\\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]}$
Stress$\\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

 The null hypotheses we are testing are:

\n

1. The GSR does not depend upon the personality type.

\n

2. The GSR does not depend upon the stimulus.

\n

3. There is no interaction between personality and stimulus in determining the GSR.

\n

 

", "tags": ["ANOVA", "average", "checked2015", "data analysis", "degrees of freedom", "F-test", "factors", "hypothesis testing", "levels", "mean", "mean ", "p values", "PSY2010", "statistics", "stats", "two factor ANOVA", "variance"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

26/11/2012

\n


Added tags and description.

\n

Changed calculations for BTSS for the factors and added the interaction analysis.

\n

Uses the inbuilt ftest function from the stats extension to find p values.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Two factor ANOVA example

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

We have two factors: Personality and Stimulus.

\n

Personality has two levels: Normal and Antisocial

\n

Stimulus has two levels: Baseline and Stress.

\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 ($BTSS$) and Residual Sum of Squares ($RSS$). Note that the degrees of freedom for this step are 36=40-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 \n \n \n \n
 $\\overline{x}_i$$T_i$$\\sum x^2$$n_i$
Normal, Baseline$\\var{m1}$$\\var{t[0]}$$\\var{ssq[0]}$10
Normal, Stress$\\var{m2}$$\\var{t[1]}$$\\var{ssq[1]}$10
Antisocial, Baseline$\\var{m3}$$\\var{t[2]}$$\\var{ssq[2]}$10
Antisocial, Stress$\\var{m4}$$\\var{t[3]}$$\\var{ssq[3]}$10
  $G=\\;\\var{g}$Sum of Squares=$\\var{ss}$$N=40$
\n

From this we obtain:

\n

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

\n

\\[TSS = \\sum \\sum x^2- \\frac{G^2}{40}=\\var{ss}- \\frac{\\var{g}^2}{40}=\\var{tss}\\] both to 2 decimal places.

\n

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

\n

Second Step.

\n

Now ignore the Stimulus factor and calculate totals $T_i$ for each level of Personality. From these totals calculate a variance estimate for personality using the same method as before. The degrees of freedom will be one fewer than the levels of Stimulus 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
Normal (Baseline and Stress)$\\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]}$
Antisocial (Baseline and Stress)$\\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 have 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 \n \n \n \n
 $T_i$$\\sum x^2$$n_i$ (number of observations)
Normal, (Baseline and Stress)$\\var{f1t[0]}$$\\var{f1ssq[0]}$20
Antisocial, (Baseline and Stress)$\\var{f1t[1]}$$\\var{f1ssq[1]}$20
 $G=\\;\\var{g}$Sum of Squares=$\\var{f1ss}$$N=40$
\n

So we can calculate:

\n

\\[\\mbox{Variance estimate for personality} =\\sum \\frac{T_i^2}{20}- \\frac{G^2}{40}=\\frac{\\var{f1t[0]}^2}{20}+\\frac{\\var{f1t[1]}^2}{20}-\\frac{\\var{g}^2}{40}=\\var{f1btss}\\]

\n

Third Step.

\n

Repeat step 2 with the factors switched, i.e. use the totals $T_i$ for the Stimulus factor levels ignoring Personality.This gives a Between Treatments Sum of Squares. Again the degrees of freedom will be 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
Baseline (Normal and Antisocial)$\\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]}$
Stress (Normal and Antisocial)$\\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 have 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 \n \n \n \n
 $T_i$$\\sum x^2$$n_i$ (number of observations)
Baseline (Normal and Antisocial)$\\var{f2t[0]}$$\\var{f2ssq[0]}$20
Stress (Normal and Antisocial)$\\var{f2t[1]}$$\\var{f2ssq[1]}$20
 $G=\\;\\var{g}$Sum of Squares=$\\var{f2ss}$$N=40$
\n

So we can calculate:

\n

\\[ \\mbox{Variance estimate for stimulus} =\\sum \\frac{T_i^2}{20}- \\frac{G^2}{40}=\\frac{\\var{f2t[0]}^2}{20}+\\frac{\\var{f2t[1]}^2}{20}-\\frac{\\var{g}^2}{40}=\\var{f2btss}\\]

\n

Step 4.

\n

Now determine a Sum of Squares for Interaction by subtracting the sums of squares obtained for Personality (Step 2) and Stimulus (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

\\[\\mbox{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 $VR$ values are obtained by dividing the $RMS$ value into the $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
SourcedfSSMSVRDecision
Personality1$\\var{f1btss}$$\\var{f1btss}$$\\var{f1vr}${dec(f1vr)} that GSR is independent of personality.
Stimulus1$\\var{f2btss}$$\\var{f2btss}$$\\var{f2vr}${dec(f2vr)} that GSR is independent of the stimulus.
P-S interaction1 $\\var{interactionss}$  $\\var{interactionss}$ $\\var{ivr}$ {dec(ivr)} that personality and stimulus are independent in terms of GSR.
Residual36$\\var{rss}$$\\var{mrs}$- 
Total39$\\var{precround(f1btss+f2btss+interactionss+rss,2)}$-- 
", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}