// Numbas version: exam_results_page_options {"name": "Simon's copy of Regression 3", "extensions": ["stats", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"js": "", "css": ""}, "ungrouped_variables": ["ch", "prediction", "b1", "owner", "sxy", "res", "spxy", "ls", "tol", "tcorr", "tsqovern", "ssq", "sumr", "thisval", "a1", "pub", "corr", "a", "b", "obj", "r1", "r2", "ss", "tol1", "n", "beverage", "t", "sc", "rsquared", "ja", "jb", "tol2"], "advice": "

(a)

\n

Note that we have $n=12$

\n

To find $b$ you use the formula:

\n

$\\displaystyle b = \\frac{n\\Sigma xy-\\Sigma x \\Sigma y}{n\\Sigma x^2 -(\\Sigma x)^2}$

\n

$\\displaystyle b = \\frac{12\\times\\var{sxy}-\\var{t[0]}\\times\\var{t[1]}}{12\\times\\var{ssq[0]} -(\\var{t[0]})^2}$

\n

$\\displaystyle b = \\frac{\\var{12*sxy}-\\var{t[0]*t[1]}}{\\var{12*ssq[0]} -\\var{t[0]^2}}=\\var{precround((12*sxy-t[0]*t[1])/(12*ssq[0]-t[0]^2),5)}$

\n

\n

\n

Then $\\displaystyle a = \\frac{\\Sigma y - b \\Sigma x}{n}=\\frac{\\var{t[1]} - \\var{precround((12*sxy-t[0]*t[1])/(8*ssq[0]-t[0]^2),5)} \\times \\var{t[0]}}{12} = \\var{precround((t[1] -(12*sxy-t[0]*t[1])/(12*ssq[0]-t[0]^2)*t[0])/12,5)}$

\n

\n

(b)

\n

We want to plot the line $y=\\var{a}+\\var{b}x$

\n

\n

In order to plot a straight line, we need to calculate two points on the line, and join them.

\n

\n

E.g. letting $x=0$ we obtain $y=\\var{a}+\\var{b}\\times 0= \\var{a}$, so we can move point A to $(0,\\var{a}$)

\n

E.g. letting $x=\\var{10*round(max(r1)/10)}$ we obtain $y=\\var{a}+\\var{b}\\times \\var{10*round(max(r1)/10)}=\\var{b*10*round(max(r1)/10)+a}$, so we can move point B to $(\\var{10*round(max(r1)/10)},\\var{b*10*round(max(r1)/10)+a}$)

\n

\n

Our final line should look similar to:

\n

\n

{regfun(r1,r2,max(r1)+10,max(r2)+10,rsquared,sumr)}

\n

\n

\n

(c)

\n

To calculate the Pearson correlation coefficient $r$ we use the formula:

\n

\\[r=\\frac{n\\Sigma xy -\\Sigma x \\Sigma y}{\\sqrt{n\\Sigma x^2-(\\Sigma x)^2}\\sqrt{n\\Sigma y^2-(\\Sigma y)^2}}\\]

\n

Note that $n$ is the number of data points. In this case $n=\\var{n}$

\n

\n

Hence

\n

$r=\\frac{n\\Sigma xy -\\Sigma x \\Sigma y}{\\sqrt{n\\Sigma x^2-(\\Sigma x)^2}\\sqrt{n\\Sigma y^2-(\\Sigma y)^2}}$

\n

$r=\\frac{\\var{n}\\times\\var{sxy} -\\var{t[0]}\\times\\var{t[1]}}{\\sqrt{\\var{n}\\times\\var{ssq[0]}-(\\var{t[0]})^2}\\sqrt{\\var{n}\\times\\var{ssq[1]}-(\\var{t[1]})^2}} = \\var{corr}$

\n

\n

(d)

\n

We have the regression equation $y = \\var{a}+\\var{b}x$

\n

To use our regression equation to predict $y$, the sales of cider, we simply substitute our given value of $x=\\var{thisval}$, the temperature, into the regression equation.

\n

Hence $y = \\var{a}+\\var{b}\\times\\var{thisval}=\\var{a+b*thisval}$

\n

$=\\var{precround(a+b*thisval,0)}$ to the nearest whole number.

\n

", "variables": {"r1": {"group": "Ungrouped variables", "definition": "[random(0..6),random(1..7),random(4..10),random(7..13),random(12..18),random(4..20),random(16..22),random(19..25),random(17..23),random(13..19),random(8..14),random(3..9)]", "name": "r1", "templateType": "anything", "description": ""}, "jb": {"group": "Ungrouped variables", "definition": "precround(spxy/ss[0],3)", "name": "jb", "templateType": "anything", "description": ""}, "b": {"group": "Ungrouped variables", "definition": "precround(spxy/ss[0],3)", "name": "b", "templateType": "anything", "description": ""}, "ssq": {"group": "Ungrouped variables", "definition": "[sum(map(x^2,x,r1)),sum(map(x^2,x,r2))]", "name": "ssq", "templateType": "anything", "description": ""}, "rsquared": {"group": "Ungrouped variables", "definition": "precround(spxy^2/(ss[0]*ss[1]),3)", "name": "rsquared", "templateType": "anything", "description": ""}, "spxy": {"group": "Ungrouped variables", "definition": "sxy-t[0]*t[1]/n", "name": "spxy", "templateType": "anything", "description": ""}, "prediction": {"group": "Ungrouped variables", "definition": "round(a+b*thisval)", "name": "prediction", "templateType": "anything", "description": ""}, "sxy": {"group": "Ungrouped variables", "definition": "sum(map(r1[x]*r2[x],x,0..n-1))", "name": "sxy", "templateType": "anything", "description": ""}, "sumr": {"group": "Ungrouped variables", "definition": "precround(sum(map(res[x]^2,x,0..n-1)),3)", "name": "sumr", "templateType": "anything", "description": ""}, "sc": {"group": "Ungrouped variables", "definition": "r1[ch]", "name": "sc", "templateType": "anything", "description": ""}, "tol1": {"group": "Ungrouped variables", "definition": "0.01", "name": "tol1", "templateType": "anything", "description": ""}, "n": {"group": "Ungrouped variables", "definition": "12", "name": "n", "templateType": "anything", "description": ""}, "ss": {"group": "Ungrouped variables", "definition": "[ssq[0]-t[0]^2/n,ssq[1]-t[1]^2/n]", "name": "ss", "templateType": "anything", "description": ""}, "corr": {"group": "Ungrouped variables", "definition": "precround(tcorr,2)", "name": "corr", "templateType": "anything", "description": ""}, "a1": {"group": "Ungrouped variables", "definition": "random(10..20)", "name": "a1", "templateType": "anything", "description": ""}, "ch": {"group": "Ungrouped variables", "definition": "random(0..11)", "name": "ch", "templateType": "anything", "description": ""}, "r2": {"group": "Ungrouped variables", "definition": "map(round(a1+b1*x+random(-9..9)),x,r1)", "name": "r2", "templateType": "anything", "description": ""}, "tcorr": {"group": "Ungrouped variables", "definition": "spxy/sqrt(ss[0]*ss[1])", "name": "tcorr", "templateType": "anything", "description": ""}, "owner": {"group": "Ungrouped variables", "definition": "random(\"Kevin\",\"Mary\",\"Bill\",\"Doreen\",\"Peter\",\"Helen\",\"Michael\",\"Samantha\")", "name": "owner", "templateType": "anything", "description": ""}, "beverage": {"group": "Ungrouped variables", "definition": "random(\"home-brewed beer\",\"home-brewed lager\",\"specially-brewed beer\",\"super-strength lager\",\"cold-filtered lager\",\"ice-filtered cider\",\"cherry cider\")", "name": "beverage", "templateType": "anything", "description": ""}, "tol2": {"group": "Ungrouped variables", "definition": "0.1", "name": "tol2", "templateType": "anything", "description": ""}, "a": {"group": "Ungrouped variables", "definition": "precround(1/n*(t[1]-spxy/ss[0]*t[0]),3)", "name": "a", "templateType": "anything", "description": ""}, "obj": {"group": "Ungrouped variables", "definition": "['Jan','Feb','March','April','May','June','July','August','Sept','Oct','Nov','Dec']", "name": "obj", "templateType": "anything", "description": ""}, "ja": {"group": "Ungrouped variables", "definition": "precround(1/n*(t[1]-spxy/ss[0]*t[0]),3)", "name": "ja", "templateType": "anything", "description": ""}, "ls": {"group": "Ungrouped variables", "definition": "precround(a+b*sc,2)", "name": "ls", "templateType": "anything", "description": ""}, "res": {"group": "Ungrouped variables", "definition": "map(precround(r2[x]-(a+b*r1[x]),2),x,0..n-1)", "name": "res", "templateType": "anything", "description": ""}, "t": {"group": "Ungrouped variables", "definition": "[sum(r1),sum(r2)]", "name": "t", "templateType": "anything", "description": ""}, "tsqovern": {"group": "Ungrouped variables", "definition": "[t[0]^2/n,t[1]^2/n]", "name": "tsqovern", "templateType": "anything", "description": ""}, "tol": {"group": "Ungrouped variables", "definition": "0.1", "name": "tol", "templateType": "anything", "description": ""}, "pub": {"group": "Ungrouped variables", "definition": "random(\"Black Bull Inn\",\"County Inn\",\"Dog and Duck Pub\",\"Slug and Lettuce Pub\", \"Cross Keys Pub\",\"Newcastle Arms Pub\",\"Red Lion Pub\")", "name": "pub", "templateType": "anything", "description": ""}, "b1": {"group": "Ungrouped variables", "definition": "random(0.25..0.45#0.05)", "name": "b1", "templateType": "anything", "description": ""}, "thisval": {"group": "Ungrouped variables", "definition": "random(15..22)", "name": "thisval", "templateType": "anything", "description": ""}}, "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "extensions": ["jsxgraph", "stats"], "statement": "

