Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please Use R program to solve it thank you! Data table B1 has data from a past N

ID: 2936693 • Letter: P

Question

Please Use R program to solve it thank you!

Data table B1 has data from a past NFL football season.

(a) Fit a linear regression of the response y (number of wins) to all nine covariates. Report

summary.

(b) What percentage of the variance is explained by the model in (a)?

(c) Based on the results of (a), you decide to fit a reduced model using only x2, x7, x8, x9.

Report summary. Is this model superior to the model in part (a)? Briefly explain your

reasoning.

Data table B1:

y x1 x2 x3 x4 x5 x6 x7 x8 x9 10 2113 1985 38.9 64.7 4 868 59.7 2205 1917 11 2003 2855 38.8 61.3 3 615 55 2096 1575 11 2957 1737 40.1 60 14 914 65.6 1847 2175 13 2285 2905 41.6 45.3 -4 957 61.4 1903 2476 10 2971 1666 39.2 53.8 15 836 66.1 1457 1866 11 2309 2927 39.7 74.1 8 786 61 1848 2339 10 2528 2341 38.1 65.4 12 754 66.1 1564 2092 11 2147 2737 37 78.3 -1 761 58 1821 1909 4 1689 1414 42.1 47.6 -3 714 57 2577 2001 2 2566 1838 42.3 54.2 -1 797 58.9 2476 2254 7 2363 1480 37.3 48 19 984 67.5 1984 2217 10 2109 2191 39.5 51.9 6 700 57.2 1917 1758 9 2295 2229 37.4 53.6 -5 1037 58.8 1761 2032 9 1932 2204 35.1 71.4 3 986 58.6 1709 2025 6 2213 2140 38.8 58.3 6 819 59.2 1901 1686 5 1722 1730 36.6 52.6 -19 791 54.4 2288 1835 5 1498 2072 35.3 59.3 -5 776 49.6 2072 1914 5 1873 2929 41.1 55.3 10 789 54.3 2861 2496 6 2118 2268 38.2 69.6 6 582 58.7 2411 2670 4 1775 1983 39.3 78.3 7 901 51.7 2289 2202 3 1904 1792 39.7 38.1 -9 734 61.9 2203 1988 3 1929 1606 39.7 68.8 -21 627 52.7 2592 2324 4 2080 1492 35.5 68.8 -8 722 57.8 2053 2550 10 2301 2835 35.3 74.1 2 683 59.7 1979 2110 6 2040 2416 38.7 50 0 576 54.9 2048 2628 8 2447 1638 39.9 57.1 -8 848 65.3 1786 1776 2 1416 2649 37.4 56.3 -22 684 43.8 2876 2524 0 1503 1503 39.3 47 -9 875 53.5 2560 2241

Explanation / Answer

> D=read.csv(file.choose(),sep=",",header=TRUE)
> View(D)
> head(D,5)
y x1 x2 x3 x4 x5 x6 x7 x8 x9
1 10 2113 1985 38.9 64.7 4 868 59.7 2205 1917
2 11 2003 2855 38.8 61.3 3 615 55.0 2096 1575
3 11 2957 1737 40.1 60.0 14 914 65.6 1847 2175
4 13 2285 2905 41.6 45.3 -4 957 61.4 1903 2476
5 10 2971 1666 39.2 53.8 15 836 66.1 1457 1866
> dim(D)
[1] 28 10
> fit=lm(y~x1+x2+x3+x4+x5+x6+x7+x8+x9,data=D)
> fit

Call:
lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9,
data = D)

Coefficients:
(Intercept) x1 x2 x3 x4  
-7.292e+00 8.124e-04 3.631e-03 1.222e-01 3.189e-02  
x5 x6 x7 x8 x9  
1.511e-05 1.590e-03 1.544e-01 -3.895e-03 -1.791e-03  

> summary(fit)

Call:
lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9,
data = D)

Residuals:
Min 1Q Median 3Q Max
-3.0408 -0.6802 -0.1131 0.9835 2.9785

Coefficients:
Estimate Std. Error t value Pr(>|t|)   
(Intercept) -7.292e+00 1.281e+01 -0.569 0.576312   
x1 8.124e-04 2.006e-03 0.405 0.690329   
x2 3.631e-03 8.410e-04 4.318 0.000414 ***
x3 1.222e-01 2.590e-01 0.472 0.642750   
x4 3.189e-02 4.160e-02 0.767 0.453289   
x5 1.511e-05 4.684e-02 0.000 0.999746   
x6 1.590e-03 3.248e-03 0.490 0.630338   
x7 1.544e-01 1.521e-01 1.015 0.323547   
x8 -3.895e-03 2.052e-03 -1.898 0.073793 .  
x9 -1.791e-03 1.417e-03 -1.264 0.222490   
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.83 on 18 degrees of freedom
Multiple R-squared: 0.8156, Adjusted R-squared: 0.7234
F-statistic: 8.846 on 9 and 18 DF, p-value: 5.303e-05

> ##percentage of the variance is explained by the model is 81.56
> ##Reduced model
> fit1=lm(y~x2+x7+x8+x9,data=D)
> fit1

Call:
lm(formula = y ~ x2 + x7 + x8 + x9, data = D)

Coefficients:
(Intercept) x2 x7 x8 x9  
-1.821703 0.003819 0.216894 -0.004015 -0.001635  

> summary(fit1)

Call:
lm(formula = y ~ x2 + x7 + x8 + x9, data = D)

Residuals:
Min 1Q Median 3Q Max
-3.3519 -0.5612 -0.0856 0.6972 3.2802

Coefficients:
Estimate Std. Error t value Pr(>|t|)   
(Intercept) -1.8217034 7.7847061 -0.234 0.81705   
x2 0.0038186 0.0007051 5.416 1.67e-05 ***
x7 0.2168941 0.0886759 2.446 0.02252 *  
x8 -0.0040149 0.0013983 -2.871 0.00863 **
x9 -0.0016349 0.0012460 -1.312 0.20244   
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.681 on 23 degrees of freedom
Multiple R-squared: 0.8012, Adjusted R-squared: 0.7666
F-statistic: 23.17 on 4 and 23 DF, p-value: 8.735e-08

> #Gererally we choose the model which have higher Adjusted R square.
> #Adjusted R-square increases only if that regressor contribute significantly in the model.
> #Here Adjusted R square for model 1 is 72.34% and for model 2 it is 76.66% Hence model 2 is better.
> #We can choose model on the basis of AIC and BIC also
> #We always preffer the model with lower AIC. It is one of the model selection criterion.
> #(We can choose model with lower BIC also, But when sample size is less one should choose model on the basis of AIC)
>
> AIC(fit)
[1] 122.937
> AIC(fit1)
[1] 115.0435
>
> #AIC for model 2 is less hence model 2 is better.
> # With both Adjusted R square and AIC criterion we can conclude that model 2 is better.
Conclusion: Model 2 is superior.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote