This is my assignment report to discuss DataViz makeover critiques, design, implementation and insights for Covid-19 vaccination sentiment.
Data Visualisation (Tableau Online): To vaccine or not vaccine: what is public view?
Data Source: Imperial College London YouGov Covid 19 Behaviour Tracker Data Hub
The original data visualization intended to answer two questions, firstly, respondants from which country shows higher willingness for vaccination, and secondly, percentage of respondants agreed for vaccination. Below discussed clarity and aesthetics of the original DataViz.
Figure 1: Critic original DataVi
| SN | Critiques | Suggestions |
|---|---|---|
| 1 | Author’s intention for left side chart is to answer question, which country has higher willingness level for vaccination. Bar chart is used for Likert data with 5 categories. It makes audiance difficult to interpret public view is towards agreement or disagreement. | A normal bar chart can be used when there is two categories. For multi-category Liker data, diverging stacked bar chart is proposed. |
| 2 | Right side chart is better designed to answer the question posed by author. | We can follow the idea to present single view category. Proportion is with uncertainty, it varies with proportion and sample size. Hence, confidence interval is added and represent the graph with dot. Besides, to further enhance the chart with interactivity, all willingness level can be presented by selection and also included 4 common confidence level for confidence interval. |
| 3 | Left side chart is ordered aphabetically, reader need to eye ball to find out the trends. Right chart does well by soring and a good practice, which 1st chart is not in terms of sorting. | To improve from here, interactive features are proposed to allow readers to select which willingness level be used for sorting. |
| SN | Critiques | Suggestions |
|---|---|---|
| 4 | 5 completely different colors are used for bar chart. It is too colorful, and not helpful on grouping views on same or opposite side. | Will use same color group for similar Likrt categories, e.g. dark and light blue for Strongly agree and Agree. |
| 5 | Position of legend is located at the upper left color and leave a lot of white space. | Use colored word as legend and position near the plot to avoid whitespace. |
| 6 | Legend title and content is not well elaborated, readers might think what is Vac 1 and the 5 confusing categories. | Legend title will be avoided by using colored words. 5 categories will be elaborated with text. |
Figure 2: Sketch of proposed design
First, inspect data in excel, raw data consists of 31 csv files for survey results. Checking a few data, I found out that some file does not have Vac_1 column, some file with this column but with empty value as well. Then I used Python for a simple data consolidation and filtering. Firstly, import relevant Python packages, change working directory to csv file location and consolidate all 31 files.
Figure 3: Data cleanning with Python 1
Then, investigate distinct value and counts for column vac_1, followed by selecting non-empty vac_1 entries and kept relevant columns for this DataViz study.
Figure 4: Data cleanning with Python 2
Next, save consolidated dataframe to csv file and proceed with Tableau.
Figure 5: Data cleanning with Python 3
Star off with Tableau, and drag over saved csv file to Connect to data page. Then, I go through all columns and codebook to identify areas to change.
Firstly, I notice that countries do not start with capital letter. This is updated with Aliases function, by right clicking the upper left color triangle and choose Aliases. Then edit country name words to start with capital letter and repalce “-” with space.
Figure 6: Update Country column with alias 1
Figure 7: Update Country column with alias 2
Next is to change measures such as vac_1 to the question, by double clicking column names. Similarly I edit alias for vac_1 values to “Strongly agree”, “Agree”, “Neutral”, “Disagree” and “Strongly disagree”. Similary, I updated other fields started with vac.
(#fig:vac1_colname)Rename vac1 as question content
Next, I find that “Household Children” and “Household Size” are all digits, but they have different meaning, some might be number of children/people in the household, some digit represent the question is not answered. This two columns are auto-identified as “Measure Values”, so I drag them over to “Measure Names” on a new sheet side bar.
Figure 8: Move data fields from Measure Values to Measure Names 1
Figure 9: Move data fields from Measure Values to Measure Names 2
Then I updated aliases for “Household Size”. However, when I attempt to edit for “Household Children” as below, Tableau generates an Error Code, which specified output data type.
Figure 10: Attempt to edit Aliases for Household Children
Figure 11: Error code for the attempt
Hence, a calculated field is used for recode “Household Children” by right click “Household Children” column name and choose “Create a Calculated Field..”. Besides, to simplify number of categories, values not specified in Codebook, e.g. 7, 8 and null are grouped as “Others”
Figure 12: Create a calculated field to recode Household Children
Figure 13: Create a calculated field for
Below is overview of main tab. There are 10 elements in total, I group them into 3 categories. a. Element 1: an “Image” object b. Element 2, 3, 5, 7, 9 and 10: “Text” object c. Element 4, 6, 8: “Sheet”
Figure 14: Main page overview
To create an “Image” object, I created a Dashboard to begin with by clicking the tab with grid and + sign.
Figure 15: Create a dashboard
Then, I choose Dashobard size as “Generic Desktop (1366 x 768)” clicking the small triangles under “Size” pane.
Figure 16: Choose dashboard size
Then, I select “Image” icon under “Objects” pane, drag and drop to dashboard. An “Edit Image Object” window will pop up, then I choose an image from my local drive by clicking “Choose”. Options to “Fit Image” and “Center Image” are also checked.
Figure 17: Adding an Image object to Dashboard 1
Figure 18: Adding an Image object to Dashboard 2
Similar to “Image” object, “Text” object can be found under “Objects” pane. After dragging and dropping, a text box window will top up. Then we can add texts with formatting color, font, size, bold etc.
Note for element 10, the hyperlink is generated from excel and pasted to Tableau.
Though we see there is no much difference on element 1 and element 4. However, as mentioned in Section 2, I would like to add interactivity on element 4 for navigation. A straightforward image object does not allow “Actions”. Hence, a sheet is needed.
To start with, I create a calculated field to host the icon, named as “IconOverview” and valued at 0.
Then, I create a new sheet, under “Marks” pane, choose “Shape” as mark by clicking the small triangle to expand the drop-down list.
Figure 19: Create an image icon for interactivity
Similar to adding objects, sheets are added by dragging and dropping as well. All visible sheets can be found on “Sheets” pane, choose sheet of interest and move to desired position.
Figure 20: Add Sheet to a dashboard
Last but not least, we hover around and align the 10 elements. Also note that the navigation function is not enabled yet, as we need to create all four dashboards before adding actions.
Below is overview of Overview tab. We can see there are 11 elements, similarly we group them as below.
a. Element 1: an “Image” object b. Element 2, 3, 7, 8, 11: “Text” object c. Element 4, 5, 6; “sheet” for navigation d. Element 9: a donut chart e. Element 10: circle chart with confidence interval plus 2 filters
Point a, b, d we have discussed in Section 3.2, I will focus on point c, d and.
Figure 21: Main page overview
To begin with, I created a calculated field, named as “Number of records” and valued at “1” to represent number of respondants.
For donut char itself, another calculated field is created, with name as “Zero” and formula as 0.
Then move “Zero” to left side bar twice, and right click bottom Zero label and select “Dual Axis”.
Figure 22: Creating a donut chart 1
Then for first “SUM(Zero)”, change chart type as Pie, by right clicking small triangle under Marks pane for “SUM(Zero)”.
Figure 23: Creating a donut chart 2
After that, assessment item is selected for “Color”, “Number of records” is selected for “Size”. We
Figure 24: Creating a donut chart 3
For the second “SUM(Zero)”, change chart type as Circle, and color same as background color, “white” in our case by editing “Color”, and also make the center white circle smaller with “Size” under Marks pane.
Figure 25: Creating a donut chart 4
Next, still at Marks pane for “SUM(Zero)(2)”, we drag over “Number of records” to be calculated by “SUM” and “Country” to be measured by “COUNT DISTINCT” to “Label” to display number of respondents and number of country participated in this survey. By clicking “Label” button, we alter text and also aligned text to shown in the center of circle.
Figure 26: Creating a donut chart 5
Similarly, I checked “Show Labels” for pie chart to display the willingness distribution by views.
Then, dual y-axis is removed by right clicking y-axis and unchecking “Show Header”.
Figure 27: Creating a donut chart 6
Then I added tooltip for the chart by choosing “Tooltip” under Marks pane, so when read hover around can have a quick understanding on what the segment is about.
Figure 28: Creating a donut chart 7
Tooltip: > I <If a Covid-19 vaccine were made available to me this week, I would definitely get it:> to get a Covid-19 vaccine if available to me this week.
% of respondants by views: <% of Total SUM(Number of records)> Number of respondents: <SUM(Number of records)> Number of participating countries: <CNTD(Country)>
Now we discuss about how to create a circle chart with confidence interval for proportion. The chart also allows user to select which willingness level they want to visualize and confidence level for the confidence interval.
Firstly, create a parameter, “confidence level for CI” by right clicking a white space under “Parameters” pane.
Figure 29: Creating a parameter for confidence level 1
Key in name, data type, current value, etc. as below.
Figure 30: Creating a parameter for confidence level 2
Second, list down all calculated fields, related to making such a chart.
qnorm: IF [confidence level for CI]=0.99 THEN 2.3263 ELSEIF [confidence level for CI]=0.98 THEN 2.0537 ELSEIF [confidence level for CI] = 0.95 THEN 1.6449 elseif [confidence level for CI]= 0.9 THEN 1.2816 END
Total Response: {FIXED [Country]: COUNT([Index])}
prop: COUNT([Consolidated_vac_1.csv])/sum([Total Response])
Prop_SE: SQRT({INCLUDE [If a Covid-19 vaccine were made available to me this week, I would definitely get it:]:[prop]*(1-[prop])}/ [Total Response])
Prop_margin of error: [qnorm]*[Prop_SE]
Prop_Lower Limit: {INCLUDE [If a Covid-19 vaccine were made available to me this week, I would definitely get it:]:[prop]}-[Prop_margin of error]
Prop_Upper Limit: {INCLUDE [If a Covid-19 vaccine were made available to me this week, I would definitely get it:]:[prop]}+[Prop_margin of error]
Next, move ‘prop’ to “Columns” and “Country” to “Rows”, willingness question to “Details” under “Marks” pane and choose data type as “Circle”.
Then also move willingness item to “Filters”, as we want to visualize the chart based on single views. A Filter window pops up, make select to “Select from list” and with “All” values.
Figure 31: Adding filter
Then, on the “Filters” pane, right click the measure, and choose “Show Filter”. The Filter will appear on the right of chart.
Figure 32: Edit filter values
Click the small triangle on the upper right corner of filter card, to “Edit Title” as “Views” as the original column name is very long. Also, change the display from “Multiple Values (list)” to “Single Value (dropdown)” and make “Strongly agree” as default setting.
Figure 33: Edit filter title and display
After this step, we can see the circle chart is sorted aphabetically. To help visualize which country has highest portion on a certain view, I chenged sorting style, by right click “Country” on “Columns” and select “Sorting”. In the pop up window, choose Sort By “Field” on Sort Order “Descending” with Field Name “prop”.
Figure 34: Sorting by field values 1
Figure 35: Sorting by field values 2
Assessment item is also added for Color, so color legend is aligned when with donut chart when different “View” selection is made.
Next step is to add the confidence interval to the chart. We select “Prop_Lower Limit” and press “Ctrl” key on keyboard then select “Prop_Upper Limit”, drag and drop both measure to chart area.
Figure 36: Adding lower limit and upper limit to chart 1
Figure 37: Adding lower limit and upper limit to chart 2
Then a “Measure Values” containing value for “Prop_Lower Limit” and “Prop_Upper Limit” is created and added to “Rows”, move it to “Columns”, and a “Measure Values” containing “Prop_Lower Limit” and “Prop_Upper Limit” is added to “AGG(prop)” for size. Move “Measure Names” to “Columns” and change shape for “Measure Values” to “line”, move “Measure Names” in “Columns” as “Path” for “Measure Values”.
Figure 38: Customize confidence interval elements in a chart 1
Figure 39: Customize confidence interval elements in a chart 2
Then charts is displayed with circle chart on the left, and a horizontal line chart on the right. Right click x-axis of the right hand side chart, click “Dual Axis”, “Synchronize axis” and “Hide title”.
Next, show “confidence level” parameter to allow users’ selection. Besides,since only one view be choosen at a time, color legend is not necessary and the card is removed by clicking the small triangle at the upper right corner and choose “Hide Card”.
Figure 40: Remove color legend card
Last step for this chart is to edit tooltip and chart title as below. “SUM(Number of records)” is added as Tooltip element for “AGG(prop)” so number of respondents by county and view can be included. Besides, since assessment item started with capital letter, a “Assessment text” calculated field is created to change the word to start with small letter.
Tooltip:
<AGG(prop)> of respondants in
<If a Covid-19 vaccine were made available to me this week, I would definitely get it:> that they would like to take vaccination. :
Chart Title:
% of respondants <ATTR(Assessment text)> to vaccination (<Parameters.confidence level for CI> confidence interval)
Follow the step and concept discussed in section 3.2.1 and 3.2.4 to create a dashboard. Here, I would like to demonstrate how to add “Actions” so to interact within a dashboard.
Choose “Dashboard” from top toolbar, select “Actions”.
Figure 41: Adding action for interaction within in dashboard 1
Then “Add Action” in the pop up window and choose “Filter”.
Figure 42: Adding action for interaction within in dashboard 2
Then edit filter action as below to allow selection so that when we selecting one segment in the donut chart, the confidence interval chart can be auto updated with selected view category. Deselecting will keep the filtered values, so that we will never see all view categories appeared tegother.
Figure 43: Adding action for interaction within in dashboard 3
Below is overview of Demographics tab. We can see there are 12 elements, grouped as below.
a. Element 1: an “Image” object b. Element 2, 8, 12: “Text” object c. Element 3, 7: “Blank” object d. Element 4, 5, 6; “sheet” for navigation e. Element 9: sort selection function f. Element 10, 11: diverging stacked bar with a selector
Point a, b, c and d we have discussed in earlier sections, I will describe steps in details for point e and f.
Figure 44: Main page overview
First, adding parameter, “Select breakdown 1” for breakdown selector.
Attributes to create this parameter is as below.
Figure 45: Adding parameter to select demographics factor
Second, create below calculated fields relevant for breakdown selection and diverging stacked bar.
[Select breakdown 1]:
CASE [Select breakdown 1] WHEN “Country” THEN [Country1] WHEN “Gender” THEN [Gender] WHEN “Age Group” THEN [Age Group] WHEN “Employment Status” THEN [Employment Status] WHEN “Household Children” THEN [Household Children_recode] WHEN “Household Size” THEN STR([Household Size]) END
Total Count:
total(sum([Number of records]))
Count Negative:
IF [If a Covid-19 vaccine were made available to me this week, I would definitely get it:]= ‘5 – Strongly disagree’ THEN 1 ELSEIF [If a Covid-19 vaccine were made available to me this week, I would definitely get it:] = ‘4’ THEN 1 ELSEIF [If a Covid-19 vaccine were made available to me this week, I would definitely get it:] = ‘3’ THEN 0.5 ELSE 0 END
Total Response:
{FIXED [Country]: COUNT([Index])}
Total Count Negative:
TOTAL(sum([Count Negative]))
sum([Number of records])/[Total Count]
Gantt Start: -[Total Count Negative]/[Total Count]
Gantt Percent: PREVIOUS_VALUE([Gantt Start])+zn(LOOKUP([Percentage],-1))
Then move “Gantt Percent” to “Columns”, “Selector 1” to “Rows”, assessment item for coloring, and “Percentage” as size. Change “Marks” type to “Gantt Bar”.
Change ‘Gantt Percent’ aggregation to be by assessment item. It is achieved by right click “Gantt Percent” on “Columns” and choose “Compute Using” the assessment item.
Figure 46: Create diverging stacked bar
Next, we add 0 as reference line for better clearity. Go to “Analytics” panel, choose “Reference Line” under “Custom”, drop it in the chart area, and select Add a Reference Line “For Table”. Then change the value to be a constant at 0. We can also edit the line texture and color, so it is a supplementary portion to the chart.
Figure 47: Add reference line for diverging stacked bar 1
Figure 48: Add reference line for diverging stacked bar 2
First, adding parameter, “Sort” for breakdown selector.
Attributes to create this parameter is as below.
Figure 49: Adding parameter to select which view to sort by
Second, create below calculated fields relevant for breakdown selection and diverging stacked bar.
Then change sorting method for “Selector 1” to be sort by “Nested” “Descending” with field “Sort”.
Next, we edit Tooltip and chart title for diverging stacked bar chart as below.
Tooltip: > Breakdown Selection 1: <Parameters.Select breakdown 1> - <Selector 1> Vaccinaiton acceptance:: <If a Covid-19 vaccine were made available to me this week, I would definitely get it:> Percentage :: <AGG(Percentage)>
Title: > Vaccination willingness level by <Parameters.Select breakdown 1>
Then duplicate this sheet and selector elements (i.e. parameter “Select breakdown 1” and calculated field “Select breakdown 1”), update the sheet with “Select breakdown 2” so we can visualize two facotr at the same time.
Follow the step and concept discussed in section 3.2.1 and 3.2.4 to create a dashboard. Remove redundant elements for visulization such as legend card as it is already coded in text object.
Then add a filter action with attributes below to allow selection so that when we selecting one sub-category from one diverging stacked bar, the other chart will be updated.
Figure 50: Adding action to filter between two diverging stacked bar
Below is overview of Association tab. We can see there are 12 elements, grouped as below.
a. Element 1: an “Image” object b. Element 2, 11: “Text” object c. Element 3, 7: “Blank” object d. Element 4, 5, 6; “sheet” for navigation e. Element 8: selection filter f. Element 9+10: Highlight table
Point a, b, c, d, e we have discussed in earlier sections, I will touch on point f below.
Figure 51: Association analysis page overview
First, we create a parameter, “Select a question” and also “Show Parameter” to allow audience to select another variable to compare with willingness level.
Attributes to create this parameter is as below. Values are other survey questions.
Figure 52: Adding parameter to select another question
Second, create below calculated fields relevant for breakdown selection and diverging stacked bar.
Next, choose assessment item as “Columns”, “Selector” as “Rows”, “Number of records” for “Text”, change chart type to “Highlight table” using “Show Me”
Figure 53: Select chart type from Show Me
Since we used orange color as main color throughout this dashboard design, we change color scale to be based off orange. Besides, we also edit Tooltip and title. Intention here is to show user which factor being compared with willingness level. Original question is two long in be included. We create a calculated field to summary what shorten the question to be a simple factor term.
Selector_text: > CASE [Select a question] WHEN “I am worried about getting COVID19” THEN “Worry level” WHEN “I am worried about potential side effects of a COVID19 vaccine” THEN “Side effect” WHEN “I believe government health authorities in my country will provide me with an effective COVID19 vaccine” THEN “Trust on government” WHEN “If I do not get a COVID19 vaccine when it is available, I will regret it” THEN “Regretness” WHEN “If a Covid-19 vaccine becomes available to me a year from now, I definitely intend to get it” THEN “Time effect” END
Tooltip: >
Title: > Selector_text> vs Willingness
Now we have completed all four dashboards. As mentioned earlier, we want to add “Actions” to the 4 icons so we can navigate by icon buttons.
Similar as filter action, a navigation action can be added by clicking “Action” under “Dashboard” on toolbar. In the pop up window, choose “Go to sheet” instead of “Filters”. Then, create action with below entry.
Figure 54: Add action for navigation 1
Figure 55: Add action for navigation 2
This allows when “Select” “OverviewIcon” (the sheet name to represent the icon) will navigate user to target sheet “Overview”.
Do it similarly for the rest of icons in dashboards.
Navigate to “Overview” dashboard, when select view as “Strongly agree”, we can see that United Kindom has most respondents strongly agreed to vaccination. Followed by Israel and Denmark.
Figure 56: United Kindom has most respondents strongly agreed to vaccination
In terms of strongly disagree, we can see that public in France has highest percentage against vaccination, leading by ~15% compared to that with second runner up, Germany.
Figure 57: Public in France strongly against vaccination the most
Navigate to “Demographics” dashboard, when we choose to breakdown by country and sort by “Neutral”, we can see that top 3 countries show neutral to vaccination are all Asian countries, namely South Korea, Singapore, Japan.We can also see the 3 countries has a very small bar on strong views, being it Strongly agree or Strongly disagree. This might be due to cultural difference.
Figure 58: APublic in Asian countries shows most proportion with a neutral stand
Stay on “Demographics” dashboard, when we breakdown by country and gender for two charts. On the left chart for breakdown by gender, can notice that male respondents are more willing to vaccination. Same trend can be seen, When we select different countries on the left. That is to say the trend, male respondents are more willing to vaccination compared to female, is observed at overview level as well as individual country level.
Figure 59: Male is more pro-vaccine
Figure 60: Male is more pro-vaccine holds through different countries, example on Denmark
Stay on “Demographics” dashboard, when we breakdown by country and age group for two charts. It is observed that elderly are more willing to vaccination.
Figure 61: Elderly are more towards vaccinations
Navigate to “Association analytics” dashboard, we can see that if public has a strong trust on government to bring them effective vaccine, tend to has more people agree to vaccination, so call positively related.
Figure 62: Trust on government is positively related to willningness level
Side effect matters, i.e. people worry about side effect of vaccine tend to against taking it. Worry level shows similar reverse co-occurrence pattern.
Figure 63: Side effect matters
Time helps, i.e. willingness level improved comparing vaccine now with one year later.
Figure 64: Time helps improve willingness