Data Preparation

I downloaded the lastest dataset from 2021. I uploaded it into github and reading the RAW data from github.

# load data
# examine all available CES microdata files.
library(tidyverse)
happiness <- read.csv("https://raw.githubusercontent.com/Wilchau/Data606_Happiness_Project/main/world-happiness-report-2021.csv.xls")

Research question

You should phrase your research question in a way that matches up with the scope of inference your dataset allows for.

I feel like happiness is a very important factor to living these days. This dataset was reported for 2021 on happiness. Goveronment study down and being isolated contributed to the happiness of everyone.

I wanted to see a correlation on how freedom to make life choices, and social support can contribute to the happiness of others?

Cases

What are the cases, and how many are there?

There’s a total of 149 observations with 20 variables to focus on.

head(happiness)
##   Country.name Regional.indicator Ladder.score Standard.error.of.ladder.score
## 1      Finland     Western Europe        7.842                          0.032
## 2      Denmark     Western Europe        7.620                          0.035
## 3  Switzerland     Western Europe        7.571                          0.036
## 4      Iceland     Western Europe        7.554                          0.059
## 5  Netherlands     Western Europe        7.464                          0.027
## 6       Norway     Western Europe        7.392                          0.035
##   upperwhisker lowerwhisker Logged.GDP.per.capita Social.support
## 1        7.904        7.780                10.775          0.954
## 2        7.687        7.552                10.933          0.954
## 3        7.643        7.500                11.117          0.942
## 4        7.670        7.438                10.878          0.983
## 5        7.518        7.410                10.932          0.942
## 6        7.462        7.323                11.053          0.954
##   Healthy.life.expectancy Freedom.to.make.life.choices Generosity
## 1                    72.0                        0.949     -0.098
## 2                    72.7                        0.946      0.030
## 3                    74.4                        0.919      0.025
## 4                    73.0                        0.955      0.160
## 5                    72.4                        0.913      0.175
## 6                    73.3                        0.960      0.093
##   Perceptions.of.corruption Ladder.score.in.Dystopia
## 1                     0.186                     2.43
## 2                     0.179                     2.43
## 3                     0.292                     2.43
## 4                     0.673                     2.43
## 5                     0.338                     2.43
## 6                     0.270                     2.43
##   Explained.by..Log.GDP.per.capita Explained.by..Social.support
## 1                            1.446                        1.106
## 2                            1.502                        1.108
## 3                            1.566                        1.079
## 4                            1.482                        1.172
## 5                            1.501                        1.079
## 6                            1.543                        1.108
##   Explained.by..Healthy.life.expectancy
## 1                                 0.741
## 2                                 0.763
## 3                                 0.816
## 4                                 0.772
## 5                                 0.753
## 6                                 0.782
##   Explained.by..Freedom.to.make.life.choices Explained.by..Generosity
## 1                                      0.691                    0.124
## 2                                      0.686                    0.208
## 3                                      0.653                    0.204
## 4                                      0.698                    0.293
## 5                                      0.647                    0.302
## 6                                      0.703                    0.249
##   Explained.by..Perceptions.of.corruption Dystopia...residual
## 1                                   0.481               3.253
## 2                                   0.485               2.868
## 3                                   0.413               2.839
## 4                                   0.170               2.967
## 5                                   0.384               2.798
## 6                                   0.427               2.580

Data collection

Describe the method of data collection.

This data was collected in 2021 by Sustainable Development Solutions Network.

Type of study

What type of study is this (observational/experiment)?

This type of study is obsersvational.

Data Source

If you collected the data, state self-collected. If not, provide a citation/link.

This is where I got the dataset: https://www.kaggle.com/datasets/ajaypalsinghlo/world-happiness-report-2021

This data is collected by the World Happiness Report where they do a landmark survey of the state of global happiness. This is supported by the government and public policy. There was no attempt made to affect the outcome of this dataset.

Dependent Variable

What is the response variable? Is it quantitative or qualitative?

