MGT 6203 MIDTERM – SOLUTION KEY PART 2 CODING QUESTIONS WITH ANSWERS.) Please estimate a linear regression model (using the lm function) with Personal
... [Show More] as the dependent variable and Room.Board as the independent variable. What are the model’s Rsquared and adjusted R-squared values? a) 0.00549, 0.048 b) 0.0143, 0.022 c) 0.0398, 0.0385 d) 0.0325, 0.0336 Answer: C (Week 1 Lesson 4) library("ISLR") data("College") summary(lm(College$Personal~College$Room.Board)) ## ## Call: ## lm(formula = College$Personal ~ College$Room.Board) ## ## Residuals: ## Min 1Q Median 3Q Max ## -1153.1 -444.6 -92.3 316.0 5505.2 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 1877.14827 97.64374 19.224 < 2e-16 *** ## College$Room.Board -0.12312 0.02173 -5.666 2.06e-08 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Residual standard error: 663.9 on 775 degrees of freedom ## Multiple R-squared: 0.03977, Adjusted R-squared: 0.03853 ## F-statistic: 32.1 on 1 and 775 DF, p-value: 2.065e-08 Q22)Based on the linear-linear regression model in the previous question (with Personal as the dependent variable and Room.Board as the independent variable), fit three nonlinear models using those two variables. Based on their adjusted R-squared values, which one of the four models is most appropriate to use? a) Log-Linear b) Log-Log c) Linear-Linear d) Linear-Log Answer: B (Week 3 lesson 4) summary(lm(log(College$Personal)~College$Room.Board)) ## Call: ## lm(formula = log(College$Personal) ~ College$Room.Board) ## ## Residuals: ## Min 1Q Median 3Q Max ## -1.61024 -0.31235 0.03383 0.31037 1.77383 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 7.485e+00 6.992e-02 107.057 < 2e-16 *** ## College$Room.Board -9.187e-05 1.556e-05 -5.904 5.3e-09 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Residual standard error: 0.4754 on 775 degrees of freedom ## Multiple R-squared: 0.04304, Adjusted R-squared: 0.04181 ## F-statistic: 34.86 on 1 and 775 DF, p-value: 5.303e-09 summary(lm(log(College$Personal)~log(College$Room.Board))) ## ## Call: ## lm(formula = log(College$Personal) ~ log(College$Room.Board)) ## ## Residuals: ## Min 1Q Median 3Q Max ## -1.60098 -0.31047 0.03916 0.30663 1.78574 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 10.47164 0.56140 18.653 < 2e-16 *** ## log(College$Room.Board) -0.40568 0.06722 -6.035 2.46e-09 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Residual standard error: 0.4749 on 775 degrees of freedom ## Multiple R-squared: 0.04489, Adjusted R-squared: 0.04366 ## F-statistic: 36.42 on 1 and 775 DF, p-value: 2.46e-09 summary(lm(College$Personal~College$Room.Board)) ## ## Call: ## lm(formula = College$Personal ~ College$Room.Board) ## ## Residuals: ## Min 1Q Median 3Q Max ## -1153.1 -444.6 -92.3 316.0 5505.2 ## [Show Less]