G4 Report
Revision as of 16:50, 25 April 2020 by Yang.xu.2019 (talk | contribs) (→Data Cleaning and Preparation)
CHINA HAPPINESS SURVEY
|
|
|
|
Contents
Project Motivation
Association Rule Mining is Powerful
Room for Improvement of Current Packages
R Packages Used
- For Interactive Application: R Shiny and Shiny Dashboard
Shiny is an R Studio package for developing interactive charts, data visualizations and applications to be hosted on the web using the R programming language. It enables developer to make an interactive application which allow user to understand a certain model or do some data explorations. In this case, we could visualize the underlying rules beyond given datasets which show a clear picture of how those items correlate with each other. Package ‘shiny’Package ‘shinydashboard’
- For Interactive Plot: ggplot2, plotly and gghighlight Package ‘plotly’ Package ‘ggplot2’ Package ‘gghighlight’
- For Choropleth Mapping: tmap, sf and leaflet Package ‘tmap’Package ‘leaflet’
- For HeatMap: heatmaply Package ‘heatmaply’
- For Likert Scale: likert Package ‘likert’
- For Correlation Matrix: corrplot Package ‘corrplot’
- For data preparation: sqldf(for SQL operations in R),dplyr,stringr Package ‘sqldf’ Package ‘dplyr’ Package ‘stringr’
Data Cleaning and Preparation
Datasets
- happiness_train_abbr: lite version of survey dataset
- happiness_train_complete: full version of survey dataset
- happiness_index: index and description of survey dataset
Index and Description - happiness_train_abbr
Data field | Original questionnaire number | Question | Remarks |
---|---|---|---|
id | - | ID | - |
province | s41 | Survey Location - Province/Autonomous Region/Municipality | 1 = Shanghai; 2 = Yunnan Province; 3 = Inner Mongolia Autonomous Region; 4 = Beijing; 5 = Jilin Province; 6 = Sichuan Province; 7 = Tianjin; 8 = Ningxia Hui Autonomous Region; 9 = Anhui Province; 10 = Shandong Province ; 11 = Shanxi Province; 12 = Guangdong Province; 13 = Guangxi Zhuang Autonomous Region; 14 = Xinjiang Uygur Autonomous Region; 15 = Jiangsu Province; 16 = Jiangxi Province; 17 = Hebei Province; 18 = Henan Province; 19 = Zhejiang Province; 20 = Hainan Province; 21 = Hubei Province; 22 = Hunan Province; 23 = Gansu Province; 24 = Fujian Province; 25 = Tibet Autonomous Region; 26 = Guizhou Province; 27 = Liaoning Province; 28 = Chongqing City; 29 = Shaanxi Province; 30 = Qinghai Province; 31 = Heilongjiang Province; |
gender | a2 | Gender | 1 = Male; 2 = Female |
birth | a301 | Birthday | - |
health | a15 | Do you feel your current physical health | 1 = Unhealthy; 2 = Less healthy; 3 = Fair; 4 = healthy; 5 = Very Healthy; |
depression | a17 | How often you feel depressed or depressed in the past four weeks | 1 = Always; 2 = Often; 3 = Sometimes; 4 = Rarely; 5 = Never; |
relax | a312 | In the past year, do you often do the following in your free time-relax | 1 = Never; 2 = Rarely; 3 = Sometimes; 4 = Often; 5 = Always; |
learn | a313 | In the past year, do you often do the following in your free time-study | 1 = Never; 2 = Rarely; 3 = Sometimes; 4 = Often; 5 = Always; |
equity | a35 | Generally speaking, do you think society is unfair today? | 1 = Completely unfair; 2 = More unfair; 3 = Not fair but not unfair; 4 = More fair; 5 = Completely fair; |
happiness | a36 | Overall, do you think your life is happy | 1 = Very unhappy; 2 = Relatively unhappy; 3 = Not happy or unhappy; 4 = Relatively happy; 5 = Very happy; |
class | a431 | At what level do you think you are currently | 1 = 1(bottom); 10 = 10(top); |
status_peer | b1 | What is your socioeconomic status compared to your peers | 1 = Higher; 2 = Almost; 3 = Lower; |
inc_ability | b5 | Considering your ability and working conditions, is your current income reasonable? | 1 = Very reasonable; 2 = Reasonable; 3 = Unreasonable; 4 = Very unreasonable; |
Choice of Visualizations and Critics
Application Design in Details
Use Cases
1.Bashboard
2.Exploratory Data Analysis
3.Multivariate Matrix Analysis
4.Likert & Bubble Plot
5.Choropleth Mapping
6.Cluster Analysis
References
- World Happiness Report 2020
- Shiny Application layout guide,JJ Allaire
- Event handler R Shiny
- Build your first web app dashboard using Shiny and R
- Enterprise-ready dashboards
- ggplot2 Reference and Examples (Part 2) - Colours
- Hands-On Exercise 8: Diverging Stacked Bar Chart, Dr. Kam Tin Seong
- Hands-on Exercise 8: Heatmap Visualisation with R, Dr. Kam Tin Seong
- Hands-On Exercise 8: Visualising Correlation Matrix, Dr. Kam Tin Seong
- Hands-on Exercise 10: Choropleth Mapping with R, Dr. Kam Tin Seong
- Hands-on Exercise 10: Mapping Geospatial Point Data with R, Dr. Kam Tin Seong