// Numbas version: exam_results_page_options {"name": "Calculate confidence interval for the proportion", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Calculate confidence interval for the proportion", "tags": [], "metadata": {"description": "

\n

Calculate confidence interval for the mean, sample variance n>30

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

{scenario1[Index]} {n1[Index]} {scenario2[Index]} {prop1[Index]} {scenario3[Index]} {percentage}%  {scenario4[Index]}.

\n

", "advice": "

\n

The estimate for the population proportion is $\\hat{p} =\\frac{{\\var{prop1[Index]}}}{\\var{n1[Index]}}=\\var{precround(p_hat,3)}$

\n

\n

The estimate for the standard error associated with $\\hat{p}$ is  $=\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{n}}=\\sqrt{\\frac{\\var{precround(p_hat,3)}\\times (1-\\var{precround(p_hat,3)})}{\\var{n1[Index]}}}=\\var{se}$

\n

 

\n

To construct a $\\var{percentage}$% confidence interval, $Z_\\frac{\\alpha}{2}=Z_\\frac{\\var{alpha2}}{2} = \\var{Z}$

\n

\n

Putting this information together, the lower bound of the $\\var{percentage}$% confidence interval is: 

\n

$\\hat{p} -Z_\\frac{\\alpha}{2}\\times\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{\\var{n1[Index]}}}=\\var{precround(p_hat,3)} -\\var{Z}\\times \\var{se}=\\var{precround(lower,2)}$

\n

The upper bound of the $\\var{percentage}$% confidence interval is: 

\n

$\\hat{p} +Z_\\frac{\\alpha}{2}\\times\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{\\var{n1[Index]}}}=\\var{precround(p_hat,3)} +\\var{Z}\\times \\var{se}=\\var{precround(upper,2)}$

\n

\n

\n

\n

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"p_hat": {"name": "p_hat", "group": "Unnamed group", "definition": "prop1[Index]/n1[Index]", "description": "", "templateType": "anything", "can_override": false}, "scenario2": {"name": "scenario2", "group": "Unnamed group", "definition": "[\"newly employed graduates from CIT found that\", \"machines is taken and\"]\n", "description": "", "templateType": "anything", "can_override": false}, "n1": {"name": "n1", "group": "Unnamed group", "definition": "[random(100..120#10),random(180..250#10)]", "description": "", "templateType": "anything", "can_override": false}, "upper": {"name": "upper", "group": "Ungrouped variables", "definition": "p_hat+Z*sqrt((p_hat*(1-p_hat))/n1[Index])", "description": "", "templateType": "anything", "can_override": false}, "alpha2": {"name": "alpha2", "group": "Unnamed group", "definition": "alpha*2", "description": "", "templateType": "anything", "can_override": false}, "percentage": {"name": "percentage", "group": "Ungrouped variables", "definition": "random([95,99])", "description": "", "templateType": "anything", "can_override": false}, "lower": {"name": "lower", "group": "Ungrouped variables", "definition": "p_hat-Z*sqrt((p_hat*(1-p_hat))/n1[Index])", "description": "", "templateType": "anything", "can_override": false}, "se": {"name": "se", "group": "Ungrouped variables", "definition": "precround(sqrt((p_hat*(1-p_hat))/n1[Index]),4)", "description": "", "templateType": "anything", "can_override": false}, "prop1": {"name": "prop1", "group": "Unnamed group", "definition": "[random(75..80#1),random(30..50#2)]", "description": "", "templateType": "anything", "can_override": false}, "scenario1": {"name": "scenario1", "group": "Unnamed group", "definition": "[\"A survey of\",\"A manufacturer would like to estimate the proportion of X-ray machines that malfunction and produce excess radiation. A random sample of\"]\n\n", "description": "", "templateType": "anything", "can_override": false}, "Z": {"name": "Z", "group": "Ungrouped variables", "definition": "precround(normalinv(1-alpha,0,1),2)", "description": "", "templateType": "anything", "can_override": false}, "scenario3": {"name": "scenario3", "group": "Unnamed group", "definition": "[\"of the graduates surveyed used statistics in their new roles. Calculate a\" , \"of the machines malfunction. Calculate a\"]", "description": "", "templateType": "anything", "can_override": false}, "Index": {"name": "Index", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything", "can_override": false}, "alpha": {"name": "alpha", "group": "Ungrouped variables", "definition": "(100-percentage)/200", "description": "", "templateType": "anything", "can_override": false}, "scenario4": {"name": "scenario4", "group": "Unnamed group", "definition": "[\"confidence interval for the proportion of CIT graduates who use statistics in their place of work.\", \"confidence interval for the proportion of X-ray machines that malfunction in the population.\"]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["upper", "Index", "percentage", "Z", "alpha", "lower", "se"], "variable_groups": [{"name": "Unnamed group", "variables": ["scenario1", "scenario2", "prop1", "scenario3", "p_hat", "n1", "scenario4", "alpha2"]}], "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": "

Lower limit = [[0]]

\n

Upper limit = [[1]]

", "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": "lower", "maxValue": "lower", "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"}, {"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": "upper", "maxValue": "upper", "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}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}]}], "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}