{owner} owns the {pub}. {owner} believes that sales of {beverage} in the pub are linked to the average monthly temperature, with higher sales being recorded in months with higher temperatures. To investigate, {owner} records the average monthly temperature in the local town over a period of one year ($X$ degrees Celsius), along with total monthly sales of {beverage} ($Y$ hundred euros). The results are shown in the table below: 

\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
Month$\\var{obj[0]}$$\\var{obj[1]}$$\\var{obj[2]}$$\\var{obj[3]}$$\\var{obj[4]}$$\\var{obj[5]}$$\\var{obj[6]}$$\\var{obj[7]}$$\\var{obj[8]}$$\\var{obj[9]}$$\\var{obj[10]}$$\\var{obj[11]}$
$X$ (temperature)$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$$\\var{r1[10]}$$\\var{r1[11]}$
$Y$ (sales, €100s)$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$$\\var{r2[5]}$$\\var{r2[6]}$$\\var{r2[7]}$$\\var{r2[8]}$$\\var{r2[9]}$$\\var{r2[10]}$$\\var{r2[11]}$
\n

You are given the following information:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$X$ $\\sum x=\\;\\var{t[0]}$$\\sum x^2=\\;\\var{ssq[0]}$
$Y$$\\sum y=\\;\\var{t[1]}$$\\sum y^2=\\;\\var{ssq[1]}$
\n

Also you are given $\\sum xy = \\var{sxy}$.

