MGT6203 - HW2 Solutions
Sowmya Tata
9/9/2019
Questions 1 to 3 - Weeks 1 & 2 Content
1) C Explanation - “R squared” individually can’t tell whether a variable is
significant or not because each time when we add a feature, “R squared”
can either increase or stay constant. But, it is not true in case of
“Adjusted R squared” (increases when features found to be significant).
2) D Explanation - Correlation coefficient range is between [-1 ,1]. So -1.09 is
not possible.
3) B Explanation - Since Linear Regression models and predicts continuous
variables, the predicted probability may lie outside the prescribed values
for a probability (that is, outside the range of 0 and 1). This is where a
Logistic Regression helps.
Questions 4 and 5 - Week 3 Content
nba <- read.csv("nba2017.csv", header=TRUE)
model_1 <- lm(Salary ~ Ht+Exp, data = nba)
summary(model_1)
##
## Call:
## lm(formula = Salary ~ Ht + Exp, data = nba)
##
## Residuals:
## Min 1Q Median 3Q Max
## -11584274 -2907609 -1371039 1880620 19884672
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -12353214 5785552 -2.135 0.0332 *
## Ht 2253985 874758 2.577 0.0103 *
## Exp 677390 61100 11.087 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5728000 on 496 degrees of freedom
## Multiple R-squared: 0.2042, Adjusted R-squared: 0.201
## F-statistic: 63.65 on 2 and 496 DF, p-value: < 2.2e-16
model_2 <- lm(log(Salary) ~ Ht+Exp, data = nba)
summary(model_2)