nstructions What makes people happy? To answer this question, look at this dataset, and try and come with the most concise possible, yet credibe answer (based on these data). As always when you get a...

1 answer below »


nstructions


What makes people happy? To answer this question, look at this dataset, and try and come with the most concise possible, yet credibe answer (based on these data). As always when you get a new dataset, begin with a "Data Assay" or "Exploratory Data Analysis" (EDA). Remember that the most effective way to get efficient insight into your data is by choosing "just the right" visualizations that highlight the most important and poignant findingsin support of this question. Write a concise report with minimal duplication with your R code, and highlighting the empirical support for your conclusion.


Steps are: explicate your research question, frame the appropriate hypotheses, interpret the findings.



Supporting Files


Using the dataset below, examine and test the relationships between several variables and the target variable "Ladder score". Provide the R codes in the R-script file, and the statistical outputs in your Word file (or pdf). In general, your statistical outputs should be titled and labeled so that they can stand on their own (and can be understood by anyone who looks at them for the first time).



  1. Where helpful, create dummy variables to subset your dataset. Then rerun your regression line for your dependent variable using these dummy variables as extra inputs, e.g. "3rd world countries, Region, etc.". How does this change your interpretation? Create a scatterplot with multiple regression lines. How does this impact your understanding of the impact of the categorical variable on the regression?

  2. Using the appropriate subsetted data from step 1 (e.g. Region), create separate regression lines for each subset. How do these regression lines differ from the regression lines in step 1? How does this method of looking at the data change your understanding of the data?



What to Submit


Submit a (preferably brief!) report in Word or PDF format, and also submit your R script. Do not worry about the error message this generates.

Answered 1 days AfterJul 02, 2021

Answer To: nstructions What makes people happy? To answer this question, look at this dataset, and try and come...

