// Numbas version: finer_feedback_settings {"name": "LSD and Tukey yardsticks, and two-way ANOVA - Mock - SES2003", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "
LSD and Tukey yardsticks on five treatments. Also two-way Anova test on same set of data.
"}, "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"], "variable_groups": [], "variables": {"w1": {"definition": "switch(abs(me[0]-me[1])>=tukey,[0.5,0,0],abs(me[0]-me[1])>=lsd,[0,0.5,0],[0,0,0.5])", "name": "w1", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "yn": {"definition": "map(map(yeaornay(x),x,w[z]),z,0..5)", "name": "yn", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "ssq": {"definition": "sum(map(sum(map(x^2,x,r[y])),y,0..n-1))", "name": "ssq", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "w3": {"definition": "switch(abs(me[0]-me[3])>=tukey,[0.5,0,0],abs(me[0]-me[3])>=lsd,[0,0.5,0],[0,0,0.5])", "name": "w3", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "dfbt": {"definition": "m-1", "name": "dfbt", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "w6": {"definition": "switch(abs(me[2]-me[3])>=tukey,[0.5,0,0],abs(me[2]-me[3])>=lsd,[0,0.5,0],[0,0,0.5])", "name": "w6", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "rs": {"definition": "precround(rss/dfr,2)", "name": "rs", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "w": {"definition": "[w1,w2,w3,w4,w5,w6]", "name": "w", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "t99": {"definition": "20.09", "name": "t99", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "rss": {"definition": "tss-btss-bbss", "name": "rss", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "lsd": {"definition": "precround(2.179*sqrms*sqrt(2/5),2)", "name": "lsd", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "w4": {"definition": "switch(abs(me[1]-me[2])>=tukey,[0.5,0,0],abs(me[1]-me[2])>=lsd,[0,0.5,0],[0,0,0.5])", "name": "w4", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "msbb": {"definition": "precround(bbss/(n-1),2)", "name": "msbb", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "msbt": {"definition": "precround(btss/(m-1),2)", "name": "msbt", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "t95": {"definition": "15.51", "name": "t95", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "v1": {"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", "description": "", "templateType": "anything"}, "vrbb": {"definition": "precround(msbb/rs,2)", "name": "vrbb", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "m": {"definition": "4", "name": "m", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "t90": {"definition": "13.36", "name": "t90", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "tot": {"definition": "sum(cols)", "name": "tot", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "rt": {"definition": "list(transpose(matrix(r)))", "name": "rt", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "sqrms": {"definition": "precround(sqrt(rs),2)", "name": "sqrms", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "me": {"definition": "map(mean(r1[x]),x,0..3)", "name": "me", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "n": {"definition": "5", "name": "n", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "pvalue": {"definition": "precround(ftest(VR,3,12),3)", "name": "pvalue", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "cols": {"definition": "map(sum(rt[x]),x,0..m-1)", "name": "cols", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "stderror": {"definition": "precround(sqrt(rs/n),2)", "name": "stderror", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "dfbb": {"definition": "n-1", "name": "dfbb", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "tss": {"definition": "precround(ssq-tot^2/(m*n),2)", "name": "tss", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "tukey": {"definition": "precround(4.2*sqrms*sqrt(1/5),2)", "name": "tukey", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "btss": {"definition": "precround(sum(map(x^2,x,cols))/n-tot^2/(m*n),2)", "name": "btss", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "r": {"definition": "list(transpose(matrix(r1)))", "name": "r", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "bbss": {"definition": "precround(sum(map(x^2,x,t))/m-tot^2/20,2)", "name": "bbss", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "r1": {"definition": "map(repeat(round(normalsample(mu[x],sig)),5),x,0..m-1)", "name": "r1", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "w2": {"definition": "switch(abs(me[0]-me[2])>=tukey,[0.5,0,0],abs(me[0]-me[2])>=lsd,[0,0.5,0],[0,0,0.5])", "name": "w2", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "tol": {"definition": "0.01", "name": "tol", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "vr": {"definition": "precround(msbt/rs,2)", "name": "vr", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "dfr": {"definition": "m*n-m-n+1", "name": "dfr", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "t": {"definition": "map(sum(r[x]),x,0..n-1)", "name": "t", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "w5": {"definition": "switch(abs(me[1]-me[3])>=tukey,[0.5,0,0],abs(me[1]-me[3])>=lsd,[0,0.5,0],[0,0,0.5])", "name": "w5", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "sig": {"definition": "random(3..7#0.2)", "name": "sig", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "v": {"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", "description": "", "templateType": "anything"}, "mu": {"definition": "[random(30..40),random(35..40),random(25..35),random(40..45),random(20..40)]", "name": "mu", "group": "Ungrouped variables", "description": "", "templateType": "anything"}}, "name": "LSD and Tukey yardsticks, and two-way ANOVA - Mock - SES2003", "parts": [{"showCorrectAnswer": true, "gaps": [{"showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "n-1", "unitTests": [], "scripts": {}, "notationStyles": ["plain", "en", "si-en"], "minValue": "n-1", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "mustBeReduced": false, "marks": "0.5", "mustBeReducedPC": 0, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "type": "numberentry"}, {"showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "m*n-1", "unitTests": [], "scripts": {}, "notationStyles": ["plain", "en", "si-en"], "minValue": "m*n-1", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "mustBeReduced": false, "marks": "0.5", "mustBeReducedPC": 0, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "type": "numberentry"}, {"type": "numberentry", "unitTests": [], "strictPrecision": false, "precision": "2", "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "minValue": "bbss-tol", "customMarkingAlgorithm": "", "precisionMessage": "You have not given your answer to the correct precision.", "precisionPartialCredit": 0, "showFeedbackIcon": true, "scripts": {}, "mustBeReducedPC": 0, "showCorrectAnswer": true, "mustBeReduced": false, "correctAnswerStyle": "plain", "maxValue": "bbss+tol", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "precisionType": "dp", "correctAnswerFraction": false, "marks": "0.5", "allowFractions": false, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "unitTests": [], "strictPrecision": false, "precision": "2", "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "minValue": "vr-tol", "customMarkingAlgorithm": "", "precisionMessage": "You have not given your answer to the correct precision.", "precisionPartialCredit": 0, "showFeedbackIcon": true, "scripts": {}, "mustBeReducedPC": 0, "showCorrectAnswer": true, "mustBeReduced": false, "correctAnswerStyle": "plain", "maxValue": "vr+tol", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "precisionType": "dp", "correctAnswerFraction": false, "marks": "0.5", "allowFractions": false, "variableReplacementStrategy": "originalfirst"}], "showFeedbackIcon": true, "unitTests": [], "scripts": {}, "type": "gapfill", "customMarkingAlgorithm": "", "prompt": "Complete the ANOVA table corresponding to this data, entering values to 2 decimal places.
\nSource | \ndf | \nSS | \nMS | \nVR | \n
---|---|---|---|---|
Between Treatments | \n$\\var{m-1}$ | \n$\\var{btss}$ | \n$\\var{msbt}$ | \n[[3]] | \n
Between Blocks | \n[[0]] | \n[[2]] | \n$\\var{msbb}$ | \n$\\var{vrbb}$ | \n
Residual | \n$\\var{dfr}$ | \n$\\var{rss}$ | \n$\\var{rs}$ | \n- | \n
Total | \n[[1]] | \n$\\var{tss}$ | \n- | \n- | \n
$\\sqrt{RMS}=\\var{sqrms}$ to 2 decimal places. This will be used later to calculate the yardsticks.
", "marks": 0, "sortAnswers": false, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst"}, {"displayColumns": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "unitTests": [], "scripts": {}, "matrix": "v", "displayType": "radiogroup", "shuffleChoices": false, "type": "1_n_2", "customMarkingAlgorithm": "", "minMarks": 0, "prompt": "Given the value of $VR$ in the table above, find the range for the $p$ value by using the critical values of $F_{3,12}$ (one-sided) below.
\n$10\\%$ | \n$5\\%$ | \n$1\\%$ | \n$0.1\\%$ | \n
$2.61$ | \n$3.49$ | \n$5.95$ | \n$10.8$ | \n
$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\\%$
"], "extendBaseMarkingAlgorithm": true, "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst"}, {"displayColumns": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "unitTests": [], "scripts": {}, "matrix": "v", "displayType": "radiogroup", "shuffleChoices": false, "type": "1_n_2", "customMarkingAlgorithm": "", "minMarks": 0, "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?
", "marks": 0, "maxMarks": 0, "variableReplacements": [], "choices": ["Very strong", "Strong", "Moderate", "Weak", "None"], "extendBaseMarkingAlgorithm": true, "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst"}, {"displayColumns": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "unitTests": [], "scripts": {}, "matrix": "v", "displayType": "radiogroup", "shuffleChoices": false, "type": "1_n_2", "customMarkingAlgorithm": "", "minMarks": 0, "prompt": "Hence what is your decision based on the above ANOVA analysis?
", "marks": 0, "maxMarks": 0, "variableReplacements": [], "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."], "extendBaseMarkingAlgorithm": true, "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst"}, {"showCorrectAnswer": true, "gaps": [{"showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "lsd+tol", "unitTests": [], "scripts": {}, "notationStyles": ["plain", "en", "si-en"], "minValue": "lsd-tol", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "mustBeReduced": false, "marks": 1, "mustBeReducedPC": 0, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "type": "numberentry"}, {"showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "tukey+tol", "unitTests": [], "scripts": {}, "notationStyles": ["plain", "en", "si-en"], "minValue": "tukey-tol", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "mustBeReduced": false, "marks": 1, "mustBeReducedPC": 0, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "type": "numberentry"}], "showFeedbackIcon": true, "unitTests": [], "scripts": {}, "type": "gapfill", "customMarkingAlgorithm": "", "prompt": "Using the yardsticks
\nThe sample means for the creams are
\nW: {me[0]}, X: {me[1]}, Y: {me[2]}, Z: {me[3]}
\nUsing $q_{t,\\nu}(\\alpha) =4.2$, $t_{\\nu}(\\alpha) =2.179$ and the value for $\\sqrt{RMS}$ above, calculate the LSD and Tukey yardstick.
\nLSD yardstick value = [[0]] (to 2 decimal places).
\nTukey yardstick value = [[1]] (to 2 decimal places).
\n", "marks": 0, "sortAnswers": false, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst"}, {"unitTests": [], "warningType": "none", "minMarks": 0, "shuffleAnswers": false, "customMarkingAlgorithm": "", "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", "showFeedbackIcon": true, "choices": ["$W$ and $X$", "$W$ and $Y$", "$W$ and $Z$", "$X$ and $Y$", "$X$ and $Z$", "$Y$ and $Z$"], "scripts": {}, "showCorrectAnswer": true, "minAnswers": 0, "variableReplacements": [], "answers": ["Definite Significant Difference", "Possible Significant Difference", "No Significant Difference"], "layout": {"type": "all", "expression": ""}, "maxAnswers": 0, "displayType": "radiogroup", "type": "m_n_x", "shuffleChoices": false, "extendBaseMarkingAlgorithm": true, "marks": 0, "maxMarks": "0", "matrix": "w", "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst"}], "rulesets": {}, "preamble": {"css": "", "js": ""}, "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 | A | \nB | \nC | \nD | \nE | \nTotals | \n
W | \n{r[0][0]} | \n{r[1][0]} | \n{r[2][0]} | \n{r[3][0]} | \n{r[4][0]} | \n{cols[0]} | \n
X | \n{r[0][1]} | \n{r[1][1]} | \n{r[2][1]} | \n{r[3][1]} | \n{r[4][1]} | \n{cols[1]} | \n
Y | \n{r[0][2]} | \n{r[1][2]} | \n{r[2][2]} | \n{r[3][2]} | \n{r[4][2]} | \n{cols[2]} | \n
Z | \n{r[0][3]} | \n{r[1][3]} | \n{r[2][3]} | \n{r[3][3]} | \n{r[4][3]} | \n{cols[3]} | \n
Totals | \n{t[0]} | \n{t[1]} | \n{t[2]} | \n{t[3]} | \n{t[4]} | \n{tot} | \n
The mean values for each cream are:
\n\n
\n | $\\overline{x}_i$ | \n
W | \n$\\var{me[0]}$ | \n
---|---|
X | \n$\\var{me[1]}$ | \n
Y | \n$\\var{me[2]}$ | \n
Z | \n$\\var{me[3]}$ | \n
The differences between the mean values for the creams are:
\nBetween $W$ and $X=\\;|\\var{me[0]}-\\var{me[1]}|=\\var{abs(me[0]-me[1])}$
\nBetween $W$ and $Y=\\;|\\var{me[0]}-\\var{me[2]}|=\\var{abs(me[0]-me[2])}$
\nBetween $W$ and $Z=\\;|\\var{me[0]}-\\var{me[3]}|=\\var{abs(me[0]-me[3])}$
\nBetween $X$ and $Y=\\;|\\var{me[1]}-\\var{me[2]}|=\\var{abs(me[1]-me[2])}$
\nBetween $X$ and $Z=\\;|\\var{me[1]}-\\var{me[3]}|=\\var{abs(me[1]-me[3])}$
\nBetween $Y$ and $Z=\\;|\\var{me[2]}-\\var{me[3]}|=\\var{abs(me[2]-me[3])}$
\nWe compare these differences with the LSD and Tukey yardsticks:
\nLSD 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.
\nTukey yardstick = $4.2\\times\\var{sqrms}\\times\\sqrt{1/\\var{n}}=\\var{tukey}$ to 2 decimal places.
\nIf the difference of the means:
\n\n
\n
\n
Hence we have the following for the creams:
\nPairs of creams | \nDefinite Significant Difference | \nPossible Significant Difference | \nNo Significant Difference | \n
---|---|---|---|
Means of W and X | \n{yn[0][0]} | \n{yn[0][1]} | \n{yn[0][2]} | \n
Means of W and Y | \n{yn[1][0]} | \n{yn[1][1]} | \n{yn[1][2]} | \n
Means of W and Z | \n{yn[2][0]} | \n{yn[2][1]} | \n{yn[2][2]} | \n
Means of X and Y | \n{yn[3][0]} | \n{yn[3][1]} | \n{yn[3][2]} | \n
Means of X and Z | \n{yn[4][0]} | \n{yn[4][1]} | \n{yn[4][2]} | \n
Means of Y and Z | \n{yn[5][0]} | \n{yn[5][1]} | \n{yn[5][2]} | \n