For a sample of five married couples, the variables x = age of younger partner and y = age of older partner were recorded.
?x | 20 | 25 | 26 | 30 | 35 |
?y | 21 | 30 | 35 | 31 | 37 |
NOTE: SXX = 126.8, SXY = 116.2, SYY = 152.8, ?¯x¯ = 27.2, and ?¯y¯ = 30.8.
Compute the slope of the least squares line correct to three decimal places of accuracy.
Slope = ?=b=
Solution:
Suppose the regression equation is:
y= a+bx where a= intercept and b=slope
Given: SXX = 126.8, SXY = 116.2, SYY = 152.8, xbar= 27.2, and ybar= 30.8.
The slope of the regression line is given by;
b= Sxy/Sxx = 116.2/126.8 = 0.916
Also, using R software:
x<- c(20,25,26,30,35) ;
y<- c(21,30,35,31,37);
fit=lm(y~x);fit;
Output:
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
5.8738 0.9164
Intercept a= 5.874 and slope b=0.916
Get Answers For Free
Most questions answered within 1 hours.