In: Statistics and Probability
You will complete a question about Correlation Examples and complete a Simple Linear Regression. For the Simple Linear Regression, make sure to complete the following steps:
Construct a scatter plot.
Find the equation of the regression line.
Predict the value of y for each of the x-values.
Use this resource: Regression
Give an example of two variables that have a positive linear correlation. Give an example of two variables that have a negative linear correlation. Give an example of two variables that have no correlation. Height and Weight: The height (in inches) and weights (in pounds) of eleven football players are shown in this table.
Height, x 62 63 66 68 70 72 73 74 74 75 75
Weight, y 195 190 250 220 250 255 260 275 280 295 300
x = 65 inches x = 69 inches x = 71 inches
For this task i have used R software. Output and syntax are given below
At first i have defined the data using the syntax:
>
Height.x.<-c(62,63,66,68,70,72,73,74,74,75,75)
>
weight.y.<-c(195,190,250,220,250,255,260,275,280,295,300)
Then i have drawn Scatter plot
Syntax: > plot(Height.x.,weight.y.)
The output is
--------------------------------------------------------------------------------------------------------------------------
Next for the regression line i have used the syntax
> model<-lm(weight.y.~Height.x.)
> summary(model)
Where 'lm' is the linear model function in R.
The output is
Call:
lm(formula = weight.y. ~ Height.x.)
Residuals:
Min 1Q Median 3Q Max
-15.9904 -9.8632 -0.4992 5.3824 28.5184
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -257.3083 63.7622 -4.035 0.00295 **
Height.x. 7.2544 0.9066 8.002 2.21e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 13.68 on 9 degrees of freedom
Multiple R-squared: 0.8768, Adjusted R-squared: 0.8631
F-statistic: 64.02 on 1 and 9 DF, p-value: 2.21e-05
Hemce from the abouve output equation of regression line is
Weight(y)=-257.3083+ 7.2544 *Height(x)
----------------------------------------------------------------------------------------------------
Prediction of the value of y for each of the x-values.
x | y |
65 | 214.2272 |
69 | 243.2448 |
71 | 257.7536 |
62 | 192.4641 |
63 | 199.7185 |
66 | 221.4816 |
68 | 235.9904 |
70 | 250.4992 |
72 | 265.0080 |
73 | 272.2624 |
74 | 279.5168 |
74 | 279.5168 |
75 | 286.7712 |
75 | 286.7712 |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Height(x) | weight(y) |
64 | 57 |
60 | 60 |
67 | 73 |
59 | 62 |
69 | 68 |
. cov(x,y)= 18.25, hence cor(x,y)=0.655 ----------------------------------------------------------------------------------------------------------------------
GPA(x) | Hours watching tv(y) |
2.5 | 15 |
2.9 | 13 |
3.5 | 5 |
3.15 | 4 |
3.9 | 12 |
(x) | y=x2 |
-3 | 9 |
-1 | 1 |
+1 | 1 |
+3 | 9 |
Here sum of x is zero(=0)
Hence
Hence correlation is zero.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PLEASE UPVOTE IF YOU LIKE Y ANSWER.
THANK YOU.