// Numbas version: finer_feedback_settings {"name": "Jinhua's copy of Two factor ANOVA Practice", "duration": 0, "metadata": {"notes": "", "description": "
Statistics and probability. A question on two factor ANOVA.
", "licence": "Creative Commons Attribution 4.0 International"}, "allQuestions": true, "shuffleQuestions": false, "percentPass": 0, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "pickQuestions": 0, "navigation": {"onleave": {"action": "none", "message": "You haven't submitted all your answers on this page."}, "reverse": true, "allowregen": true, "showresultspage": "oncompletion", "preventleave": true, "browse": true, "showfrontpage": true}, "feedback": {"showtotalmark": true, "advicethreshold": 0, "showanswerstate": true, "showactualmark": true, "allowrevealanswer": true, "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "never"}, "type": "exam", "questions": [], "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [{"name": "Perform a two-factor ANOVA", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "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}], "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.
\nSource | df | SS | MS | VR |
---|---|---|---|---|
Personality | \n[[0]] | \n[[1]] | \n[[2]] | \n[[3]] | \n
Stimulus | \n[[4]] | \n[[5]] | \n[[6]] | \n[[7]] | \n
P-S interaction | \n[[8]] | \n[[9]] | \n[[10]] | \n[[11]] | \n
Residual | \n[[12]] | \n[[13]] | \n[[14]] | \n- | \n
Total | \n[[15]] | \n[[16]] | \n- | \n- | \n
The Calculations.
\n1. 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.
\n2. For Personality, Stimulus and Interaction, calculate the estimations of their variances to 2 decimal places as well. These values go in the $MS$ column.
\n3. 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 | $\\overline{x}_i$ | \n
Normal, Baseline | \n[[17]] | \n
---|---|
Normal, Stress | \n[[18]] | \n
Antisocial, Baseline | \n[[19]] | \n
Antisocial, Stress | \n[[20]] | \n
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
$10\\%$ | \n$5\\%$ | \n$1\\%$ | \n$0.1\\%$ | \n
$2.86$ | \n$4.12$ | \n$7.41$ | \n$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.
\nIndividuals who are identified as having an antisocial personality disorder may also have reduced physiological responses to anxiety-producing stimuli.
\nOne 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.]
\nThe 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):
\nNormal | Baseline | \n$\\var{r1[0]}$ | \n$\\var{r1[1]}$ | \n$\\var{r1[2]}$ | \n$\\var{r1[3]}$ | \n$\\var{r1[4]}$ | \n$\\var{r1[5]}$ | \n$\\var{r1[6]}$ | \n$\\var{r1[7]}$ | \n$\\var{r1[8]}$ | \n$\\var{r1[9]}$ | \n
---|---|---|---|---|---|---|---|---|---|---|---|
Stress | \n$\\var{r2[0]}$ | \n$\\var{r2[1]}$ | \n$\\var{r2[2]}$ | \n$\\var{r2[3]}$ | \n$\\var{r2[4]}$ | \n$\\var{r2[5]}$ | \n$\\var{r2[6]}$ | \n$\\var{r2[7]}$ | \n$\\var{r2[8]}$ | \n$\\var{r2[9]}$ | \n|
Antisocial | Baseline | \n$\\var{r3[0]}$ | \n$\\var{r3[1]}$ | \n$\\var{r3[2]}$ | \n$\\var{r3[3]}$ | \n$\\var{r3[4]}$ | \n$\\var{r3[5]}$ | \n$\\var{r3[6]}$ | \n$\\var{r3[7]}$ | \n$\\var{r3[8]}$ | \n$\\var{r3[9]}$ | \n
Stress | \n$\\var{r4[0]}$ | \n$\\var{r4[1]}$ | \n$\\var{r4[2]}$ | \n$\\var{r4[3]}$ | \n$\\var{r4[4]}$ | \n$\\var{r4[5]}$ | \n$\\var{r4[6]}$ | \n$\\var{r4[7]}$ | \n$\\var{r4[8]}$ | \n$\\var{r4[9]}$ | \n
The null hypotheses we are testing are:
\n1. The GSR does not depend upon the personality type.
\n2. The GSR does not depend upon the stimulus.
\n3. 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.
Changed calculations for BTSS for the factors and added the interaction analysis.
\nUses 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.
\nPersonality has two levels: Normal and Antisocial
\nStimulus has two levels: Baseline and Stress.
\nFirst Step:
\nFirst 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.
\nYou should obtain:
\n\n | $\\overline{x}_i$ | \n$T_i$ | \n$\\sum x^2$ | \n$n_i$ | \n
Normal, Baseline | \n$\\var{m1}$ | \n$\\var{t[0]}$ | \n$\\var{ssq[0]}$ | \n10 | \n
---|---|---|---|---|
Normal, Stress | \n$\\var{m2}$ | \n$\\var{t[1]}$ | \n$\\var{ssq[1]}$ | \n10 | \n
Antisocial, Baseline | \n$\\var{m3}$ | \n$\\var{t[2]}$ | \n$\\var{ssq[2]}$ | \n10 | \n
Antisocial, Stress | \n$\\var{m4}$ | \n$\\var{t[3]}$ | \n$\\var{ssq[3]}$ | \n10 | \n
\n | \n | $G=\\;\\var{g}$ | \nSum of Squares=$\\var{ss}$ | \n$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}\\]
\nSecond Step.
\nNow 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.
\nNormal (Baseline and Stress) | \n$\\var{r1[0]}$ | \n$\\var{r1[1]}$ | \n$\\var{r1[2]}$ | \n$\\var{r1[3]}$ | \n$\\var{r1[4]}$ | \n$\\var{r1[5]}$ | \n$\\var{r1[6]}$ | \n$\\var{r1[7]}$ | \n$\\var{r1[8]}$ | \n$\\var{r1[9]}$ | \n$\\var{r2[0]}$ | \n$\\var{r2[1]}$ | \n$\\var{r2[2]}$ | \n$\\var{r2[3]}$ | \n$\\var{r2[4]}$ | \n$\\var{r2[5]}$ | \n$\\var{r2[6]}$ | \n$\\var{r2[7]}$ | \n$\\var{r2[8]}$ | \n$\\var{r2[9]}$ | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Antisocial (Baseline and Stress) | \n$\\var{r3[0]}$ | \n$\\var{r3[1]}$ | \n$\\var{r3[2]}$ | \n$\\var{r3[3]}$ | \n$\\var{r3[4]}$ | \n$\\var{r3[5]}$ | \n$\\var{r3[6]}$ | \n$\\var{r3[7]}$ | \n$\\var{r3[8]}$ | \n$\\var{r3[9]}$ | \n$\\var{r3[0]}$ | \n$\\var{r4[1]}$ | \n$\\var{r4[2]}$ | \n$\\var{r4[3]}$ | \n$\\var{r4[4]}$ | \n$\\var{r4[5]}$ | \n$\\var{r4[6]}$ | \n$\\var{r4[7]}$ | \n$\\var{r4[8]}$ | \n$\\var{r4[9]}$ | \n
You should have the following data from this table:
\n\n
\n | $T_i$ | \n$\\sum x^2$ | \n$n_i$ (number of observations) | \n
Normal, (Baseline and Stress) | \n$\\var{f1t[0]}$ | \n$\\var{f1ssq[0]}$ | \n20 | \n
---|---|---|---|
Antisocial, (Baseline and Stress) | \n$\\var{f1t[1]}$ | \n$\\var{f1ssq[1]}$ | \n20 | \n
\n | $G=\\;\\var{g}$ | \nSum of Squares=$\\var{f1ss}$ | \n$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}\\]
\nThird Step.
\nRepeat 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.
\nBaseline (Normal and Antisocial) | \n$\\var{r1[0]}$ | \n$\\var{r1[1]}$ | \n$\\var{r1[2]}$ | \n$\\var{r1[3]}$ | \n$\\var{r1[4]}$ | \n$\\var{r1[5]}$ | \n$\\var{r1[6]}$ | \n$\\var{r1[7]}$ | \n$\\var{r1[8]}$ | \n$\\var{r1[9]}$ | \n$\\var{r2[0]}$ | \n$\\var{r3[1]}$ | \n$\\var{r3[2]}$ | \n$\\var{r3[3]}$ | \n$\\var{r3[4]}$ | \n$\\var{r3[5]}$ | \n$\\var{r3[6]}$ | \n$\\var{r3[7]}$ | \n$\\var{r3[8]}$ | \n$\\var{r3[9]}$ | \n
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Stress (Normal and Antisocial) | \n$\\var{r2[0]}$ | \n$\\var{r2[1]}$ | \n$\\var{r2[2]}$ | \n$\\var{r2[3]}$ | \n$\\var{r2[4]}$ | \n$\\var{r2[5]}$ | \n$\\var{r2[6]}$ | \n$\\var{r2[7]}$ | \n$\\var{r2[8]}$ | \n$\\var{r2[9]}$ | \n$\\var{r4[0]}$ | \n$\\var{r4[1]}$ | \n$\\var{r4[2]}$ | \n$\\var{r4[3]}$ | \n$\\var{r4[4]}$ | \n$\\var{r4[5]}$ | \n$\\var{r4[6]}$ | \n$\\var{r4[7]}$ | \n$\\var{r4[8]}$ | \n$\\var{r4[9]}$ | \n
You should have the following data from this table:
\n\n
\n | $T_i$ | \n$\\sum x^2$ | \n$n_i$ (number of observations) | \n
Baseline (Normal and Antisocial) | \n$\\var{f2t[0]}$ | \n$\\var{f2ssq[0]}$ | \n20 | \n
---|---|---|---|
Stress (Normal and Antisocial) | \n$\\var{f2t[1]}$ | \n$\\var{f2ssq[1]}$ | \n20 | \n
\n | $G=\\;\\var{g}$ | \nSum of Squares=$\\var{f2ss}$ | \n$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}\\]
\nStep 4.
\nNow 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.
\nThis gives:
\n\\[\\mbox{Variance estimate for the interaction}= \\var{btss}-\\var{f1btss}-\\var{f2btss} = \\var{interactionss}\\]
\nThe Anova Table.
\nWe 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.
\nSource | df | SS | MS | VR | Decision |
---|---|---|---|---|---|
Personality | \n1 | \n$\\var{f1btss}$ | \n$\\var{f1btss}$ | \n$\\var{f1vr}$ | \n{dec(f1vr)} that GSR is independent of personality. | \n
Stimulus | \n1 | \n$\\var{f2btss}$ | \n$\\var{f2btss}$ | \n$\\var{f2vr}$ | \n{dec(f2vr)} that GSR is independent of the stimulus. | \n
P-S interaction | \n1 | \n$\\var{interactionss}$ | \n$\\var{interactionss}$ | \n$\\var{ivr}$ | \n{dec(ivr)} that personality and stimulus are independent in terms of GSR. | \n
Residual | \n36 | \n$\\var{rss}$ | \n$\\var{mrs}$ | \n- | \n\n |
Total | \n39 | \n$\\var{precround(f1btss+f2btss+interactionss+rss,2)}$ | \n- | \n- | \n\n |