My Presentation
Warning: This analysis is for instruction purposes only!
1 Import data
2 Healthy life expectancy plot
The relationship between ladder score and healthy life expectancy is depicted in Figure 1. Figure 1 (a) shows one regression line for each region, and Figure 1 (b) shows one overall regression line.
The regression model for the second plot is Equation 1.
\[ Healthy Life Expectancy = \hat{beta}_0 + \hat{beta}_1 \times LadderScore + \epsilon \tag{1}\]
Code
happy_full %>%
ggplot(aes(ladder_score, healthy_life_expectancy)) +
geom_point() +
geom_smooth(aes(col = region),
method = "lm",
se = FALSE) +
theme_bw()
happy_full %>%
ggplot(aes(ladder_score, healthy_life_expectancy)) +
geom_point() +
geom_smooth(method = "lm",
se = FALSE) +
theme_bw() 3 Summary Statistics
The mean healthy life expectancy for Western Europe and Sub-Saharan Africa are -
- Western Europe - 73 years
- Sub-Saharan Africa - 56 years