Sy <- 9.41
Sx <- 10.37
R <- 0.67
y2 <- 171.14
x2 <- 107.2
b1 <- (Sy/Sx)*R
b1
## [1] 0.6079749
B1 is 0.6079749.
To find Bo,
$ y-y2 = b1(x-x2)
We will manipulate the above formula to get Bo
b0 <- y2 - (b1*x2)
b0
## [1] 105.9651
The equation for the regression is:
height = 105.9651 + 0.6079749*(shoulder girth)
Slope: It represents the number of cm increase in height with the increase of 1 unit in shoulder girth. Intercept: It shows the height in cm when shoulder girth is 0 cm which is not possible logically.
r5 <- R^2
r5
## [1] 0.4489
It shows that the model predicts 44.89% of the variation of height data.
x <- 100
y=b0 + (b1*x)
y
## [1] 166.7626
The height for the randomly selected person would be 166.7627cm.
residual_height <- 160 - 166.7627
residual_height
## [1] -6.7627
Residual for that student is -6.7627. The model was overestimated as the value came in negative.
correlation_coefficient <- sqrt(0.6466)
correlation_coefficient
## [1] 0.8041144
y = Bo + B1*x
bo <- 4.010
x1 <- -0.0883
y2 <- 3.9983
b1 <- (y2 - bo)/x1
b1
## [1] 0.1325028
Slope is 0.1325028.