// Numbas version: exam_results_page_options {"name": "LSD and Tukey yardsticks, and two-way ANOVA - SES2003", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "name": "LSD and Tukey yardsticks, and two-way ANOVA - SES2003", "parts": [{"sortAnswers": false, "prompt": "

Here is the ANOVA table corresponding to this data:

\n

 

\n \n \n \n \n \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
Between Treatments$\\var{m-1}$$\\var{btss}$$\\var{msbt}$$\\var{vr}$
Between Blocks$\\var{n-1}$$\\var{bbss}$$\\var{msbb}$$\\var{vrbb}$
Residual$\\var{dfr}$$\\var{rss}$$\\var{rs}$-
Total$\\var{m*n-1}$$\\var{tss}$--
\n

Input $\\sqrt{RMS}$ here: [[0]] to 2 decimal places.

\n

This will be used later to calculate the yardsticks.

", "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "gaps": [{"correctAnswerFraction": false, "maxValue": "sqrms+tol", "allowFractions": false, "correctAnswerStyle": "plain", "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "minValue": "sqrms-tol", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReducedPC": 0, "mustBeReduced": false, "customMarkingAlgorithm": "", "marks": 1, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": []}], "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "variableReplacements": []}, {"displayColumns": 1, "displayType": "radiogroup", "prompt": "

Given the value of $VR$ in the table above, find the range for the $p$ value by looking up the critical values of $F_{3,12}$ (one-sided).

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
$10\\%$$5\\%$$1\\%$$0.1\\%$
$2.61$$3.49$$5.95$$10.8$
", "maxMarks": 0, "choices": ["

$p$ less than $0.1\\%$

", "

$p$ lies between $0.1\\%$ and $1\\%$

", "

$p$ lies between $1 \\%$ and $5\\%$

", "

$p$ lies between $5 \\%$ and $10\\%$

", "

$p$ is greater than $10\\%$

"], "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "type": "1_n_2", "matrix": "v", "customMarkingAlgorithm": "", "shuffleChoices": false, "minMarks": 0, "extendBaseMarkingAlgorithm": true, "showCellAnswerState": true, "variableReplacements": []}, {"displayColumns": 0, "displayType": "radiogroup", "prompt": "

Given the $p$-value and the range you have found, what is the strength of evidence against the null hypothesis that there is no difference in the treatments offered by the creams?

", "maxMarks": 0, "choices": ["Very strong", "Strong", "Moderate", "Weak", "None"], "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "type": "1_n_2", "matrix": "v", "customMarkingAlgorithm": "", "shuffleChoices": false, "minMarks": 0, "extendBaseMarkingAlgorithm": true, "showCellAnswerState": true, "variableReplacements": []}, {"displayColumns": 1, "displayType": "radiogroup", "prompt": "

Hence what is your decision based on the above ANOVA analysis?

", "maxMarks": 0, "choices": ["We reject the null hypothesis at the $0.1\\%$ level", "We reject the null hypothesis at the $1\\%$ level.", "We reject the null hypothesis at the $5\\%$ level.", "We do not reject the null hypothesis but more investigation is needed.", "We do not reject the null hypothesis."], "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "type": "1_n_2", "matrix": "v", "customMarkingAlgorithm": "", "shuffleChoices": false, "minMarks": 0, "extendBaseMarkingAlgorithm": true, "showCellAnswerState": true, "variableReplacements": []}, {"sortAnswers": false, "prompt": "

Using the yardsticks

\n

Enter the sample means for the creams:

\n

W: [[0]], X:[[1]], Y:[[2]], Z:[[3]] (to 2 decimal places).

\n

Calclate the LSD and Tukey yardsticks using the value for $\\sqrt{RMS}$ to 2 decimal places obtained above.

\n

 

\n

LSD yardstick value =    [[4]] (to 2 decimal places).

\n

 

\n

Tukey yardstick value = [[5]] (to 2 decimal places).

\n

 

", "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "gaps": [{"correctAnswerFraction": false, "maxValue": "me[0]+tol", "allowFractions": false, "correctAnswerStyle": "plain", "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "minValue": "me[0]-tol", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReducedPC": 0, "mustBeReduced": false, "customMarkingAlgorithm": "", "marks": 0.5, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": []}, {"correctAnswerFraction": false, "maxValue": "me[1]+tol", "allowFractions": false, "correctAnswerStyle": "plain", "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "minValue": "me[1]-tol", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReducedPC": 0, "mustBeReduced": false, "customMarkingAlgorithm": "", "marks": 0.5, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": []}, {"correctAnswerFraction": false, "maxValue": "me[2]+tol", "allowFractions": false, "correctAnswerStyle": "plain", "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "minValue": "me[2]-tol", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReducedPC": 0, "mustBeReduced": false, "customMarkingAlgorithm": "", "marks": 0.5, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": []}, {"correctAnswerFraction": false, "maxValue": "me[3]+tol", "allowFractions": false, "correctAnswerStyle": "plain", "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "minValue": "me[3]-tol", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReducedPC": 0, "mustBeReduced": false, "customMarkingAlgorithm": "", "marks": 0.5, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": []}, {"correctAnswerFraction": false, "maxValue": "lsd+tol", "allowFractions": false, "correctAnswerStyle": "plain", "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "minValue": "lsd-tol", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReducedPC": 0, "mustBeReduced": false, "customMarkingAlgorithm": "", "marks": 1, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": []}, {"correctAnswerFraction": false, "maxValue": "tukey+tol", "allowFractions": false, "correctAnswerStyle": "plain", "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true, "scripts": {}, "minValue": "tukey-tol", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "mustBeReducedPC": 0, "mustBeReduced": false, "customMarkingAlgorithm": "", "marks": 1, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": []}], "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "variableReplacements": []}, {"prompt": "

Using these yardsticks fill in the following table indicating if there is a possible or definite significant difference between the sample means of pairs of creams.

\n

 

", "maxMarks": 0, "choices": ["$W$ and $X$", "$W$ and $Y$", "$W$ and $Z$", "$X$ and $Y$", "$X$ and $Z$", "$Y$ and $Z$"], "maxAnswers": 0, "showFeedbackIcon": true, "minAnswers": 0, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "matrix": "w", "marks": 0, "minMarks": 0, "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "displayType": "radiogroup", "unitTests": [], "scripts": {}, "showCorrectAnswer": true, "warningType": "none", "type": "m_n_x", "layout": {"type": "all", "expression": ""}, "answers": ["Definite Significant Difference", "Possible Significant Difference", "No Significant Difference"], "shuffleChoices": false, "showCellAnswerState": true, "shuffleAnswers": false}], "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": ["stats"], "functions": {"yeaornay": {"language": "jme", "definition": "if(n=1, \"Yes\", \"No\")", "type": "string", "parameters": [["n", "number"]]}}, "advice": "

 Using the Yardsticks

\n

The mean values for each cream are:

\n

  

\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$
W$\\var{me[0]}$
X$\\var{me[1]}$
Y$\\var{me[2]}$
Z$\\var{me[3]}$
\n

The differences between the mean values for the creams are:

\n

Between $W$ and $X=\\;|\\var{me[0]}-\\var{me[1]}|=\\var{abs(me[0]-me[1])}$

\n

Between $W$ and $Y=\\;|\\var{me[0]}-\\var{me[2]}|=\\var{abs(me[0]-me[2])}$

\n

Between $W$ and $Z=\\;|\\var{me[0]}-\\var{me[3]}|=\\var{abs(me[0]-me[3])}$

\n

Between $X$ and $Y=\\;|\\var{me[1]}-\\var{me[2]}|=\\var{abs(me[1]-me[2])}$

\n

Between $X$ and $Z=\\;|\\var{me[1]}-\\var{me[3]}|=\\var{abs(me[1]-me[3])}$

\n

Between $Y$ and $Z=\\;|\\var{me[2]}-\\var{me[3]}|=\\var{abs(me[2]-me[3])}$

\n

We compare these differences with the LSD and Tukey yardsticks:

\n

LSD yardstick = $2.179\\times\\var{sqrms}\\times\\sqrt{2/\\var{n}}=\\var{lsd}$ to 2 decimal places, where $\\var{sqrms}$ is the value of $\\sqrt{RMS}$ found above.

\n

Tukey yardstick = $4.2\\times\\var{sqrms}\\times\\sqrt{1/\\var{n}}=\\var{tukey}$ to 2 decimal places.

\n

If the difference of the means:

\n\n

 

\n\n

 

\n\n

 

\n

Hence we have the following for the creams:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Pairs of creamsDefinite Significant DifferencePossible Significant DifferenceNo Significant Difference
Means of W and X{yn[0][0]}{yn[0][1]}{yn[0][2]}
Means of W and Y{yn[1][0]}{yn[1][1]}{yn[1][2]}
Means of W and Z{yn[2][0]}{yn[2][1]}{yn[2][2]}
Means of X and Y{yn[3][0]}{yn[3][1]}{yn[3][2]}
Means of X and Z{yn[4][0]}{yn[4][1]}{yn[4][2]}
Means of Y and Z{yn[5][0]}{yn[5][1]}{yn[5][2]}
", "rulesets": {}, "metadata": {"description": "

LSD and Tukey yardsticks on five treatments. Also two-way Anova test on same set of data.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

To test the effectiveness of pain-relief creams on back pain, five volunteers (A-E) suffering with back pain tried each of four creams (W-Z). The degree of pain relief was measured on a 0-50 scale (higher figures indicate higher levels of pain relief). The results are given below with some totals:

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
 ABCDETotals
W{r[0][0]}{r[1][0]}{r[2][0]}{r[3][0]}{r[4][0]}{cols[0]}
X{r[0][1]}{r[1][1]}{r[2][1]}{r[3][1]}{r[4][1]}{cols[1]}
Y{r[0][2]}{r[1][2]}{r[2][2]}{r[3][2]}{r[4][2]}{cols[2]}
Z{r[0][3]}{r[1][3]}{r[2][3]}{r[3][3]}{r[4][3]}{cols[3]}
Totals{t[0]}{t[1]}{t[2]}{t[3]}{t[4]}{tot}
\n

\n\n", "variables": {"rt": {"templateType": "anything", "description": "", "definition": "list(transpose(matrix(r)))", "name": "rt", "group": "Ungrouped variables"}, "sqrms": {"templateType": "anything", "description": "", "definition": "precround(sqrt(rs),2)", "name": "sqrms", "group": "Ungrouped variables"}, "me": {"templateType": "anything", "description": "", "definition": "map(mean(r1[x]),x,0..3)", "name": "me", "group": "Ungrouped variables"}, "msbt": {"templateType": "anything", "description": "", "definition": "precround(btss/(m-1),2)", "name": "msbt", "group": "Ungrouped variables"}, "btss": {"templateType": "anything", "description": "", "definition": "precround(sum(map(x^2,x,cols))/n-tot^2/(m*n),2)", "name": "btss", "group": "Ungrouped variables"}, "r1": {"templateType": "anything", "description": "", "definition": "map(repeat(round(normalsample(mu[x],sig)),5),x,0..m-1)", "name": "r1", "group": "Ungrouped variables"}, "yn": {"templateType": "anything", "description": "", "definition": "map(map(yeaornay(x),x,w[z]),z,0..5)", "name": "yn", "group": "Ungrouped variables"}, "w3": {"templateType": "anything", "description": "", "definition": "switch(abs(me[0]-me[3])>=tukey,[1,0,0],abs(me[0]-me[3])>=lsd,[0,1,0],[0,0,1])", "name": "w3", "group": "Ungrouped variables"}, "t95": {"templateType": "anything", "description": "", "definition": "15.51", "name": "t95", "group": "Ungrouped variables"}, "stderror": {"templateType": "anything", "description": "", "definition": "precround(sqrt(rs/n),2)", "name": "stderror", "group": "Ungrouped variables"}, "ssq": {"templateType": "anything", "description": "", "definition": "sum(map(sum(map(x^2,x,r[y])),y,0..n-1))", "name": "ssq", "group": "Ungrouped variables"}, "w6": {"templateType": "anything", "description": "", "definition": "switch(abs(me[2]-me[3])>=tukey,[1,0,0],abs(me[2]-me[3])>=lsd,[0,1,0],[0,0,1])", "name": "w6", "group": "Ungrouped variables"}, "t90": {"templateType": "anything", "description": "", "definition": "13.36", "name": "t90", "group": "Ungrouped variables"}, "m": {"templateType": "anything", "description": "", "definition": "4", "name": "m", "group": "Ungrouped variables"}, "dfr": {"templateType": "anything", "description": "", "definition": "m*n-m-n+1", "name": "dfr", "group": "Ungrouped variables"}, "vr": {"templateType": "anything", "description": "", "definition": "precround(msbt/rs,2)", "name": "vr", "group": "Ungrouped variables"}, "w2": {"templateType": "anything", "description": "", "definition": "switch(abs(me[0]-me[2])>=tukey,[1,0,0],abs(me[0]-me[2])>=lsd,[0,1,0],[0,0,1])", "name": "w2", "group": "Ungrouped variables"}, "t99": {"templateType": "anything", "description": "", "definition": "20.09", "name": "t99", "group": "Ungrouped variables"}, "r": {"templateType": "anything", "description": "", "definition": "list(transpose(matrix(r1)))", "name": "r", "group": "Ungrouped variables"}, "pvalue": {"templateType": "anything", "description": "", "definition": "precround(ftest(VR,3,12),3)", "name": "pvalue", "group": "Ungrouped variables"}, "rss": {"templateType": "anything", "description": "", "definition": "tss-btss-bbss", "name": "rss", "group": "Ungrouped variables"}, "dfbt": {"templateType": "anything", "description": "", "definition": "m-1", "name": "dfbt", "group": "Ungrouped variables"}, "rs": {"templateType": "anything", "description": "", "definition": "precround(rss/dfr,2)", "name": "rs", "group": "Ungrouped variables"}, "tol": {"templateType": "anything", "description": "", "definition": "0.01", "name": "tol", "group": "Ungrouped variables"}, "v1": {"templateType": "anything", "description": "", "definition": "switch(pvalue<=0.001,[1,0,0,0,0],pvalue<=0.01,[0,1,0,0,0],pvalue<=0.05,[0,0,1,0,0],pvalue<=0.1,[0,0,0,1,0],[0,0,0,0,1])", "name": "v1", "group": "Ungrouped variables"}, "tot": {"templateType": "anything", "description": "", "definition": "sum(cols)", "name": "tot", "group": "Ungrouped variables"}, "bbss": {"templateType": "anything", "description": "", "definition": "precround(sum(map(x^2,x,t))/m-tot^2/20,2)", "name": "bbss", "group": "Ungrouped variables"}, "dfbb": {"templateType": "anything", "description": "", "definition": "n-1", "name": "dfbb", "group": "Ungrouped variables"}, "w4": {"templateType": "anything", "description": "", "definition": "switch(abs(me[1]-me[2])>=tukey,[1,0,0],abs(me[1]-me[2])>=lsd,[0,1,0],[0,0,1])", "name": "w4", "group": "Ungrouped variables"}, "w5": {"templateType": "anything", "description": "", "definition": "switch(abs(me[1]-me[3])>=tukey,[1,0,0],abs(me[1]-me[3])>=lsd,[0,1,0],[0,0,1])", "name": "w5", "group": "Ungrouped variables"}, "lsd": {"templateType": "anything", "description": "", "definition": "precround(2.179*sqrms*sqrt(2/5),2)", "name": "lsd", "group": "Ungrouped variables"}, "tss": {"templateType": "anything", "description": "", "definition": "precround(ssq-tot^2/(m*n),2)", "name": "tss", "group": "Ungrouped variables"}, "msbb": {"templateType": "anything", "description": "", "definition": "precround(bbss/(n-1),2)", "name": "msbb", "group": "Ungrouped variables"}, "w1": {"templateType": "anything", "description": "", "definition": "switch(abs(me[0]-me[1])>=tukey,[1,0,0],abs(me[0]-me[1])>=lsd,[0,1,0],[0,0,1])", "name": "w1", "group": "Ungrouped variables"}, "tukey": {"templateType": "anything", "description": "", "definition": "precround(4.2*sqrms*sqrt(1/5),2)", "name": "tukey", "group": "Ungrouped variables"}, "cols": {"templateType": "anything", "description": "", "definition": "map(sum(rt[x]),x,0..m-1)", "name": "cols", "group": "Ungrouped variables"}, "n": {"templateType": "anything", "description": "", "definition": "5", "name": "n", "group": "Ungrouped variables"}, "w": {"templateType": "anything", "description": "", "definition": "[w1,w2,w3,w4,w5,w6]", "name": "w", "group": "Ungrouped variables"}, "v": {"templateType": "anything", "description": "", "definition": "switch(vr>=10.8,[1,0,0,0,0],vr>=5.95,[0,1,0,0,0],vr>=3.49,[0,0,1,0,0],vr>=2.61,[0,0,0,1,0],[0,0,0,0,1])", "name": "v", "group": "Ungrouped variables"}, "sig": {"templateType": "anything", "description": "", "definition": "random(3..7#0.2)", "name": "sig", "group": "Ungrouped variables"}, "t": {"templateType": "anything", "description": "", "definition": "map(sum(r[x]),x,0..n-1)", "name": "t", "group": "Ungrouped variables"}, "mu": {"templateType": "anything", "description": "", "definition": "[random(30..40),random(35..40),random(25..35),random(40..45),random(20..40)]", "name": "mu", "group": "Ungrouped variables"}, "vrbb": {"templateType": "anything", "description": "", "definition": "precround(msbb/rs,2)", "name": "vrbb", "group": "Ungrouped variables"}}, "preamble": {"js": "", "css": ""}, "tags": [], "ungrouped_variables": ["lsd", "tukey", "stderror", "bbss", "cols", "vrbb", "w6", "vr", "w4", "w3", "w2", "w1", "dfr", "rt", "rs", "t90", "tot", "sqrms", "sig", "tol", "btss", "tss", "dfbt", "yn", "msbt", "ssq", "v1", "dfbb", "t99", "t95", "msbb", "rss", "me", "r1", "m", "w5", "n", "mu", "r", "t", "w", "v", "pvalue"], "type": "question", "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}