04 December 2017 |
Case Study: Analyzing Survey Data
This is the second in a series of posts designed as a DIY training course for using Displayr. In this post, I illustrate the basics of creating a report in Displayr’s edit mode from a raw survey data file. Along the way, I demonstrate the creation of a data set, filters, tables, and, charts. I use a simple survey on supermarket shopping. You can see the completed dashboard here (in view mode). You can view a video of the dashboard being created here.
Step 1: Create the document
- Create a new Displayr document called Shopping Survey.
- We are going to import a background image created by a graphic artist.
- Resize the image to fit your page correctly (using the handles on the side and/or the corner of the image).
- In the Object Inspector, which is on the ride side of the screen, set Properties > GENERAL > Label to Title Page
- Next, insert a text box into the middle of the page (Insert > Text Box the Ribbon), and write Supermarket profiles in it. Then change the formatting of the font (Appearance > Font section of the Ribbon) to bold, White, 28 point, Arial.
- Create a second textbox saying Market research summarizing demographic profiles of supermarkets and likelihood to recommend by department, in light grey, 16 point Arial.
Your screen should look like the one shown below:
Step 2: Importing the raw data
Most data analysis uses raw data, which in the case of a survey means you have a data file that contains one row of data for each person that completed the survey.
- Download the raw data file located here. This file is in the SPSS file format, which is the most widely used of the good file formats for survey data.
- Add the dataset to Displayr. From the Ribbon, Insert > Data Set (Data) and choose My Computer and select the data file that you just downloaded. You will see the dataset appear in the Data Tree, on the bottom-left of your screen.
Step 3: Creating a page of results
Our goal here is to create a page that looks like the one below.
Create the age table
- First, create a new page. From the Ribbon, Insert > New Page > Blank.
- Tables are created by dragging onto the page, as illustrated in the animation below. Please drag Age from the Data Tree and place it on the bottom-right of the page (where the table is on the image above).
- Change the style of the table using Appearance > Table Styles (in the Ribbon).
- It is currently showing arrows and coloring indicating statistical significance. This is not so interesting in this case, so turn it off: In the Ribbon, Appearance > Highlight Results > No.
Create the gender pie chart
- Drag Gender from the Data Tree and release it above the age table.
- This will make a table of Gender. With this table selected, click on Home > Chart > Pie in the Ribbon.
- Resize the pie chart as needed.
- Then customize the pie chart in Object Inspector (on the right-hand side):
- Under Chart > FONT and set the the font to 12 point, Arial, and bold.
- Change the LEGEND > Legend: Individual
- Back on the chart, click on the orange slice (for Females twice), and set the Color to Red (under Chart > PIE SLICES)
- Repeat this process for males, setting the color to blue.
Create the average performance bar chart
When reading in all the data, Displayr recognized that a whole lot of variables had the same structure, and has grouped them together automatically. We will thus be able to analyze them together (we could split them apart if we desired to do so).
- Drag Likelihood to recommend from the Data Tree to the left-side of the page (if you have a small screen, you may need to scroll down to find it). When you drag this across it is going to take up the whole screen. We need to restructure the data to make it take up less room.
- This data comes from a question where people were asked to rate how likely they would be to recommend each of the departments in a supermarket to their friends. People gave ratings of 0 through 10. A more succinct way of summarizing this data is as averages. We can convert the data to averages by;
- The table will now show averages. For example, the average value for Fruit & veg is 8.9.
- Whenever computing an average from raw data it is important to check that the underlying data has the correct coding. To do this:
- When we do this we can see that we do indeed have two problems that need to be addressed:
- You will see that Not applicable selections have a Value of 1 associated with them. That is, whenever the average is computed, if the question was not applicable, a 1 will go into the average, which is clearly not correct. Fix this by changing the Missing Values selection for Not applicable from Include in analyses to Exclude from analyses.
- The second problem is that whenever a person selected 0 – Not at all likely, they have a Value of 2, a selection of 1 has been stored as a 3, and so on. There are many ways to fix this, but the simplest way, which we will use here, is to type over the numbers in the Value column, entering values of 0 through 10 and pressing OK. When you do this, you will see that the average for Fruit & veg has dropped to 7.0.
- The table has automatically computed a SUM value at the bottom. This is not so meaningful for this data. It can be removed by clicking on it (first click on the table, then click on SUM) and choosing from the Ribbon, Data Manipulation > Delete (Rows/Columns).
- Making sure you still have the table selected, press Home > Chart > Bar chart.
Making it pretty
- We can insert a background and send to the back all from the Ribbon:
- Insert > Image (Text and Images) and insert this slide background image.
- Send it to the back, by selecting Appearance > Send to Back (Arrange).
- Resize the background so it fits the page neatly (zooming in or out using the slider under Home > Zoom – which is also in the Ribbon).
- Tip: Once finished you can use the “Fit to page” neatly button under Home > Zoom.
- Rearrange the objects on the page until it looks neat.
Step 4: Copy and modify the page
We are now going to copy the new page three times, and then modify each of these copies. This idea of copying and modifying is central to using Displayr efficiently.
- Click on the page called New page (in the Pages Tree on the left) so that it is highlighted.
- In the Ribbon, select Home > Copy. And then Home > Paste.
- After a small Please wait a new page will appear. Press Home > Paste again.
- Once the Please wait has disappeared, do this a third time.
- You should now have four pages called New page
- Download the following four logos to your computer: Aldi, Coles, Costco, and Woolworths.
- On the first of these pages, rename the page: Object Inspector > Properties > GENERAL > Label: Aldi
- In the Ribbon, Insert > Image (Text and Images) and select the Aldi logo.
- You will need to resize this, and using zoom (Home > Zoom) is a good idea to get perspective on the page. Place the logo on the top-left of the screen.
- Add logos and rename the other three pages respectively as Coles, Costco, and Woolworths.
Step 5: Creating and applying filters
The analysis we have conducted so far is based on the total data set of 500 people. We can make the report more useful by filtering the data by brand and by making available additional filters for users of the report.
- Hold down the Ctrl key on your keyboard, and using your mouse click on the following 4 variables in the Data Tree: Gender, Age, Household structure, and Thinking about the last time you went….
- Click on the Insert tab in the Ribbon and select, on the far right, Utilities > Insert > Utilities > Filtering > Create filters from Selected Data and press OK.
- You will see that some new variable sets have been added to the Data Tree. These variable sets contain variables that can be used to filter the data.
- We’re going to filter the entire page by the relevant supermarket. For the first one, select the Aldi page in the Pages Tree, and then Aldi from the filter drop-down menu under Home > Filter (Data Selection)
- Filter the Coles, Costco, and Woolworths pages in the same way.
Step 6: Exporting as a Web Page
Finally, we export by clicking in the Ribbon: Export > Web Page > Snapshot and View > A link that can be used by anyone > Open in new tab. (Click here and follow the links for a bit more information about this step.)
We are then taken to the view mode (we were just in edit mode). What you should see is as per this link. Now we have a report, with tabs on the left side of the screen in the navigation bar. These can be customized as well, see Customizing Logos, Icons, CSS, HTML Headers, and Language in Displayr.
You can apply filters in view mode. To do so, select any page with data, click the Filters link at the top of the screen, and select your filter. For example, to filter the data to just show people aged under 40 select all the age groups less than 40. Be sure to press OK at the bottom of the filter drop-down menu.
When we previously applied filters to the pages (in Step 5), the filters were remembered by the page. However, in View Mode, the filters are not remembered. Further, if one user filters, this will not cause filtering on the pages of other viewers.
We can export this off to PowerPoint by clicking Export at the top.
Try it yourself
Click here to sign into Displayr and edit the document that I created when writing this post.
To learn a bit more about Displayr, please read Case Study: Automatically Updating Interactive Time Series Dashboard.
Author: Tim Bock
Tim Bock is the founder of Displayr. Tim is a data scientist, who has consulted, published academic papers, and won awards, for problems/techniques as diverse as neural networks, mixture models, data fusion, market segmentation, IPO pricing, small sample research, and data visualization. He has conducted data science projects for numerous companies, including Pfizer, Coca Cola, ACNielsen, KFC, Weight Watchers, Unilever, and Nestle. He is also the founder of Q www.qresearchsoftware.com, a data science product designed for survey research, which is used by all the world’s seven largest market research consultancies. He studied econometrics, maths, and marketing, and has a University Medal and PhD from the University of New South Wales (Australia’s leading research university), where he was an adjunct member of staff for 15 years.