Presentation is loading. Please wait.

Presentation is loading. Please wait.

Organizing and Visualizing Variables

Similar presentations


Presentation on theme: "Organizing and Visualizing Variables"— Presentation transcript:

1 Organizing and Visualizing Variables
MATH2114 Week 7, Thursday Organizing and Visualizing Variables Slides Adopted & modified from “Business Statistics: A First Course” 7th Ed, by Levine, Szabat and Stephan, 2016 Pearson Education Inc.

2 Some feedback from Tuesday’s class
Do I have to buy the textbook? We’re teaching from it, and the exam is open book Not strictly required for any assessment What does the assessment for this class look like? Weblearn tests 5 Tutorials (First week is not assessed, leaving 4 assessed) Exam Little class participation :(

3 Objective/Goals Methods to organize variables.
Methods to visualize variables. Methods to organize or visualize more than one variable at the same time. Principles of proper visualizations How not to mess it up too badly

4 Unambiguous, can be difficult to communicate and understand
Tables Unambiguous, can be difficult to communicate and understand

5 Categorical Data DCOVA Categorical Data Summary Table
One Categorical Variable Two Categorical Variables Contingency Table Tallying/Counting Data

6 Summary Table (1 variable)
DCOVA Summary Table (1 variable) Tallies frequencies or percentages of items in different categories Main Reason Young Adults Shop Online Reason For Shopping Online? Percent Better Prices 37% Avoiding holiday crowds or hassles 29% Convenience 18% Better selection 13% Ships directly 3% Source: Data extracted and adapted from “Main Reason Young Adults Shop Online?” USA Today, December 5, 2012, p. 1A.

7 Contingency Tables (2 or more variables)
DCOVA Contingency Tables (2 or more variables) Cross tabulates or tallies jointly the responses of the categorical variables Used to study patterns that may exist between the responses of two or more categorical variables For two variables the tallies for one variable are located in the rows and the tallies for the second variable are located in the columns

8 Raw frequencies DCOVA Filming Promotion Public Event Wedding Total
Record of all permits issued by City of Melbourne for public events, film/photo shoots, weddings and promotions/sampling. Filming Promotion Public Event Wedding Total Summer 120 85 255 286 746 Autumn 134 119 266 242 761 Winter 133 55 106 15 309 Spring 112 110 272 207 701 499 369 899 750 2517 Data sourced from City of Melbourne Open Data: Accessed 6/9/2017, last updated August 22, 2017

9 Percentages DCOVA Row % Total % Column %
Filming Promotion Public Event Wedding Total Summer 16.10% 11.40% 34.20% 38.30% 100% Autumn 17.60% 15.60% 35% 31.80% Winter 43% 17.80% 34.30% 4.90% Spring 16% 15.70% 38.80% 29.50% Permits issued in winter tended to be for filming Total % Filming Promotion Public Event Wedding Total Summer 4.80% 3.40% 10.10% 11.40% 30% Autumn 5.30% 4.70% 10.60% 9.60% Winter 2.20% 4.20% 0.60% 12% Spring 4.40% 10.80% 8.20% 28% 19.80% 14.70% 35.70% 29.80% Column % Filming Promotion Public Event Wedding Total Summer 24% 23% 28.40% 38.10% Autumn 26.90% 32.20% 29.60% 32.30% Winter 26.70% 14.90% 11.80% 2% Spring 22.40% 29.80% 30.30% 27.60% 100.00% 99.90% 100.10% 11.4% of permits issued were for summer weddings Very few weddings requiring permits occurred in winter

10 Numerical Data DCOVA Numerical Data Ordered Array Cumulative
Distributions Frequency

11 Average time (minutes) to get to university
DCOVA Ordered Array An ordered array is a sequence of data, in rank order, from the smallest value to the largest value. Shows range (minimum value to maximum value) May help identify outliers (unusual observations) Are you a: Average time (minutes) to get to university Evening Person 10 15 20 25 30 35 40 45 50 60 70 80 90 Morning Person 1 65 Neither

12 Frequency Distribution
DCOVA Frequency Distribution The frequency distribution is a summary table in which the data are arranged into numerically ordered classes. You must give attention to selecting the appropriate number of class groupings for the table, determining a suitable width of a class grouping, and establishing the boundaries of each class grouping to avoid overlapping. The number of classes depends on the number of values in the data. With a larger number of values, typically there are more classes. In general, a frequency distribution should have at least 5 but no more than 15 classes. To determine the width of a class interval, you divide the range (Highest value–Lowest value) of the data by the number of class groupings desired.

13 Frequency Distribution Example
DCOVA Frequency Distribution Example Example: A manufacturer of insulation randomly selects 20 winter days and records the daily high temperature 24, 35, 17, 21, 24, 37, 26, 46, 58, 30, 32, 13, 12, 38, 41, 43, 44, 27, 53, 27

14 Frequency Distribution Example
DCOVA Frequency Distribution Example Sort raw data in ascending order: 12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58 Find range: = 46 Select number of classes: 5 (usually between 5 and 15) Compute class interval (width): 10 (46/5 then round up) Determine class boundaries (limits): Class 1: 10 but less than 20 Class 2: 20 but less than 30 Class 3: 30 but less than 40 Class 4: 40 but less than 50 Class 5: 50 but less than 60 Compute class midpoints: 15, 25, 35, 45, 55 Count observations & assign to classes

15 Frequency Distribution Example
DCOVA Frequency Distribution Example Data in ordered array: 12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58 Class Midpoints Frequency 10 but less than 20 but less than 30 but less than 40 but less than 50 but less than Total

16 Relative Frequency and Percentage Distribution
DCOVA Relative Frequency and Percentage Distribution Class Frequency 10 but less than % 20 but less than % 30 but less than % 40 but less than % 50 but less than % Total % Relative Frequency Percentage Relative Frequency = Frequency / Total, e.g = 2 / 20

17 Cumulative Frequency Distribution
DCOVA Cumulative Frequency Distribution Cumulative Frequency Cumulative Percentage Class Frequency Percentage 10 but less than % % 20 but less than % % 30 but less than % % 40 but less than % % 50 but less than % % Total % Cumulative Percentage = Cumulative Frequency / Total * e.g. 45% = 9/20 * 100

18 Why is this a good idea? DCOVA
It condenses the raw data into a more useful form; It allows for a quick visual interpretation of the data; It enables the determination of the major characteristics of the data set including where the data are concentrated and/or clustered.

19 DCOVA Some Tips Different class boundaries may provide different pictures for the same data (especially for smaller data sets) Shifts in data concentration may show up when different class boundaries are chosen As the size of the data set increases, the impact of alterations in the selection of class boundaries is greatly reduced When comparing two or more groups with different sample sizes, you must use either a relative frequency or a percentage distribution

20 Easy to communicate and understand, ambiguous and simplified
DCOVA Graphs Easy to communicate and understand, ambiguous and simplified

21 Summary Table For One Variable Contingency Table For Two Variables
DCOVA Graphical Displays Categorical Data Visualizing Data Bar Chart Summary Table For One Variable Contingency Table For Two Variables Side By Side Bar Chart Pie Chart Pareto

22 Categorical Data DCOVA Pie Chart Bar Chart (mind the gap) Category
Count % Anything/IDK 5 16% Economy 4 13% Engineering Other Pop Culture Science 2 6%

23 Ordered Summary Table for Causes of Incomplete ATM Transactions
DCOVA Pareto Chart Used to portray categorical data A vertical bar chart, where categories are shown in descending order of frequency A cumulative polygon is shown in the same graph Used to separate the “vital few” from the “trivial many” Ordered Summary Table for Causes of Incomplete ATM Transactions

24 DCOVA Pareto Chart The “Vital Few”

25 Side-by-Side Bar Charts
DCOVA Side-by-Side Bar Charts No Errors Total Small Amount 50.75% 30.77% 47.50% Medium 29.85% 61.54% 35.00% Large 19.40% 7.69% 17.50% 100.0% Invoices with errors are much more likely to be of medium size (61.54% vs 30.77% and 7.69%)

26 Visualising Univariate Numerical Data
DCOVA Visualising Univariate Numerical Data Numerical Data Ordered Array Stem-and-Leaf Display Histogram Polygon Ogive Frequency Distributions and Cumulative Distributions

27 Average time (minutes) to get to university
DCOVA Stem and Leaf Display A stem-and-leaf display organizes data into groups (called stems) so that the values within each group (the leaves) branch out to the right on each row. A simple way to see how the data are distributed and where concentrations of data exist Good for small amounts of data Morning 0|1 1|55 2|00 3|000 4|05555 5| 6|05 7| 8| 9| Evening 0| 1|0005 2|055 3|005 4|0555 5|000000 6| 7|0 8|0 9|0 Are you a: Average time (minutes) to get to university Evening Person 10 15 20 25 30 35 40 45 50 60 70 80 90 Morning Person 1 65

28 DCOVA Histogram A vertical bar chart of the data in a frequency distribution is called a histogram. In a histogram there are no gaps between adjacent bars. The class boundaries (or class midpoints) are shown on the horizontal axis. The vertical axis is either frequency, relative frequency, or percentage. The height of the bars represent the frequency, relative frequency, or percentage. Good for large amounts of data Class Frequency 10 but less than 20 but less than 30 but less than 40 but less than 50 but less than Total Relative Frequency Percentage

29 DCOVA Polygon Use midpoint of each class represent the data in that class Connect the sequence of midpoints at their respective class percentages. The cumulative percentage polygon, or ogive, displays the variable of interest along the X axis, and the cumulative percentages along the Y axis. Useful when there are two or more groups to compare

30 Visualising Multivariate Numeric Data
DCOVA Visualising Multivariate Numeric Data Two Numerical Variables Scatter Plot Time-Series Plot

31 DCOVA Scatter Plots Scatter plots are used for numerical data consisting of paired observations taken from two numerical variables One variable is measured on the vertical axis and the other variable is measured on the horizontal axis Scatter plots are used to examine possible relationships between two numerical variables Volume per day Cost per day 23 125 26 140 29 146 33 160 38 167 42 170 50 188 55 195 60 200

32 DCOVA Time Series Plot Used to study patterns in a numeric variable over time Numeric variable is measured on the vertical axis, time on the horizontal Year Number of Franchises 1996 43 1997 54 1998 60 1999 73 2000 82 2001 95 2002 107 2003 99 2004

33 DCOVA Organising many categorical variables: Multidimensional Contingency Table A multidimensional contingency table is constructed by tallying the responses of three or more categorical variables. In Excel creating a Pivot Table to yield an interactive display of this type. Dedicated statistical platforms have specialised methods for analysing/visualising this sort of data in a more sophisticated ways

34 Pivot Tables DCOVA A pivot table:
Summarizes variables as a multidimensional summary table Allows interactive changing of the level of summarization and formatting of the variables Allows you to interactively “slice” your data to summarize subsets of data that meet specified criteria Can be used to discover possible patterns and relationships in multidimensional data that simpler tables and charts would fail to make apparent

35 Pivot Table Examples DCOVA
Three Dimensional Table Showing The Mean 10 Year Return % Broken Out By Type Of Fund, Market Cap, &Risk Level Two Dimensional Table Showing The Mean 10 Year Return % Broken Out By Type Of Fund & Risk Level

36 How to work your way through the data? Data Discovery Methods
DCOVA How to work your way through the data? Data Discovery Methods Drill-down is perhaps the simplest form of data discovery Results of drilling down to the details about small market cap value funds with low risk

37 A quick guide in what not to do
DCOVA A quick guide in what not to do People can only comprehend so much information at once Presentation plays a huge role in how useful visualisation is It’s very easy to make data summaries that are misleading Obscure the data Give the wrong impression Far more subtle than this Photo taken by /u/benjaminteeeee, posted on reddit.com/r/australia

38 Information Overload leads to obscured data
DCOVA Information Overload leads to obscured data

39 DCOVA False Impressions are easy to make “There are three kinds of lies: Lies, damned lies, and statistics” Selective summarization Presenting only part of the data collected Improperly constructed charts Potential pie chart issues Improperly scaled axes A Y axis that does not begin at the origin or is a broken axis missing intermediate values Chart junk

40 Selective Summarisation Life is looking great
DCOVA Selective Summarisation Life is looking great Company Change from Prior Year A +7.2% B +24.4% C +24.9% D +24.8% E +12.5% F +35.1% G +29.7%

41 Selective Summarisation Life is looking great… Until you look further
DCOVA Selective Summarisation Life is looking great… Until you look further Company Change from Prior Year Year 1 Year 2 Year 3 A +7.2% -22.6% -33.2% B +24.4% -4.5% -41.9% C +24.9% -18.5% -31.5% D +24.8% -29.4% -48.1% E +12.5% -1.9% -25.3% F +35.1% -1.6% -37.8% G +29.7% +7.4% -13.6%

42 How obvious is it that both of these summarise the same data?
DCOVA How obvious is it that both of these summarise the same data? Why is it hard to tell? What would you do to improve?

43 Graphical Errors: No relative Basis
DCOVA Graphical Errors: No relative Basis %: Students participation rate in each year level Freq.: Number of Students who participated in the survey

44 Graphical Errors: Compressing the Vertical Axis
DCOVA Graphical Errors: Compressing the Vertical Axis

45 Graphical Errors No Zero Point on the Vertical Axis
DCOVA Graphical Errors No Zero Point on the Vertical Axis

46 DCOVA Chart Junk

47 DCOVA So much chart junk

48 Please make the chart junk stop
DCOVA Please make the chart junk stop

49 <Cries in chart junk>
DCOVA <Cries in chart junk>

50 It’s very easy to accidentally create distortions in Excel
DCOVA It’s very easy to accidentally create distortions in Excel Excel often will create a graph where the vertical axis does not start at 0 Excel offers the opportunity to turn simple charts into 3-D charts and in the process can create distorted images Unusual charts offered as choices by Excel will most often create distorted images

51 Best Practices DCOVA Use the simplest possible visualization
Include a title Label all axes Include a scale for each axis if the chart contains axes Begin the scale for a vertical axis at zero Use a constant scale Avoid 3D effects Avoid chartjunk

52 Summary Methods to organize variables. Methods to visualize variables.
Methods to organize or visualize more than one variable at the same time. Principles of proper visualizations.

53 Self-Learning Activities
Readings: Chapter 2 study case titled: Clear Mountain State Student Surveys on p101 of the textbook and think about how to attempt the case questions by applying the concepts learnt in this chapter USING STATISTICS The Choice Is Yours on p93 –p94 Chapter 2 Excel Guide, EG2.1 – EG2.6, on p102 – p111 Note: only read the contents relating to EXCEL, both In-Depth Excel and AnalysisToolPak; and discard the portions using PHStart.


Download ppt "Organizing and Visualizing Variables"

Similar presentations


Ads by Google