", "functions": {"regfun": {"definition": "\n var div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',\n{boundingBox:[-5,maxy,maxx,-5],\n axis:true,\n showNavigation:false,\n grid:true});\n var board = div.board; \nvar l1=board.create('text',[maxx/2,-2,'Temperature']);\nvar l2=board.create('text',[-2,maxy/2,'Sales']);\n var names = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n for (j=0;j<12;j++){ board.create('point',[r1[j],r2[j]],{fixed:true, style:3, strokecolor:\"#0000a0\", name:'\\['+names[j]+'\\]'})};\nvar regressionPolynomial = JXG.Math.Numerics.regressionPolynomial(1, r1, r2);\nvar reg = board.create('functiongraph',[regressionPolynomial],{strokeColor:'blue',name:'Regression Line.',withLabel:true}); \n //for(var i=0;i<12;i++){board.create(\"segment\",[[r1[i],r2[i]],[r1[i],regressionPolynomial(r1[i])]])};\n\nvar regExpression = regressionPolynomial.getTerm();\nvar regTeX = Numbas.jme.display.exprToLaTeX(regExpression,[],scope);\n\nvar t = board.create('text',[1,5,\nfunction(){ return \"\\\\[r(Y) = \" + regExpression +'\\\\]';}\n],\n{strokeColor:'black',fontSize:18}); \nvar t1 = board.create('text',[5,maxy,\nfunction(){ return \"\\\\[SSE = \" + sumr +'\\\\]';}\n],\n{strokeColor:'black',fontSize:18}); \nvar t2 = board.create('text',[20,maxy,\nfunction(){ return \"\\\\[R^2 = \" + rsquared +'\\\\]';}\n],\n{strokeColor:'black',fontSize:18}); \nreturn div;\n \n", "type": "html", "parameters": [["r1", "list"], ["r2", "list"], ["maxx", "number"], ["maxy", "number"], ["rsquared", "number"], ["sumr", "number"]], "language": "javascript"}, "regressline": {"definition": "\n var div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',\n{boundingBox:[-5,maxy,maxx,-5],\n axis:true,\n showNavigation:false,\n grid:false});\n var board = div.board; \nvar l1=board.create('text',[maxx/2,-2,'Temperature']);\nvar l2=board.create('text',[-2,maxy/2,'Sales']);\nvar names = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\nfor (j=0;j<12;j++){ board.create('point',[r1[j],r2[j]],{fixed:true, style:3,name:'\\['+names[j]+'\\]'})};\nvar a1 = board.create('point',[minx+5,miny+5],{color:'blue'});\nvar b1 = board.create('point',[minx+7,miny+5],{color:'blue'});\nfunction updr(a,b){\n var s=0;\n for(var i=0;i<12;i++){\ns=s+Math.pow(r2[i]-a*r1[i]-b,2);}\nvar html = $(question.display.html);\ns=Numbas.math.niceNumber(Numbas.math.precround(s,2));\nhtml.find('#rsquared').text(s);}\n var li=board.create('line',[a1,b1], {straightFirst:false, straightLast:false});\n var a=0;\n var b=0;\n function dr(p){\n p.on('drag',function(){\n a = Numbas.math.niceNumber((b1.Y()-a1.Y())/(b1.X()-a1.X()));\n b = Numbas.math.niceNumber((a1.Y()*b1.X()-a1.X()*b1.Y())/(b1.X()-a1.X()));\n Numbas.exam.currentQuestion.parts[1].gaps[0].display.studentAnswer(Math.round(a*10)/10);\n Numbas.exam.currentQuestion.parts[1].gaps[1].display.studentAnswer(Math.round(b*10)/10);\n updr(a,b);\n })};\n dr(a1);\n dr(b1);\n \nreturn div;\n\n \n", "type": "html", "parameters": [["r1", "list"], ["r2", "list"], ["minx", "number"], ["maxx", "number"], ["miny", "number"], ["maxy", "number"]], "language": "javascript"}}, "name": "Simon's copy of Regression 3", "variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "parts": [{"extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "gaps": [{"maxValue": "ja", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "showFeedbackIcon": true, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "scripts": {}, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "unitTests": [], "precisionType": "dp", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "strictPrecision": true, "precision": "3", "variableReplacements": [], "marks": 1, "precisionPartialCredit": 0, "minValue": "ja", "correctAnswerFraction": false}, {"maxValue": "jb", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "showFeedbackIcon": true, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "scripts": {}, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "unitTests": [], "precisionType": "dp", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "strictPrecision": false, "precision": "3", "variableReplacements": [], "marks": 1, "precisionPartialCredit": 0, "minValue": "jb", "correctAnswerFraction": false}], "showFeedbackIcon": true, "stepsPenalty": 0, "steps": [{"prompt": "

To find $a$ and $b$ you first find  $\\displaystyle b = \\frac{n\\Sigma xy-\\Sigma x \\Sigma y}{n\\Sigma x^2 -(\\Sigma x)^2}$

\n

Then $\\displaystyle a = \\frac{\\Sigma y - b \\Sigma x}{n}$

\n

Now go back and fill in the values for $a$ and $b$.

\n

 

", "type": "information", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "marks": 0, "unitTests": [], "scripts": {}, "showCorrectAnswer": true, "variableReplacements": []}], "scripts": {}, "showCorrectAnswer": true, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "marks": 0, "unitTests": [], "sortAnswers": false, "prompt": "

