document.write( "Question 1196665: Because it is not practical to weigh bears in the field, researchers sought to develop a model to predict a bear's weight based on its length. Here are the results for a sample:\r
\n" ); document.write( "\n" ); document.write( "Total Length (cm) Weight (kg)
\n" ); document.write( "139.0 110
\n" ); document.write( "138.0 60
\n" ); document.write( "139.0 90
\n" ); document.write( "120.5 60
\n" ); document.write( "149.0 85
\n" ); document.write( "141.0 100
\n" ); document.write( "141.0 95
\n" ); document.write( "150.0 85
\n" ); document.write( "166.0 155
\n" ); document.write( "151.5 140
\n" ); document.write( "129.5 105
\n" ); document.write( "150.0 110
\n" ); document.write( "The residual associated with the bear whose length is 149.0 cm and weight is 85 kg is _______kg. (round your answer to three digits after the decimal)
\n" ); document.write( "
\n" ); document.write( "

Algebra.Com's Answer #829606 by math_tutor2020(3817)\"\" \"About 
You can put this solution on YOUR website!

\n" ); document.write( "Answer: -24.960\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "============================================================\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Explanation:\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "x = total length (cm)
\n" ); document.write( "y = weight (kg)\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Use technology to find the equation of the regression line
\n" ); document.write( "I used GeoGebra to get y = 1.69417x - 142.47092 approximately.
\n" ); document.write( "You could use a spreadsheet program or any linear regression calculator to get the same thing.
\n" ); document.write( "I'll go into further detail where this equation comes from in the next section below.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Plug in x = 149.0 to find that,
\n" ); document.write( "y = 1.69417x - 142.47092
\n" ); document.write( "y = 1.69417*149.0 - 142.47092
\n" ); document.write( "y = 109.96041\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The length of x = 149.0 cm leads to a predicted weight of about y = 109.96041 kg
\n" ); document.write( "The true weight associated with this x value should be y = 85 kg instead. \r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The residual is the error between the observed y value and predicted y value
\n" ); document.write( "residual = (observed y value) - (predicted y value)
\n" ); document.write( "residual = 85 - 109.96041
\n" ); document.write( "residual = -24.96041
\n" ); document.write( "residual = -24.960
\n" ); document.write( "This is approximate and rounded to three decimal places (nearest thousandth)\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "---------------------------------------------\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "This section will go into further detail where the regression line came from.
\n" ); document.write( "Depending on your teacher, this section is optional. \r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "In real world settings, you won't need to know the formulas. It's much more efficient to use calculators, software, or spreadsheets.
\n" ); document.write( "However, it's still good to know what's going on under the hood. I'll leave out the proofs and derivations of each formula.
\n" ); document.write( "Those are better suited for calculus and linear algebra settings. \r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Here's the original data set of x and y values paired up together\n" ); document.write( "\n" ); document.write( "
xy
139110
13860
13990
120.560
14985
141100
14195
15085
166155
151.5140
129.5105
150110
We'll form the following columns:
\n" ); document.write( "x^2
\n" ); document.write( "xy\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The x^2 column is where we square each x value
\n" ); document.write( "eg: 139 squares to 139^2 = 139*139 = 19321\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The xy column has us multiply each x and y value together (separately per row).
\n" ); document.write( "Eg: 139.0*110 = 15290 in the first row of this column.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "I strongly recommend using spreadsheet software rather than doing it all by hand.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Here's what all that looks like\n" ); document.write( "\n" ); document.write( "
xyx^2xy
1391101932115290
13860190448280
139901932112510
120.56014520.257230
149852220112665
1411001988114100
141951988113395
150852250012750
1661552755625730
151.514022952.2521210
129.510516770.2513597.5
1501102250016500
Next we add up the values of each column
\n" ); document.write( "P = sum of the x values = 1714.5
\n" ); document.write( "Q = sum of the y values = 1195
\n" ); document.write( "R = sum of the x^2 values = 246447.75
\n" ); document.write( "S = sum of the xy values = 173257.5\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The linear regression equation is of the form y = mx+b
\n" ); document.write( "m = slope
\n" ); document.write( "b = y intercept\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "To calculate m and b, we use these two formulas
\n" ); document.write( "\"m+=+%28n%2AS-P%2AQ%29%2F%28n%2AR-P%5E2%29\"\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\"b+=+%28Q%2AR-P%2AS%29%2F%28n%2AR-P%5E2%29\"
\n" ); document.write( "where P,Q,R,S were mentioned in the previous paragraph above.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The numerators are different, but the denominators are identical.
\n" ); document.write( "The n refers to the sample size. It's the number of x,y pairs of values. In this case we have n = 12 such items.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "So,
\n" ); document.write( "\"m+=+%28n%2AS-P%2AQ%29%2F%28n%2AR-P%5E2%29\"\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\"m+=+%2812%2A173257.5-1714.5%2A1195%29%2F%2812%2A246447.75-%281714.5%29%5E2%29\"\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\"m+=+1.6941680312382\"\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\"m+=+1.69417\"
\n" ); document.write( "is the approximate slope\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "And,
\n" ); document.write( "\"b+=+%28Q%2AR-P%2AS%29%2F%28n%2AR-P%5E2%29\"\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\"b+=+%281195%2A246447.75+-+1714.5%2A173257.5%29%2F%2812%2A246447.75-%281714.5%29%5E2%29\"\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\"b+=+-142.470924129823\"\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\"b+=+-142.47092\"
\n" ); document.write( "is the approximate y intercept.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Therefore, the template y = mx+b updates to the approximation of y = 1.69417x - 142.47092
\n" ); document.write( "This was the linear regression equation (aka line of best fit) mentioned in the previous section.
\n" ); document.write( "Follow the steps mentioned in the previous section to get an answer of -24.960
\n" ); document.write( "
\n" ); document.write( "
\n" );