In: Statistics and Probability
Use the given data to find the equation of the regression line. Examine the scatterplot and identify a characteristic of the data that is ignored by the regression line. x 8 10 12 11 6 4 3 13 7 5 9 y 14.75 16.69 17.31 17.17 11.49 6.91 4.13 17.13 13.28 9.37 15.88 Modifying Above y with caret equals nothing plus nothing x
Solution:
Use R sftware
use plot function in R to find the scatterplot
R code is:
plot(y~x,main="scatterplot",pch = 15, col = "green")
From scatterplot we observe a strong positive relationship between x and y
correlation coeffcient=
Rcode:cor(x,y)
r=0.9427058
Create 2 vectors X and Y
use lm function in R to find regression line
Rcode:
x <- c(8 ,10 ,12, 11 ,6 ,4, 3, 13, 7, 5 ,9)
y <- c(14.75, 16.69 ,17.31, 17.17, 11.49, 6.91, 4.13, 17.13,
13.28 ,9.37, 15.88)
regresseq <- lm(y~x)
coefficients(regresseq)
Output:
(Intercept) x
2.700909 1.300000
Therefore
equation of regression line is
y=2.700909 +1.300000 *x
y intercept=2.700909
slope=1.300000