Hi Anchal,
Formula for correlation coefficient r is:
r=[sum(xi -xbar)(yi-ybar)]/[sqrt(sum(xi-xbar)2*sum(yi-ybar)2)]
xbar=x sample mean
ybar=y sample mean
xi=Each individual x value
yi=Each individual y value
As you can imagine, this calculation would be quite cumbersome even for the relatively small sample size of 12. It is best to use statistical software, an online calculator, or a graphics calculator in the TI-83 family. From online calculator:
r= -0.820
r2 is exactly what it sounds like. Square the above value for r:
(-0.820)2=0.673=67.3%
Remember that a simple linear regression equates essentially to a slope, so we follow the traditional slope-intercept form y=mx + b. You may see this in statistics as Y=B0 + B1x. They are essentially the same. The b in the first form is the y-intercept. B0 in the second form is the y-intercept. m in first form is slope. B1 in second form is slope.
Anyway, recall formula for slope:
m=(y2-y1)/(x2-x1)
You can use any two pairs of x and y-coordinates you like. I'll go with the first pair in the set as (x1, y1) and the last pair as (x2, y2). Thus:
x1=17.9
y1=98.2
x2=36.7
y2=54
m=(54-98.2)/(36.7-17.9)
m= -2.351
Now, we need the intercept. Going back to our original formula: y=mx + b, again, we can substitute any ordered pair for x and y and the slope in for m. I'll go with the third pair (19.4, 94):
94= -2.351(19.4) + b
94= -45.609 + b
Add 45.609 to both sides:
b=139.609
Regression Line Equation: y= -2.351x +139.609
Explanatory variable means "x" variable, so we plug in 13.1 for x. Note that predicted values are usually denoted with a ^, read as "y-hat:"
y^= -2.351(13.1) + 139.609
y^=108.8
I hope this helps.
Joshua L.
11/29/23
William W.
Your method for calculating the slope and y-intercept are incorrect as you are using data points instead of points on the regression line. The manual method for calculating slope is complex but is r*(Sy/Sx) where Sy = sqrt(sum(y-ybar)^2/(n-1)) and Sx = sqrt(sum(x-xbar)^2/(n-1)) but, again is easy to find using a calculator. The manual method for calculating "b" is y-hat - m*x-hat. My calculator shows the regression line as y = -2.1809x + 121.81211/29/23