Get Started: Run the below codes without changing anything
The below questions will use the Singapore dataset. Choose 5 questions to answer.
mod_life <- lm (lifeExp ~ gdpPercap, data = Singapore)
summary (mod_life)
##
## Call:
## lm(formula = lifeExp ~ gdpPercap, data = Singapore)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.9944 -0.8075 0.8923 1.7135 1.9727
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.450e+01 1.074e+00 60.035 4.00e-14 ***
## gdpPercap 3.858e-04 4.767e-05 8.093 1.06e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.36 on 10 degrees of freedom
## Multiple R-squared: 0.8675, Adjusted R-squared: 0.8543
## F-statistic: 65.5 on 1 and 10 DF, p-value: 1.064e-05
Formula would be lifeExp = 6.450e+01 + 3.858e-04 * gdpPercap
The low p-value of 1.064e-05 indicates that it is a significant predictor
The coefficients for gdpPercap represent a change of 3.858e-04 for a one-unit change in gdpPercap.
max_pop_Singapore <- Singapore %>%
filter (pop == max(pop)) %>%
select (year)
max_pop_Singapore
## # A tibble: 1 × 1
## year
## <int>
## 1 2007