The response variable is freedom to make life choices, and social support equantitative(numeric value)

Independent Variable(s)

The indepedent variables are Ladder score, Regional indciator, Explained by: Social Support, and Explained by: freedom to make life chocies.

Relevant summary statistics

Provide summary statistics for each the variables. Also include appropriate visualizations related to your research question (e.g. scatter plot, boxplots, etc). This step requires the use of R, hence a code chunk is provided below. Insert more code chunks as needed.

head(happiness)
##   Country.name Regional.indicator Ladder.score Standard.error.of.ladder.score
## 1      Finland     Western Europe        7.842                          0.032
## 2      Denmark     Western Europe        7.620                          0.035
## 3  Switzerland     Western Europe        7.571                          0.036
## 4      Iceland     Western Europe        7.554                          0.059
## 5  Netherlands     Western Europe        7.464                          0.027
## 6       Norway     Western Europe        7.392                          0.035
##   upperwhisker lowerwhisker Logged.GDP.per.capita Social.support
## 1        7.904        7.780                10.775          0.954
## 2        7.687        7.552                10.933          0.954
## 3        7.643        7.500                11.117          0.942
## 4        7.670        7.438                10.878          0.983
## 5        7.518        7.410                10.932          0.942
## 6        7.462        7.323                11.053          0.954
##   Healthy.life.expectancy Freedom.to.make.life.choices Generosity
## 1                    72.0                        0.949     -0.098
## 2                    72.7                        0.946      0.030
## 3                    74.4                        0.919      0.025
## 4                    73.0                        0.955      0.160
## 5                    72.4                        0.913      0.175
## 6                    73.3                        0.960      0.093
##   Perceptions.of.corruption Ladder.score.in.Dystopia
## 1                     0.186                     2.43
## 2                     0.179                     2.43
## 3                     0.292                     2.43
## 4                     0.673                     2.43
## 5                     0.338                     2.43
## 6                     0.270                     2.43
##   Explained.by..Log.GDP.per.capita Explained.by..Social.support
## 1                            1.446                        1.106
## 2                            1.502                        1.108
## 3                            1.566                        1.079
## 4                            1.482                        1.172
## 5                            1.501                        1.079
## 6                            1.543                        1.108
##   Explained.by..Healthy.life.expectancy
## 1                                 0.741
## 2                                 0.763
## 3                                 0.816
## 4                                 0.772
## 5                                 0.753
## 6                                 0.782
##   Explained.by..Freedom.to.make.life.choices Explained.by..Generosity
## 1                                      0.691                    0.124
## 2                                      0.686                    0.208
## 3                                      0.653                    0.204
## 4                                      0.698                    0.293
## 5                                      0.647                    0.302
## 6                                      0.703                    0.249
##   Explained.by..Perceptions.of.corruption Dystopia...residual
## 1                                   0.481               3.253
## 2                                   0.485               2.868
## 3                                   0.413               2.839
## 4                                   0.170               2.967
## 5                                   0.384               2.798
## 6                                   0.427               2.580
summary(happiness$Social.support)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.4630  0.7500  0.8320  0.8147  0.9050  0.9830
summary(happiness$Freedom.to.make.life.choices)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.3820  0.7180  0.8040  0.7916  0.8770  0.9700

Looking through social support and freedom to make life choices. I see that a range of 0 to 1 is used here. Closest to 1 meaning sigifncant results while going close to 0 means there is a huge decline.

happiness %>%
  pivot_longer(cols = c(Social.support, Freedom.to.make.life.choices)) %>%
  ggplot(mapping = aes(x = value)) +
  geom_histogram() +
  facet_wrap(~name, scales = "free_x")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

happiness %>%
  ggplot(mapping = aes(x = Ladder.score, y = Social.support)) +
  geom_point()

happiness %>%
  ggplot(mapping = aes(x = Ladder.score, y = Freedom.to.make.life.choices)) +
  geom_point()