Yaqi Zhang s3872859, Ziman Zeng s3874080, Ting Zhang s3873126
Last updated: 25 October 2020
colnames(World)[4] <- "GDP_PPP"
colnames(World)[5] <- "Total_population"
Worldnew <- World[!is.na(World$GDP_PPP),]
Worldnew$GDP_PPP %>% hist(main = "GDP-PPP")plot(GDP_PPP ~ Total_population, data = Worldnew,xlab = "Total Population(Log scaled)",ylab = "GDP_PPP(Log scaled)")
abline(lm(GDP_PPP ~ Total_population, data = Worldnew), col = "RED")Worldnew %>% summarise(Min = min(GDP_PPP,na.rm = TRUE),
Q1 = quantile(GDP_PPP,probs = .25,na.rm = TRUE),
Median = median(GDP_PPP, na.rm = TRUE),
Q3 = quantile(GDP_PPP,probs = .75,na.rm = TRUE),
Max = max(GDP_PPP,na.rm = TRUE),
Mean = mean(GDP_PPP, na.rm = TRUE),
SD = sd(GDP_PPP, na.rm = TRUE),
n = n(),
Missing = sum(is.na(GDP_PPP))) -> table1
knitr::kable(table1)| Min | Q1 | Median | Q3 | Max | Mean | SD | n | Missing |
|---|---|---|---|---|---|---|---|---|
| 19.15763 | 24.12947 | 25.84698 | 28.09133 | 32.36418 | 26.09003 | 2.788551 | 214 | 0 |
\[H_0: data \ do \ not \ fit \ linear \ regression \ model \] \[H_A: data \ fit \ linear \ regression \ model \]
##
## Call:
## lm(formula = GDP_PPP ~ Total_population, data = Worldnew)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.9777 -0.7941 0.1847 0.8259 2.4725
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 10.02404 0.49925 20.08 <2e-16 ***
## Total_population 0.95756 0.02939 32.58 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.14 on 212 degrees of freedom
## Multiple R-squared: 0.8335, Adjusted R-squared: 0.8327
## F-statistic: 1061 on 1 and 212 DF, p-value: < 2.2e-16
## 2.5 % 97.5 %
## (Intercept) 9.0399088 11.008177
## Total_population 0.8996238 1.015497