\\[Y = a + b  X.\\] Using the least squares method to find $a$ and $b$ to 5 decimal places, then input them below to 3 decimal places. You will use these approximate values in the rest of the question. 

\n

  $a=\\;$[[0]] $b=\\;$[[1]],     (enter both to 3 decimal places).

"}, {"extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "gaps": [{"maxValue": "b", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "showFeedbackIcon": true, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "scripts": {}, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "unitTests": [], "precisionType": "dp", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "strictPrecision": true, "precision": "1", "variableReplacements": [], "marks": 1, "precisionPartialCredit": 0, "minValue": "b", "correctAnswerFraction": false}, {"maxValue": "a", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "showFeedbackIcon": true, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "scripts": {}, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "unitTests": [], "precisionType": "dp", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "strictPrecision": true, "precision": "1", "variableReplacements": [], "marks": 1, "precisionPartialCredit": 0, "minValue": "a", "correctAnswerFraction": false}], "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "marks": 0, "unitTests": [], "sortAnswers": false, "prompt": "

A scatter diagram for the data is plotted below.

\n

Move the two points on the blue line to obtain the line representing the equation of the least squares regression line that you found in part (a), correct to 1 d.p.

\n

{regressline(r1,r2,min(r1)-10,max(r1)+10,min(r2)-10,max(r2)+10)}

\n

\n

\n

The equation of the line you plotted is 

\n

$Y=$[[1]]$+$[[0]]$x$

\n

For the current regression line you have plotted:

\n

SSE=

\n

\n

For this data, the best fit regression line (plotted to more than 1 decimal place!) has an SSE of: {sumr}

\n

\n

The SSE is the sum of square errors. The SSE gives an indication of the fit. The closer it is to zero, the better the regression line fits the data. The best fit regression line is the one that minimises the SSE (sum of square errors).

\n

\n

\n

\n

\n

"}, {"extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "gaps": [{"maxValue": "corr", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "showFeedbackIcon": true, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "scripts": {}, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "unitTests": [], "precisionType": "dp", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "strictPrecision": true, "precision": "2", "variableReplacements": [], "marks": 1, "precisionPartialCredit": 0, "minValue": "corr", "correctAnswerFraction": false}], "showFeedbackIcon": true, "stepsPenalty": 0, "steps": [{"prompt": "

\\[r=\\frac{n\\Sigma xy -\\Sigma x \\Sigma y}{\\sqrt{n\\Sigma x^2-(\\Sigma x)^2}\\sqrt{n\\Sigma y^2-(\\Sigma y)^2}}\\]

", "type": "information", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "marks": 0, "unitTests": [], "scripts": {}, "showCorrectAnswer": true, "variableReplacements": []}], "scripts": {}, "showCorrectAnswer": true, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "marks": 0, "unitTests": [], "sortAnswers": false, "prompt": "

Calculate the coefficient of correlation  $r$ for these data:

\n

$r=\\;$[[0]] (enter to 2 decimal places).

"}, {"extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "gaps": [{"maxValue": "prediction", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": true, "showFeedbackIcon": true, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "scripts": {}, "showCorrectAnswer": true, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "unitTests": [], "precisionType": "dp", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "strictPrecision": true, "precision": 0, "variableReplacements": [], "marks": 1, "precisionPartialCredit": 0, "minValue": "prediction", "correctAnswerFraction": false}], "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "marks": 0, "unitTests": [], "sortAnswers": false, "prompt": "

Next month, the average temperature in {owner}'s town is forecast to be  {thisval} Celsius. Use the regression equation $Y = a + b  X$, with the values of $a$ and $b$ that you calculated in part (a), to predict sales of the {beverage} in that month.

\n

What is the predicted value of sales (in hundreds of euros) ?

\n

Use the values of $a$ and $b$ you input above to 3 decimal places.

\n

Enter the predicted sales here:  [[0]] (hundreds of euros to the nearest whole number).

\n

"}], "variable_groups": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Find a regression equation given 12 months data on temperature and sales of a drink. Includes an interactive diagram for experimenting with fitting a regression line.

\n

rebelmaths

"}, "type": "question", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}