// Numbas version: exam_results_page_options {"name": "Logistic regression: interpretation of software output.", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Logistic regression: interpretation of software output.", "tags": [], "metadata": {"description": "

Interpreting the minitab output from a logistic regression model of salary against obesity as measured by BMI.

\n

Adaptive marking is in place for Part b).

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

It is hypothesized that there is a relationship between salary and obesity, with employees in more highly-paid roles being more likely to be overweight than those in other roles.

\n

To test this hypothesis, the following data are collected for a random sample of 15 employees:

\n\n

A logistic regression is performed using statistical software, obtaining the following (edited) output:

\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

95% CI

\n
\n

Predictor

\n
\n

Coef

\n
\n

SE Coef

\n
\n

Z

\n
\n

P

\n
\n

Lower

\n
\n

Upper

\n
\n

Constant

\n
\n

$A$

\n
\n

{sea}

\n
\n

-2.24

\n
\n

0.025

\n
\n

\n
\n

\n
\n

$x$

\n
\n

$B$

\n
\n

{seb}

\n
\n

2.25

\n
\n

0.025

\n
\n

1.02

\n
\n

1.37

\n
", "advice": "

Revise logistic regression, e.g., Section 9.5 of OpenIntro Statistics.

\n

a)

\n

Use the Z-score definition ($Z=\\frac{x-\\mu_0}{SE}$, with $\\mu_0=0$) and solve for $x$:

\n

A is given by  A = -2.24 x  SE Coef (A) = -2.24 x {sea} = {ansa}.

\n

B is given by  B =  2.25 x  SE Coef (B) =  2.25 x {seb} = {ansb}.

\n

b)

\n

The probability is given by:

\n

\\[\\begin{align}P(Y=1 | X=\\var{thismuch})&=\\frac{e^{A+B\\times\\var{thismuch}}}{1+e^{A+B\\times\\var{thismuch}}}\\\\&=\\frac{e^{\\var{r1}}}{1+e^{\\var{r1}}}=\\var{prob1}\\end{align}\\]

\n

If using a spreadsheet program (e.g., Excel), note that $e^x$ corresponds to EXP($x$).

\n

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"tol": {"name": "tol", "group": "Ungrouped variables", "definition": "0.2", "description": "", "templateType": "anything", "can_override": false}, "r1": {"name": "r1", "group": "Ungrouped variables", "definition": "ansa+ansb*thismuch", "description": "", "templateType": "anything", "can_override": false}, "seb": {"name": "seb", "group": "Ungrouped variables", "definition": "siground(random(0.04..1.2#0.000001),3)", "description": "", "templateType": "anything", "can_override": false}, "sea": {"name": "sea", "group": "Ungrouped variables", "definition": "siground(((t*v1+(100-t)*v2)+0.000001)/100,3)", "description": "", "templateType": "anything", "can_override": false}, "ansa": {"name": "ansa", "group": "Ungrouped variables", "definition": "siground(-2.24*sea,3)", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "random(0..100)", "description": "", "templateType": "anything", "can_override": false}, "thismuch": {"name": "thismuch", "group": "Ungrouped variables", "definition": "random(15..35)", "description": "", "templateType": "anything", "can_override": false}, "v2": {"name": "v2", "group": "Ungrouped variables", "definition": "seb*thismuch+0.9", "description": "", "templateType": "anything", "can_override": false}, "v1": {"name": "v1", "group": "Ungrouped variables", "definition": "seb*thismuch-0.9", "description": "", "templateType": "anything", "can_override": false}, "prob1": {"name": "prob1", "group": "Ungrouped variables", "definition": "siground(e^(r1)/(1+e^r1),3)", "description": "", "templateType": "anything", "can_override": false}, "ansb": {"name": "ansb", "group": "Ungrouped variables", "definition": "siground(2.25*seb,3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["seb", "r1", "v1", "v2", "t", "tol", "ansa", "ansb", "thismuch", "sea", "prob1"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ".minitab {\n font-family: 'Courier', monospace;\n}"}, "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": "

Find $A$ and $B$:

\n

$A=\\;$[[0]]     $B=\\;$[[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "ansa*(1-tol)", "maxValue": "ansa*(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.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "ansb*(1-tol)", "maxValue": "ansb*(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": [{"variable": "ansa", "part": "p0g0", "must_go_first": false}, {"variable": "ansb", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the probability that an employee with an annual salary of {thismuch} thousand pounds is obese:

\n

Probability = [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "ansa", "part": "p0g0", "must_go_first": false}, {"variable": "ansb", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "alwaysreplace", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "0", "exploreObjective": null, "minValue": "prob1*(1-tol)", "maxValue": "prob1*(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", "contributors": [{"name": "Mario Orsi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/427/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Mario Orsi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/427/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}