Pritam Kumar answered on Jul 04 2021
133 Votes
World Happiness Report Data Analysis
World Happiness Report Data Analysis
Research Question
Which region has the highest happiness score and which has the lowest?
Research Hypothesis
Western Europe and North America & ANZ are two regions where countries have high scores on happiness
Exploratory data analysis
data=read.csv("D:\\New\\worldhappinessreport.csv")
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.3 v purrr 0.3.4
## v tibble 3.1.0 v dplyr 1.0.5
## v tidyr 1.1.3 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(Hmisc)
## Loading required package: lattice
## Loading required package: survival
## Loading required package: Formula
##
## Attaching package: ’Hmisc’
## The following objects are masked from ’package:dplyr’:
##
## src, summarize
1
## The following objects are masked from ’package:base’:
##
## format.pval, units
library(funModeling)
## funModeling v.1.9.4 :)
## Examples and tutorials at livebook.datascienceheroes.com
## / Now in Spanish: librovivodecienciadedatos.ai
library(dplyr)
basic_eda <- function(data)
{
glimpse(data)
print(status(data))
freq(data)
print(profiling_num(data))
plot_num(data)
describe(data)
}
glimpse(data)
## Rows: 149
## Columns: 20
## $ ï..Country.name "Finland", "Denmark", "Swit~
## $ Regional.indicator "Western Europe", "Western ~
## $ Ladder.score 7.842, 7.620, 7.571, 7.554,~
## $ Standard.error.of.ladder.score 0.032, 0.035, 0.036, 0.059,~
## $ upperwhisker 7.90
4, 7.687, 7.643, 7.670,~
## $ lowerwhisker 7.780, 7.552, 7.500, 7.438,~
## $ Logged.GDP.per.capita 10.775, 10.933, 11.117, 10.~
## $ Social.support 0.954, 0.954, 0.942, 0.983,~
## $ Healthy.life.expectancy 72.000, 72.700, 74.400, 73.~
## $ Freedom.to.make.life.choices 0.949, 0.946, 0.919, 0.955,~
## $ Generosity -0.098, 0.030, 0.025, 0.160~
## $ Perceptions.of.corruption 0.186, 0.179, 0.292, 0.673,~
## $ Ladder.score.in.Dystopia 2.43, 2.43, 2.43, 2.43, 2.4~
## $ Explained.by..Log.GDP.per.capita 1.446, 1.502, 1.566, 1.482,~
## $ Explained.by..Social.support 1.106, 1.108, 1.079, 1.172,~
## $ Explained.by..Healthy.life.expectancy 0.741, 0.763, 0.816, 0.772,~
## $ Explained.by..Freedom.to.make.life.choices 0.691, 0.686, 0.653, 0.698,~
## $ Explained.by..Generosity 0.124, 0.208, 0.204, 0.293,~
## $ Explained.by..Perceptions.of.corruption 0.481, 0.485, 0.413, 0.170,~
## $ Dystopia...residual 3.253, 2.868, 2.839, 2.967,~
status(data)
## variable
## ï..Country.name ï..Country.name
## Regional.indicator Regional.indicator
2
## Ladder.score Ladder.score
## Standard.error.of.ladder.score Standard.error.of.ladder.score
## upperwhisker upperwhisker
## lowerwhisker lowerwhisker
## Logged.GDP.per.capita Logged.GDP.per.capita
## Social.support Social.support
## Healthy.life.expectancy Healthy.life.expectancy
## Freedom.to.make.life.choices Freedom.to.make.life.choices
## Generosity Generosity
## Perceptions.of.corruption Perceptions.of.corruption
## Ladder.score.in.Dystopia Ladder.score.in.Dystopia
## Explained.by..Log.GDP.per.capita Explained.by..Log.GDP.per.capita
## Explained.by..Social.support Explained.by..Social.support
## Explained.by..Healthy.life.expectancy Explained.by..Healthy.life.expectancy
## Explained.by..Freedom.to.make.life.choices Explained.by..Freedom.to.make.life.choices
## Explained.by..Generosity Explained.by..Generosity
## Explained.by..Perceptions.of.corruption Explained.by..Perceptions.of.corruption
## Dystopia...residual Dystopia...residual
## q_zeros p_zeros q_na p_na q_inf
## ï..Country.name 0 0.000000000 0 0 0
## Regional.indicator 0 0.000000000 0 0 0
## Ladder.score 0 0.000000000 0 0 0
## Standard.error.of.ladder.score 0 0.000000000 0 0 0
## upperwhisker 0 0.000000000 0 0 0
## lowerwhisker 0 0.000000000 0 0 0
## Logged.GDP.per.capita 0 0.000000000 0 0 0
## Social.support 0 0.000000000 0 0 0
## Healthy.life.expectancy 0 0.000000000 0 0 0
## Freedom.to.make.life.choices 0 0.000000000 0 0 0
## Generosity 0 0.000000000 0 0 0
## Perceptions.of.corruption 0 0.000000000 0 0 0
## Ladder.score.in.Dystopia 0 0.000000000 0 0 0
## Explained.by..Log.GDP.per.capita 1 0.006711409 0 0 0
## Explained.by..Social.support 1 0.006711409 0 0 0
## Explained.by..Healthy.life.expectancy 1 0.006711409 0 0 0
## Explained.by..Freedom.to.make.life.choices 1 0.006711409 0 0 0
## Explained.by..Generosity 1 0.006711409 0 0 0
## Explained.by..Perceptions.of.corruption 1 0.006711409 0 0 0
## Dystopia...residual 0 0.000000000 0 0 0
## p_inf type unique
## ï..Country.name 0 character 149
## Regional.indicator 0 character 10
## Ladder.score 0 numeric 147
## Standard.error.of.ladder.score 0 numeric 65
## upperwhisker 0 numeric 146
## lowerwhisker 0 numeric 143
## Logged.GDP.per.capita 0 numeric 148
## Social.support 0 numeric 119
## Healthy.life.expectancy 0 numeric 135
## Freedom.to.make.life.choices 0 numeric 126
## Generosity 0 numeric 130
## Perceptions.of.corruption 0 numeric 130
## Ladder.score.in.Dystopia 0 numeric 1
## Explained.by..Log.GDP.per.capita 0 numeric 138
3
## Explained.by..Social.support 0 numeric 135
## Explained.by..Healthy.life.expectancy 0 numeric 119
## Explained.by..Freedom.to.make.life.choices 0 numeric 130
## Explained.by..Generosity 0 numeric 119
## Explained.by..Perceptions.of.corruption 0 numeric 117
## Dystopia...residual 0 numeric 142
freq(data)
## Warning in freq_logic(data = data, input = input[i], plot, na.rm, path_out
## = path_out): Skipping plot for variable ’ï..Country.name’ (more than 100
## categories)
## ï..Country.name frequency percentage cumulative_perc
## 1 Afghanistan 1 0.67 0.67
## 2 Albania 1 0.67 1.34
## 3 Algeria 1 0.67 2.01
## 4 Argentina 1 0.67 2.68
## 5 Armenia 1 0.67 3.35
## 6 Australia 1 0.67 4.02
## 7 Austria 1 0.67 4.69
## 8 Azerbaijan 1 0.67 5.36
## 9 Bahrain 1 0.67 6.03
## 10 Bangladesh 1 0.67 6.70
## 11 Belarus 1 0.67 7.37
## 12 Belgium 1 0.67 8.04
## 13 Benin 1 0.67 8.71
## 14 Bolivia 1 0.67 9.38
## 15 Bosnia and Herzegovina 1 0.67 10.05
## 16 Botswana 1 0.67 10.72
## 17 Brazil 1 0.67 11.39
## 18 Bulgaria 1 0.67 12.06
## 19 Burkina Faso 1 0.67 12.73
## 20 Burundi 1 0.67 13.40
## 21 Cambodia 1 0.67 14.07
## 22 Cameroon 1 0.67 14.74
## 23 Canada 1 0.67 15.41
## 24 Chad 1 0.67 16.08
## 25 Chile 1 0.67 16.75
## 26 China 1 0.67 17.42
## 27 Colombia 1 0.67 18.09
## 28 Comoros 1 0.67 18.76
## 29 Congo (Brazzaville) 1 0.67 19.43
## 30 Costa Rica 1 0.67 20.10
## 31 Croatia 1 0.67 20.77
## 32 Cyprus 1 0.67 21.44
## 33 Czech Republic 1 0.67 22.11
## 34 Denmark 1 0.67 22.78
## 35 Dominican Republic 1 0.67 23.45
## 36 Ecuador 1 0.67 24.12
## 37 Egypt 1 0.67 24.79
## 38 El Salvador 1 0.67 25.46
## 39 Estonia 1 0.67 26.13
4
## 40 Ethiopia 1 0.67 26.80
## 41 Finland 1 0.67 27.47
## 42 France 1 0.67 28.14
## 43 Gabon 1 0.67 28.81
## 44 Gambia 1 0.67 29.48
## 45 Georgia 1 0.67 30.15
## 46 Germany 1 0.67 30.82
## 47 Ghana 1 0.67 31.49
## 48 Greece 1 0.67 32.16
## 49 Guatemala 1 0.67 32.83
## 50 Guinea 1 0.67 33.50
## 51 Haiti 1 0.67 34.17
## 52 Honduras 1 0.67 34.84
## 53 Hong Kong S.A.R. of China 1 0.67 35.51
## 54 Hungary 1 0.67 36.18
## 55 Iceland 1 0.67 36.85
## 56 India 1 0.67 37.52
## 57 Indonesia 1 0.67 38.19
## 58 Iran 1 0.67 38.86
## 59 Iraq 1 0.67 39.53
## 60 Ireland 1 0.67 40.20
## 61 Israel 1 0.67 40.87
## 62 Italy 1 0.67 41.54
## 63 Ivory Coast 1 0.67 42.21
## 64 Jamaica 1 0.67 42.88
## 65 Japan 1 0.67 43.55
## 66 Jordan 1 0.67 44.22
## 67 Kazakhstan 1 0.67 44.89
## 68 Kenya 1 0.67 45.56
## 69 Kosovo 1 0.67 46.23
## 70 Kuwait 1 0.67 46.90
## 71 Kyrgyzstan 1 0.67 47.57
## 72 Laos 1 0.67 48.24
## 73 Latvia 1 0.67 48.91
## 74 Lebanon 1 0.67 49.58
## 75 Lesotho 1 0.67 50.25
## 76 Liberia 1 0.67 50.92
## 77 Libya 1 0.67 51.59
## 78 Lithuania 1 0.67 52.26
## 79 Luxembourg 1 0.67 52.93
## 80 Madagascar 1 0.67 53.60
## 81 Malawi 1 0.67 54.27
## 82 Malaysia 1 0.67 54.94
## 83 Maldives 1 0.67 55.61
## 84 Mali 1 0.67 56.28
## 85 Malta 1 0.67 56.95
## 86 Mauritania 1 0.67 57.62
## 87 Mauritius 1 0.67 58.29
## 88 Mexico 1 0.67 58.96
## 89 Moldova 1 0.67 59.63
## 90 Mongolia 1 0.67 60.30
## 91 Montenegro 1 0.67 60.97
## 92 Morocco 1 0.67 61.64
## 93 Mozambique 1 0.67 62.31
5
## 94 Myanmar 1 0.67 62.98
## 95 Namibia 1 0.67 63.65
## 96 Nepal 1 0.67 64.32
## 97 Netherlands 1 0.67 64.99
## 98 New Zealand 1 0.67 65.66
## 99 Nicaragua 1 0.67 66.33
## 100 Niger 1 0.67 67.00
## 101 Nigeria 1 0.67 67.67
## 102 North Cyprus 1 0.67 68.34
## 103 North Macedonia 1 0.67 69.01
## 104 Norway 1 0.67 69.68
## 105 Pakistan 1 0.67 70.35
## 106 Palestinian Territories 1 0.67 71.02
## 107 Panama 1 0.67 71.69
## 108 Paraguay 1 0.67 72.36
## 109 Peru 1 0.67 73.03
## 110 Philippines 1 0.67 73.70
## 111 Poland 1 0.67 74.37
## 112 Portugal 1 0.67 75.04
## 113 Romania 1 0.67 75.71
## 114 Russia 1 0.67 76.38
## 115 Rwanda 1 0.67 77.05
## 116 Saudi Arabia 1 0.67 77.72
## 117 Senegal 1 0.67 78.39
## 118 Serbia 1 0.67 79.06
## 119 Sierra Leone 1 0.67 79.73
## 120 Singapore 1 0.67 80.40
## 121 Slovakia 1 0.67 81.07
## 122 Slovenia 1 0.67 81.74
## 123 South Africa 1 0.67 82.41
## 124 South Korea 1 0.67 83.08
## 125 Spain 1 0.67 83.75
## 126 Sri Lanka 1 0.67 84.42
## 127 Swaziland 1 0.67 85.09
## 128 Sweden 1 0.67 85.76
## 129 Switzerland 1 0.67 86.43
## 130 Taiwan Province of China 1 0.67 87.10
## 131 Tajikistan 1 0.67 87.77
## 132 Tanzania 1 0.67 88.44
## 133 Thailand 1 0.67 89.11
## 134 Togo 1 0.67 89.78
## 135 Tunisia 1 0.67 90.45
## 136 Turkey 1 0.67 91.12
## 137 Turkmenistan 1 0.67 91.79
## 138 Uganda 1 0.67 92.46
## 139 Ukraine 1 0.67 93.13
## 140 United Arab Emirates 1 0.67 93.80
## 141 United Kingdom 1 0.67 94.47
## 142 United States 1 0.67 95.14
## 143 Uruguay 1 0.67 95.81
## 144 Uzbekistan 1 0.67 96.48
## 145 Venezuela 1 0.67 97.15
## 146 Vietnam 1 0.67 97.82
## 147 Yemen 1 0.67 98.49
6
## 148 Zambia 1 0.67 99.16
## 149 Zimbabwe 1 0.67 100.00
36 (24.16%)
21 (14.09%)
20 (13.42%)
17 (11.41%)
17 (11.41%)
12 (8.05%)
9 (6.04%)
7 (4.7%)
6 (4.03%)
4 (2.68%)North America and ANZ
East Asia
South Asia
Southeast Asia
Commonwealth of Independent States
Central and Eastern Europe
Middle East and North Africa
Latin America and Caribbean
Western Europe
Sub−Saharan Africa
Frequency / (Percentage %)
R
eg
io
na
l.i
nd
ic
at
or
## Regional.indicator frequency percentage cumulative_perc
## 1 Sub-Saharan Africa 36 24.16 24.16
## 2 Western Europe 21 14.09 38.25
## 3 Latin America and Caribbean 20 13.42 51.67
## 4 Central and Eastern Europe 17 11.41 63.08
## 5 Middle East and North Africa 17 11.41 74.49
## 6 Commonwealth of Independent States 12 8.05 82.54
## 7 Southeast Asia 9 6.04 88.58
## 8 South Asia 7 4.70 93.28
## 9 East Asia 6 4.03 97.31
## 10 North America and ANZ 4 2.68 100.00
## [1] "Variables processed: ï..Country.name, Regional.indicator"
7
plot_num(data)
Explained.by..GenerosityExplained.by..Perceptions.of.corruptionDystopia...residual
Ladder.score.in.DystopiaExplained.by..Log.GDP.per.capitaExplained.by..Social.supportExplained.by..Healthy.life.expectancyExplained.by..Freedom.to.make.life.choices
Social.support Healthy.life.expectancyFreedom.to.make.life.choices Generosity Perceptions.of.corruption
Ladder.scoreStandard.error.of.ladder.scoreupperwhisker lowerwhisker Logged.GDP.per.capita
0.0 0.2 0.4 0.60.0 0.2 0.4 0.6 1 2 3
2.3502.3752.4002.4252.4500.0 0.5 1.0 1.5 0.0 0.4 0.8 1.2 0.000.250.500.75 0.0 0.2 0.4 0.6
0.6 0.8 1.0 50 60 70 0.4 0.6 0.8 1.0 −0.20.0 0.2 0.4 0.60.00 0.25 0.50 0.75 1.00
2 4 6 8 0.05 0.10 0.15 2 4 6 8 2 4 6 8 8 10 12
0
50
100
150
0
50
100
150
0
50
100
150
0
50
100
150
value
co
un
t
data_prof=profiling_num(data)
describe(data)
## data
##
## 20 Variables 149 Observations
## --------------------------------------------------------------------------------
## ï..Country.name
## n missing distinct
## 149 0 149
##
## lowest : Afghanistan Albania Algeria Argentina Armenia
## highest: Venezuela Vietnam Yemen Zambia Zimbabwe
## --------------------------------------------------------------------------------
## Regional.indicator
## n missing distinct
## 149 0 10
##
## lowest : Central and Eastern Europe Commonwealth of Independent States East Asia Latin America and Caribbean Middle East and North Africa
## highest: North America and ANZ South Asia Southeast Asia Sub-Saharan Africa Western Europe
## --------------------------------------------------------------------------------
## Ladder.score
8
## n missing distinct Info Mean Gmd .05 .10
## 149 0 147 1 5.533 1.225 3.637 4.223
## .25 .50 .75 .90 .95
## 4.852 5.534 6.255 7.072 7.305
##
## lowest : 2.523 3.145 3.415 3.467 3.512, highest: 7.464 7.554 7.571 7.620 7.842
## --------------------------------------------------------------------------------
## Standard.error.of.ladder.score
## n missing distinct Info Mean Gmd .05 .10
## 149 0 65 0.999 0.05875 0.02261 0.0344 0.0368
## .25 .50 .75 .90 .95
## 0.0430 0.0540 0.0700 0.0822 0.0958
##
## lowest : 0.026 0.027 0.029 0.032 0.033, highest: 0.106 0.107 0.120 0.156 0.173
## --------------------------------------------------------------------------------
## upperwhisker
## n missing distinct Info Mean Gmd .05 .10
## 149 0 146 1 5.648 1.202 3.824 4.362
## .25 .50 .75 .90 .95
## 4.991 5.625 6.344 7.167 7.380
##
## lowest : 2.596 3.259 3.548 3.611 3.748, highest: 7.518 7.643 7.670 7.687 7.904
## --------------------------------------------------------------------------------
## lowerwhisker
## n missing distinct Info Mean Gmd .05 .10
## 149 0 143 1 5.418 1.249 3.499 4.086
## .25 .50 .75 .90 .95
## 4.706 5.413 6.128 6.993 7.230
##
## lowest : 2.449 3.030 3.276 3.282 3.322, highest: 7.410 7.438 7.500 7.552 7.780
## --------------------------------------------------------------------------------
## Logged.GDP.per.capita
## n missing distinct Info Mean Gmd .05 .10
## 149 0 148 1 9.432 1.327 7.411 7.692
## .25 .50 .75 .90 .95
## 8.541 9.569 10.421 10.832 10.973
##
## lowest : 6.635 6.958 7.098 7.158 7.288, highest: 11.085 11.117 11.342 11.488 11.647
## --------------------------------------------------------------------------------
## Social.support
## n missing distinct Info Mean Gmd .05 .10
## 149 0 119 1 0.8147 0.1267 0.5826 0.6434
## .25 .50 .75 .90 .95
## 0.7500 0.8320 0.9050 0.9402 0.9476
##
## lowest : 0.463 0.489 0.490 0.537 0.540, highest: 0.947 0.948 0.952 0.954 0.983
## --------------------------------------------------------------------------------
## Healthy.life.expectancy
## n missing distinct Info Mean Gmd .05 .10
## 149 0 135 1 64.99 7.653 52.86 54.99
## .25 .50 .75 .90 .95
## 59.80 66.60 69.60 73.30 73.90
##
## lowest : 48.478 48.700 50.102 50.114 50.833, highest: 74.400 74.700 75.100 76.820 76.953
9
## --------------------------------------------------------------------------------
## Freedom.to.make.life.choices
## n missing distinct Info Mean Gmd .05 .10
## 149 0 126 1 0.7916 0.1268 0.5802 0.6292
## .25 .50 .75 .90 .95
## 0.7180 0.8040 0.8770 0.9254 0.9430
##
## lowest : 0.382 0.480 0.525 0.548 0.552, highest: 0.949 0.955 0.959 0.960 0.970
## --------------------------------------------------------------------------------
## Generosity
## n missing distinct Info Mean Gmd .05 .10
## 149 0 130 1 -0.01513 0.1645 -0.2146 -0.1820
## .25 .50 .75 .90 .95
## -0.1260 -0.0360 0.0790 0.1534 0.2666
##
## lowest : -0.288 -0.258 -0.246 -0.244 -0.238, highest: 0.311 0.422 0.424 0.509 0.542
## --------------------------------------------------------------------------------
## Perceptions.of.corruption
## n missing distinct Info Mean Gmd .05 .10
## 149 0 130 1 0.7274 0.1837 0.3104 0.4598
## .25 .50 .75 .90 .95
## 0.6670 0.7810 0.8450 0.8918 0.9162
##
## lowest : 0.082 0.167 0.179 0.186 0.237, highest: 0.924 0.931 0.932 0.938 0.939
## --------------------------------------------------------------------------------
## Ladder.score.in.Dystopia
## n missing distinct Info Mean Gmd
## 149 0 1 0 2.43 0
##
## Value 2.43
## Frequency 149
## Proportion 1
## --------------------------------------------------------------------------------
## Explained.by..Log.GDP.per.capita
## n missing distinct Info Mean Gmd .05 .10
## 149 0 138 1 0.9772 0.4635 0.2712 0.3694
## .25 .50 .75 .90 .95
## 0.6660 1.0250 1.3230 1.4660 1.5158
##
## lowest : 0.000 0.113 0.162 0.183 0.228, highest: 1.555 1.566 1.644 1.695 1.751
## --------------------------------------------------------------------------------
## Explained.by..Social.support
## n missing distinct Info Mean Gmd .05 .10
## 149 0 135 1 0.7933 0.2854 0.2698 0.4076
## .25 .50 .75 .90 .95
## 0.6470 0.8320 0.9960 1.0766 1.0926
##
## lowest : 0.000 0.058 0.062 0.168 0.173, highest: 1.094 1.103 1.106 1.108 1.172
## --------------------------------------------------------------------------------
## Explained.by..Healthy.life.expectancy
## n missing distinct Info Mean Gmd .05 .10
## 149 0 119 1 0.5202 0.2411 0.1376...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here