" If there is one from 0 Assigned to 10 Divided ladder, top level 10 Points represent the happiest life you can get, the bottom 0 Points represent the worst life you can get. Where do you think you are now? "
You may ask: What is the happiest life?
It may be the satisfaction of having wealth, it may be the joy of success, it may be the reward after giving it, it may be the pride of harvest, it may be the nobleness when indifferent. There never seems to be a fixed answer to a happy life.

But the "Global Happiness Index Report" issued by the United Nations tells us that happiness can actually be quantified. This report analyzes data based on different views of national happiness, comprehensively evaluates the happiness index, and ranks it accordingly. The main factors include GDP per capita ( GDP ), healthy life expectancy, standard of living, national happiness, freedom of life choices, degree of social integrity and generosity, etc., total 33 Sub-items.
Today, we are based on the Gallup Global Happiness Report ( https://worldhappiness.report/ed/2020) The public information on the website, combined with JMP software to see which countries rank higher in the global happiness report, and which factors have a greater impact on the happiness index.
01 Start with data import and sorting
First, retrieve the special page of the Gallup Global Happiness Report ( https://worldhappiness.report/ed/2020/) the original data, a little bit of collation will be the 2015-2020 Excel The file is saved to a folder.
Secondly, import all Excel files into JMP at once and integrate them into a data table. In addition to completely retaining the data rows in the original data table, JMP will also automatically generate file name rows for easy viewing of data sources.
(:backhand_index_pointing_right:JMP operation: file -> import multiple files)

Extract part of the required content of the specified row to quickly generate the year information row.
(:backhand_index_pointing_right:JMP operation: line -> recode)

After finishing the data, we can freely explore the data with JMP.
02 Visual exploratory analysis of data
JMP graphics generator is a good helper for comprehensive exploration of data, it allows you to clearly view the basic distribution, comparison, trend direction and other information of the data you are studying.
2020 Average happiness score of each region surveyed in the year
After simple drawing through the JMP graphics generator, we can see the distribution report in the figure below.
The report divides the global countries and regions into 10 large regions. Among them, sub-Saharan Africa has the most countries and regions, reaching 39, and it is also the region with the lowest average happiness. North America and Australia are the regions with the highest average happiness scores, but only 4 countries and regions.
(:backhand_index_pointing_right:JMP operation: drawing -> graphics generator -> side by side horizontal bar graph, floating horizontal bar graph)

2020 Top ranking 10 Of countries’ performance in previous years
It can be seen from the report that Finland has been ranked first for three consecutive years, Denmark has been ranked second for two consecutive years, and Switzerland has risen to third place this year after its ranking has declined for several consecutive years. Starting in 2016, Luxembourg has risen in rankings for several consecutive years, entering the top 10 for the first time.

(:backhand_index_pointing_right:JMP operation: drawing -> graphics generator -> line drawing)
2020 Global Happiness Index Map
A picture is worth a thousand words! The global happiness index map for 2020 shows that the Nordic countries have the highest happiness index, such as Finland, Denmark, Iceland, and Norway; Africa, especially Central and East Africa, has a lower happiness index, and Asia’s Afghanistan and India have lower happiness indexes. .
(:backhand_index_pointing_right:JMP operation: drawing -> graphics generator -> map function, and data filtering)

Which indicators are more related to happiness score? Is it just wealth GDP ?
It can be clearly seen from the multivariate graph generated by JMP below that the correlation with happiness scores is: GDP> healthy life expectancy> social assistance> free choice in life> social cleanliness> generosity, so we can understand it as wealth and Health is considered a very important indicator of happiness.
(:backhand_index_pointing_right:JMP operation: analysis -> multiple methods -> multiple)

The above are the results of some exploratory data analysis. Let's further try to establish a quantitative statistical model using the main parameters and happiness scores mentioned above.
03 Data predictive modeling
Linear model attempt
Using JMP's fitting model platform, the happiness score is used as a response, and the other 6 lines of information are used as factors to try to generate a linear model to view the predicted and true values of the model.

Judging from the generated scatter plot and R-squared (0.76), the fitting effect seems to be very good. According to the summary table of effects, the importance of the model variables are in order: GDP, free choice of life, social assistance, healthy life expectancy, degree of social integrity and generosity.
When you see this, you may have questions: When doing correlation analysis before, it was clear that "healthy life expectancy" and "social assistance" are more correlated with happiness scores than "freedom of life". Why did the result change in the prediction model? This is because the prediction model actually has the problem of collinearity of the underlying factors, which may affect the judgment of the importance of the factors and the prediction error.
In order to view the influence factors objectively and optimize the model, we try to use principal component analysis to further explore. The significance of principal component analysis here is to delete redundant original repeated variables and create as few new variables as possible, so that these new variables are not only pairwise unrelated, but also keep the original information as much as possible in reflecting the information.
Optimization of linear models
From the analysis results in the figure below, it can be confirmed that "GDP", "healthy life expectancy" and "social assistance" are indeed strongly correlated with happiness. The newly generated 4 principal component data rows can explain more than 90% of the information of the previous 6 factors , So as to reduce the dimensionality of data while reducing the impact of collinearity on the linear model.
The happiness score is used as a response again, and the newly generated 4 principal component data rows are used as factors to generate a linear model, and the happiness score is 7.8 for prediction.

As you can see from the figure below, the 95% confidence interval of the new model is [7.62454, 7.97546], which is smaller than the confidence interval of the original model's predicted value [7.61752, 7.9834]. Of course, because the response interval is [2.51-7.81], so It seems that the improvement effect is not obvious, but what if the response range is 1000 or 10,000?

Attempt of data exploration method
JMP provides a variety of data mining methods such as neural networks, decision trees, random forests, boosted trees, and support vector machines (some functions are only available in JMP Pro), and can easily compare models.
Taking the simplest single-layer 3-node neural network prediction model as an example, the predicted R-squared of the verification set can reach 0.77. A slight increase in the number of nodes to 10, combined with the promotion function, can increase the R-squared to 0.83, which means This model can make better predictions of happiness scores.

After JMP's visual analysis, data exploration, modeling and data exploration, our analysis report has been released.
So, how to quickly share analysis results? This is not a problem.
04 data share it
You can publish the visual graphic report to JMP Public/ JMP Live to easily realize public sharing of results or internal sharing of specific groups of people. Global Happiness Index Map Sharing Link:
https://public.jmp.com/packages/World-Happiness-Report/js-p/PGGdhKqZWQy6Btpf05Nn8