// Numbas version: finer_feedback_settings {"name": "One-sample test: lead concentration", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "One-sample test: lead concentration", "tags": [], "metadata": {"description": "

This question assesses the learner's ability of calculating confidence intervals for numerical data and conducting a one-sample t-test.

\n

Randomized input values: sample summary statistics and confidence level.

\n

Adapted from question 7.12 in OpenIntro Statistics (4th ed).

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

Consider a random sample of $\\var{n}$ traffic officers, who regularly inhale high levels of car exhaust fumes as part of their job. Blood samples from these officers show an average lead concentration of $\\var{mean}$ $\\mu$g/l and a standard deviation of $\\var{sd}$ $\\mu$g/l. A previous study of individuals with no history of high exposure to car fumes found an average blood level concentration of $\\var{mu0}$ $\\mu$g/l. Consider a proposed hypothesis that traffic officers are exposed to significantly different concentrations of lead than normal.

", "advice": "

Revise the one-sample t-test, e.g., Section 7.1 of OpenIntro Statistics (4th edition).

\n

a) The standard error (SE) is:

\n

$SE=\\frac{SD}{\\sqrt{n}}$

\n

with $SD$ the standard deviation and $n$ the sample size.

\n

b) The appropriate $t^*$ can be obtained using the Excel function T.INV.2T, with $df=n-1$.

\n

c) The $T$ statistic is:

\n

$T=\\frac{\\bar{x}-\\mu_0}{SE}$

\n

with $\\bar{x}$ the sample mean and $\\mu_0$ the hypothesized mean.

\n

d) The $p$-value can be calculated with the Excel function T.DIST.2T, with the $T$ statistic and the number of degrees of freedom as arguments.

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"se": {"name": "se", "group": "Ungrouped variables", "definition": "siground(sd/sqrt(n),3)", "description": "", "templateType": "anything", "can_override": false}, "T": {"name": "T", "group": "Ungrouped variables", "definition": "siground((mean-mu0)/se,3)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(10..50)", "description": "", "templateType": "anything", "can_override": false}, "mu0": {"name": "mu0", "group": "Ungrouped variables", "definition": "random(30..40)", "description": "", "templateType": "anything", "can_override": false}, "tol": {"name": "tol", "group": "Ungrouped variables", "definition": "0.05", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "siground(ttest(T,n,2),3)", "description": "", "templateType": "anything", "can_override": false}, "ciUpper": {"name": "ciUpper", "group": "Ungrouped variables", "definition": "siground(mean+tStar*SE,3)", "description": "", "templateType": "anything", "can_override": false}, "ciLower": {"name": "ciLower", "group": "Ungrouped variables", "definition": "siground(mean-tStar*SE,3)", "description": "", "templateType": "anything", "can_override": false}, "tStar": {"name": "tStar", "group": "Ungrouped variables", "definition": "siground(studenttinv(0.5*(100-CL)/100,n-1),3)", "description": "

Critical t-value

", "templateType": "anything", "can_override": false}, "mean": {"name": "mean", "group": "Ungrouped variables", "definition": "random(41..50)", "description": "", "templateType": "anything", "can_override": false}, "CL": {"name": "CL", "group": "Ungrouped variables", "definition": "random(90,95,99)", "description": "

Confidence level.

", "templateType": "anything", "can_override": false}, "sd": {"name": "sd", "group": "Ungrouped variables", "definition": "random(30..50)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "mu0", "mean", "sd", "CL", "ciLower", "ciUpper", "se", "tol", "T", "p", "tStar"], "variable_groups": [], "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 standard error:

\n

[[0]]$\\mu$g/l

", "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": "se*(1-tol)", "maxValue": "se*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": 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 $\\var{CL}\\%$ confidence interval for the mean lead concentration in the traffic officers' blood.

\n

Lower limit: [[0]] $\\mu$g/l

\n

Upper limit: [[1]] $\\mu$g/l 

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "se", "part": "p0g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "0.5", "exploreObjective": null, "minValue": "ciUpper*(1-tol)", "maxValue": "ciUpper*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "se", "part": "p0g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "1", "exploreObjective": null, "minValue": "ciLower*(1-tol)", "maxValue": "ciLower*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": 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": "

Calculating the T statistics:

\n

$T=$ [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "se", "part": "p0g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "1", "exploreObjective": null, "minValue": "T*(1-tol)", "maxValue": "T*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": 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": "

Calculating the p-value:

\n

$p=$ [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "T", "part": "p2g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "1", "exploreObjective": null, "minValue": "p*(1-tol)", "maxValue": "p*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Mario Orsi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/427/"}]}]}], "contributors": [{"name": "Mario Orsi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/427/"}]}