// Numbas version: finer_feedback_settings {"name": "Perform a one-sample t-test", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Perform a one-sample t-test", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "
The following is a set of BMIs (Body Mass Index) for $\\var{sample_size}$ overweight children aged $5$.
\nThe data is thought to follow a normal distribution.
\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{r1[10]}$ | \n$\\var{r1[11]}$ | \n$\\var{r1[12]}$ | \n$\\var{r1[13]}$ | \n$\\var{r1[14]}$ | \n
Using a one sample $t$-test, test the hypothesis that the population mean equals $\\var{mu_hyp}$ .
", "advice": "The sample mean, $\\bar{x}$, is given by
\n\\[ \\bar{x}= \\sum_{i=1}^{15} \\frac{x_i}{15} = \\var{dpformat(sample_mean,2)}\\text{,} \\]
\nto 2 decimal places.
\nThe sample standard deviation, $s$, is given by
\n\\[ s = \\sqrt{\\frac{\\left (\\sum (x-\\bar{x})^2\\right)}{n-1}} = \\var{dpformat(sample_stdev,2)}\\text{,} \\]
\nto 2 decimal places.
\nThe t-test statistic is
\n\\[|{T}| = \\frac{| \\var{dpformat(sample_mean,2)}-\\var{mu_hyp}|}{\\var{dpformat(sample_stdev,2)}/\\sqrt{\\var{sample_size}}}
= \\var{dpformat(abs({test_statistic}),2)}\\text{,} \\]
to 2 decimal places.
\nThe hypotheses that we are testing are:
\n\\begin{align}
H_0: \\mu &=\\var{mu_hyp}\\text{,} \\\\
H_1: \\mu &\\neq \\var{mu_hyp}\\text{.}
\\end{align}
The t-table values will be for a two-tailed test and will have $ n-1 = 14$ degrees of freedom:
\n\\[\\begin{array}{r|rrrr}&0.10&0.05&0.01\\\\\\hline14&\\var{t90}&\\var{t95}&\\var{t99}\\end{array}\\]
\nIf $ |T| < t_{\\simplify{{sample_size}-1}}(0.1) $, then the test is not significant at the 10% level.
\nIf $ t_{\\simplify{{sample_size}-1}}(0.1) < |T| < t_{\\simplify{{sample_size}-1}}(0.05) $, then the test is significant at the 10% level but not the 5% level.
\nIf $ t_{\\simplify{{sample_size}-1}}(0.05) < |T| < t_{\\simplify{{sample_size}-1}}(0.01) $, then the test is significant at the 5% level but not the 1% level.
\nIf $ |T| > t_{\\simplify{{sample_size}-1}}(0.01) $, then the test is significant at the 1% level.
\nIf the test is not significant at the 5% level, then we do not reject $ H_0$, otherwise we reject $H_0$.
\n", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"t95": {"name": "t95", "group": "t-test table values", "definition": "2.145", "description": "", "templateType": "number", "can_override": false}, "t90": {"name": "t90", "group": "t-test table values", "definition": "1.761", "description": "", "templateType": "number", "can_override": false}, "sample_size": {"name": "sample_size", "group": "Data given", "definition": "15", "description": "The number of data values given to the student
", "templateType": "number", "can_override": false}, "sample_mean": {"name": "sample_mean", "group": "Summary Statistics", "definition": "mean(r1)", "description": "", "templateType": "anything", "can_override": false}, "mu_hyp": {"name": "mu_hyp", "group": "Ungrouped variables", "definition": "random(16..18)", "description": "", "templateType": "anything", "can_override": false}, "reject_matrix": {"name": "reject_matrix", "group": "Ungrouped variables", "definition": "if(scenario<2,[1,0],[0,1])", "description": "", "templateType": "anything", "can_override": false}, "decision_matrix": {"name": "decision_matrix", "group": "Ungrouped variables", "definition": "[\n [1,0,0,0],\n [0,1,0,0],\n [0,0,1,0],\n [0,0,0,1]\n][scenario]", "description": "", "templateType": "anything", "can_override": false}, "sample_stdev": {"name": "sample_stdev", "group": "Summary Statistics", "definition": "stdev(r1,true)", "description": "", "templateType": "anything", "can_override": false}, "t99": {"name": "t99", "group": "t-test table values", "definition": "2.977", "description": "", "templateType": "number", "can_override": false}, "r1": {"name": "r1", "group": "Data given", "definition": "repeat(precround(normalsample(mu1,sigm1),2),sample_size)", "description": "the BMI data
", "templateType": "anything", "can_override": false}, "t999": {"name": "t999", "group": "t-test table values", "definition": "4.14", "description": "", "templateType": "number", "can_override": false}, "test_statistic": {"name": "test_statistic", "group": "Ungrouped variables", "definition": "(precround(sample_mean,2)-mu_hyp)/(precround(sample_stdev,2)/sqrt(sample_size))", "description": "t
", "templateType": "anything", "can_override": false}, "scenario": {"name": "scenario", "group": "Ungrouped variables", "definition": "sum(map(if(abs(test_statistic)>x,1,0),x,[t90,t95,t99]))", "description": "", "templateType": "anything", "can_override": false}, "sigm1": {"name": "sigm1", "group": "Ungrouped variables", "definition": "random(0.5 .. 1#0.05)", "description": "", "templateType": "randrange", "can_override": false}, "mu1": {"name": "mu1", "group": "Ungrouped variables", "definition": "random(17 .. 17.5#0.01)", "description": "", "templateType": "randrange", "can_override": false}, "abs": {"name": "abs", "group": "Ungrouped variables", "definition": "abs(test_statistic)", "description": "Absolute value of the test statistic.
", "templateType": "anything", "can_override": false}, "test": {"name": "test", "group": "Data given", "definition": "repeat(precround(normalsample(mu1,sigm1),2),sample_size)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["mu1", "sigm1", "mu_hyp", "test_statistic", "scenario", "decision_matrix", "reject_matrix", "abs"], "variable_groups": [{"name": "t-test table values", "variables": ["t95", "t99", "t999", "t90"]}, {"name": "Data given", "variables": ["sample_size", "r1", "test"]}, {"name": "Summary Statistics", "variables": ["sample_stdev", "sample_mean"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Calculate the sample mean, $\\bar{x}$.
\n$\\bar{x} = $ [[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "sample_mean", "maxValue": "sample_mean", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Calculate the sample standard deviation, $s$.
\n$s = $ [[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "sample_stdev", "maxValue": "sample_stdev", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Use your rounded answers above to calculate the $t$-test statistic $\\left|T\\right|$.
\n$\\left|T\\right|=$ [[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "abs{test_statistic}", "maxValue": "abs{test_statistic}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Using t-tables, compare your test statistic to the appropriate t-value, taking into account the correct degrees of freedom. What is the correct significance level?
", "minMarks": "2", "maxMarks": "2", "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": "1", "showCellAnswerState": true, "choices": ["The test is not significant at the 10% level.", "The test is significant at the 10% level, but not the 5% level.", "The test is significant at the 5% level, but not the 1% level.", "The test is significant at the 1% level."], "matrix": "decision_matrix"}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Use your answer to part (d) to select one of the following statements that best describes your conclusion.
", "minMarks": "2", "maxMarks": "2", "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": "1", "showCellAnswerState": true, "choices": ["Do not reject the Null Hypothesis.
", "Reject the Null Hypothesis.
"], "matrix": "reject_matrix"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Vicky Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/659/"}, {"name": "George Stagg", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/930/"}, {"name": "Lauren Frances Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2490/"}, {"name": "Tom Lowe", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/9601/"}, {"name": "Pete Philipson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/13881/"}]}]}], "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Vicky Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/659/"}, {"name": "George Stagg", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/930/"}, {"name": "Lauren Frances Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2490/"}, {"name": "Tom Lowe", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/9601/"}, {"name": "Pete Philipson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/13881/"}]}