After visualization of the correlation of happiness score and other factors in different levels, we decide to formally test the main effect of gdp, social support, life_expectancy, freedom, positive_affect, negative_affect , generosity and corruption on the happiness score and the interaction effect between several covariates.
By the inspiration of exploratory correlation plots, the developing levels and continent may also influence the estimates in the regression model. However, wwe think that the difference in correlation coefficient between continents mainly due to the developing level. . Besides, we define the developing level based on the gdp, so we exclude gdp and only include the developing level as a categorical variable in the final analysis.
social support, life_expectancy, positive_affect and corruption to interact with develop.happy = read_csv("data/happy.csv")
data = happy %>%
mutate(develop = as.factor(develop),
continent = as.factor(continent)) %>%
select(-c(country, year, o_gdp))
fit1 = lm(happiness_score~
freedom +
negative_affect +
generosity +
social_support*develop +
life_expectance*develop +
positive_affect*develop +
corruption*develop, data = data)
There is a significant interaction effect of social_support and develop, corruption and develop. The effect of social_support and corruption on the Happiness Score is depending on the value of develop at 0.001 significance level.
There is no overall significant effect of either develop or life_expectance, but there is a significant crossover interaction at 0.001 significance level. The effect of life_expectance on the Happiness Score is opposite, depending on the value of develop.
To interpret the results, we conduct the stratified analysis based on the developing level. Results are below, and model assumptions are checked after the discussion.
developing = happy %>%
filter(develop == "developing") %>%
select(-c(o_gdp, develop, continent, country, year))
developed = happy %>%
filter(develop == "developed") %>%
select(-c(o_gdp, develop, continent, country, year))
fit2 = lm(happiness_score~., data = developing)
fit3 = lm(happiness_score~., data = developed)
gdp, social_support, life_expectance and positive_affect on the Happiness Score, at 0.001 significance level.fit2 %>% broom::tidy() %>% knitr::kable(digits = 3)
| term | estimate | std.error | statistic | p.value |
|---|---|---|---|---|
| (Intercept) | -2.324 | 0.243 | -9.55 | 0.000 |
| gdp | 0.248 | 0.032 | 7.78 | 0.000 |
| social_support | 1.549 | 0.210 | 7.37 | 0.000 |
| life_expectance | 0.033 | 0.004 | 7.97 | 0.000 |
| freedom | 0.362 | 0.161 | 2.25 | 0.025 |
| generosity | -0.139 | 0.132 | -1.05 | 0.292 |
| corruption | 0.086 | 0.165 | 0.52 | 0.600 |
| positive_affect | 2.322 | 0.217 | 10.71 | 0.000 |
| negative_affect | 0.078 | 0.230 | 0.34 | 0.734 |
social_support, positive_affect and generosity, and there is significant negative effect of corruption on the Happiness Score, at 0.001 siginificance level.fit3 %>% broom::tidy() %>% knitr::kable(digits = 3)
| term | estimate | std.error | statistic | p.value |
|---|---|---|---|---|
| (Intercept) | -3.04 | 1.47 | -2.1 | 0.039 |
| gdp | 0.27 | 0.11 | 2.5 | 0.013 |
| social_support | 5.85 | 0.62 | 9.4 | 0.000 |
| life_expectance | 0.01 | 0.01 | 1.1 | 0.292 |
| freedom | -0.62 | 0.32 | -1.9 | 0.055 |
| generosity | 0.96 | 0.18 | 5.3 | 0.000 |
| corruption | -0.47 | 0.16 | -3.0 | 0.003 |
| positive_affect | 2.22 | 0.40 | 5.6 | 0.000 |
| negative_affect | -0.53 | 0.45 | -1.2 | 0.242 |
Although the happiness score slightly increases from 2007 to 2018 in the worldwide level, some regions have decreasing trend, and developed countries also have decreasing trend. It is interesting that the happiness score does not increase given the economic growth.
From the correlation analysis and the stratified analysis in linear regression, the happiness score is highly associated with the social support and positive affect both in developed countries and developing countries. However, gdp and life expectancy are positively associated with happiness score only in the developing countries, while generosity is positively , and corruption is negatively associated with happiness score only in the developed countries.
These results are reasonable and mostly what we expect. Overall, happiness score depends on economics (GDP), social support (someone to count on), health (life expectancy), positive mood (positive affect) and perceptions of corruption. For developing countries, economics and health become more important in evaluating happiness, while for developed countries, perceptions of corruption and generosity(donation) become more crucial.
The government of developing countries should focus more on economic growth and improving healthcare to increase the happiness perception. The government of developed countries should have policies to control the corruption in the business and government and have policies to encourage donation to increase the happiness perception.