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

Find a regression equation.

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

Average atmospheric levels of CO$_2$ in the 2000s (x) and 2010s (y) decades were recorded for ten locations (A-J) as reported in this table (in ppm units):

\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\n\n\n\n\n\n\n\n\n
Locationxy
{obj[0]}{r1[0]}{r2[0]}
{obj[1]}{r1[1]}{r2[1]}
{obj[2]}{r1[2]}{r2[2]}
{obj[3]}{r1[3]}{r2[3]}
{obj[4]}{r1[4]}{r2[4]}
{obj[5]}{r1[5]}{r2[5]}
{obj[6]}{r1[6]}{r2[6]}
{obj[7]}{r1[7]}{r2[7]}
{obj[8]}{r1[8]}{r2[8]}
{obj[9]}{r1[9]}{r2[9]}
", "advice": "

Part a):

\n

Excel:

\n\n

Minitab:

\n\n

\n

For part b and c, as well as generally for the underlying theory of linear correlation and regression, check your learning material (e.g., Chapter 8 in OpenIntro Statistics).

\n

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "extensions": ["stats"], "variables": {"tol": {"name": "tol", "group": "Ungrouped variables", "definition": "0.05", "description": "", "templateType": "anything"}, "r1": {"name": "r1", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(380,9)),10)", "description": "", "templateType": "anything"}, "spxy": {"name": "spxy", "group": "Ungrouped variables", "definition": "sxy-t[0]*t[1]/n", "description": "", "templateType": "anything"}, "b0": {"name": "b0", "group": "Ungrouped variables", "definition": "siground(1/n*(t[1]-spxy/ss[0]*t[0]),3)", "description": "", "templateType": "anything"}, "ssq": {"name": "ssq", "group": "Ungrouped variables", "definition": "[sum(map(x^2,x,r1)),sum(map(x^2,x,r2))]", "description": "", "templateType": "anything"}, "sc": {"name": "sc", "group": "Ungrouped variables", "definition": "r1[ch]", "description": "", "templateType": "anything"}, "ch": {"name": "ch", "group": "Ungrouped variables", "definition": "random(0..9)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1.01..1.09#0.01)", "description": "", "templateType": "anything"}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "[sum(r1),sum(r2)]", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(10..20)", "description": "", "templateType": "anything"}, "sxy": {"name": "sxy", "group": "Ungrouped variables", "definition": "sum(map(r1[x]*r2[x],x,0..n-1))", "description": "", "templateType": "anything"}, "ss": {"name": "ss", "group": "Ungrouped variables", "definition": "[ssq[0]-t[0]^2/n,ssq[1]-t[1]^2/n]", "description": "", "templateType": "anything"}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "10", "description": "", "templateType": "anything"}, "obj": {"name": "obj", "group": "Ungrouped variables", "definition": "['A','B','C','D','E','F','G','H','I','J']", "description": "", "templateType": "anything"}, "r2": {"name": "r2", "group": "Ungrouped variables", "definition": "map(round(a+b*x+random(-9..9)),x,r1)", "description": "", "templateType": "anything"}, "b1": {"name": "b1", "group": "Ungrouped variables", "definition": "siground(spxy/ss[0],3)", "description": "", "templateType": "anything"}, "ls": {"name": "ls", "group": "Ungrouped variables", "definition": "siground(b0+b1*sc,3)", "description": "", "templateType": "anything"}, "res": {"name": "res", "group": "Ungrouped variables", "definition": "map(siground(r2[x]-(b0+b1*r1[x]),3),x,0..n-1)", "description": "", "templateType": "anything"}, "tsqovern": {"name": "tsqovern", "group": "Ungrouped variables", "definition": "[t[0]^2/n,t[1]^2/n]", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["tsqovern", "b0", "b1", "obj", "r1", "r2", "ss", "res", "ssq", "n", "a", "ch", "spxy", "ls", "tol", "t", "sc", "sxy", "b"], "variable_groups": [], "functions": {"pstdev": {"parameters": [["l", "list"]], "type": "number", "language": "jme", "definition": "sqrt(abs(l)/(abs(l)-1))*stdev(l)"}}, "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": "

Use a spreadsheet or stats software to obtain the regression model $y = b_0 + b_1 \\times x$: 

\n

$b_0=\\;$[[0]]ppm     

\n

$b_1=\\;$[[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": "b0*(1-tol)", "maxValue": "b0*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "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": "b1*(1-tol)", "maxValue": "b1*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "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": "

Using the model obtained above, calculate the predicted 2010s concentration for location $\\var{obj[ch]}$:

\n

$CO_2^{\\,2010\\text{s}}=$ [[0]]ppm

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "b0", "part": "p0g0", "must_go_first": false}, {"variable": "b1", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "0.5", "exploreObjective": null, "minValue": "ls*(1-tol)", "maxValue": "ls*(1+tol)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "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 $e_\\var{obj[ch]}$ (the residual for location $\\var{obj[ch]}$):

\n

$e_\\var{obj[ch]}=$[[0]]ppm

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "b0", "part": "p0g0", "must_go_first": false}, {"variable": "b1", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": "0", "exploreObjective": null, "minValue": "res[ch]-1", "maxValue": "res[ch]+1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "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/"}, {"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/"}]}