In: Statistics and Probability
Enter the Shoe Size and Height data from the In class data Excel file (use the excel in class data lab file loaded into the files section of Canvas) into the week 7 Regression Excel sheet. Create a scatter plot for the data, store and graph the regression equation, and note the r2 and r value.
Shoe Size | Height (inches) |
10 | 61 |
5 | 62 |
6 | 63 |
12 | 63 |
8 | 64 |
8 | 65 |
9 | 65 |
10 | 66 |
7 | 66 |
11 | 67 |
10 | 67 |
7 | 67 |
9 | 67 |
11 | 68 |
10 | 68 |
12 | 69 |
11 | 69 |
13 | 69 |
9 | 69 |
11 | 69 |
8 | 69 |
9 | 69 |
9 | 70 |
5 | 70 |
10 | 70 |
12 | 70 |
9 | 70 |
11 | 71 |
9 | 71 |
10 | 71 |
9 | 73 |
9 | 73 |
7 | 74 |
11 | 74 |
13 | 75 |
I used R software to solve this problem.
R code:
> size=scan('clipboard')
Read 35 items
> size
[1] 10 5 6 12 8 8 9 10 7 11 10 7 9 11 10 12 11 13 9 11 8 9 9 5
10
[26] 12 9 11 9 10 9 9 7 11 13
> height=scan('clipboard')
Read 35 items
> height
[1] 61 62 63 63 64 65 65 66 66 67 67 67 67 68 68 69 69 69 69 69 69
69 70 70 70
[26] 70 70 71 71 71 73 73 74 74 75
> fit=lm(height~size)
> summary(fit)
Call:
lm(formula = height ~ size)
Residuals:
Min 1Q Median 3Q Max
-7.6722 -1.9103 -0.1485 1.8278 6.7567
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 63.9093 2.7372 23.348 <2e-16 ***
size 0.4763 0.2841 1.677 0.103
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.344 on 33 degrees of freedom
Multiple R-squared: 0.07851, Adjusted R-squared: 0.05059
F-statistic: 2.812 on 1 and 33 DF, p-value: 0.103
> plot(height~size) # it gives scatter plot
> abline(fit) # it plot regression line on scatter plot
Scatter plot: