class: center, middle, inverse, title-slide .title[ # ISA 401: Business Intelligence & Data Visualization ] .subtitle[ ## 18: Charts Used for Time-Series Data ] .author[ ###
Fadel M. Megahed, PhD
Professor of Information Systems and Business Analytics
Farmer School of Business
Miami University
@FadelMegahed
fmegahed
fmegahed@miamioh.edu
Automated Scheduler for Office Hours
] .date[ ### Fall 2024 ] --- # Non-graded: COVID19 Data Viz
−
+
08
:
00
Over the next 8 minutes, use Tableau to answer the following questions based on the `covid_cases_county.csv` (which can be downloaded from Canvas): 1. **What are the total number of cases per county?** Use a suitable map to answer this question. 2. **What are the total number of deaths per state?** You can show that using either a table or a map. In case of a map, please show the numbers for each state on the map as well. --- # Learning Objectives for Today's Class - Understand main goals behind visualizing time-series data - Explain the different types of charts for univariate and multivariate time-series --- class: inverse, center, middle # Types of Data Over Time --- # Cross Sectional Data **Cross Sectional Data:** Measurements on multiple units, recorded in a single time period. **Example 1:** H1B 2020-2024 Data for Senior Data Scientists at Netflix
.footnote[ <html> <hr> </html> Data scraped from <https://h1bdata.info/index.php?em=Netflix+Inc&job=Senior+Data+Scientist&city=LOS+GATOS&year=All+Years> on October 30, 2024 using the [rvest](https://cran.r-project.org/web/packages/rvest/rvest.pdf)
. The printing was limited to those individuals who started on/after January 01, 2020, with the filters specified in the URL. ] --- count:: false # Cross Sectional Data **Cross Sectional Data:** Measurements on multiple units, recorded in a single time period. **Example 2:** NBA 2023-2024 Leaders - Top Players in PTS/Game
.footnote[ <html> <hr> </html> **Source:** Data scraped from [Basketball-Reference ](https://www.basketball-reference.com/leagues/NBA_2024_per_game.html)on October 30, 2024 using the [rvest](https://cran.r-project.org/web/packages/rvest/rvest.pdf)
. The printing was limited to the selected variables. ] --- # Time Series Data **Time Series Data:** Comparable measurements recorded on a single (or a few) variables over time (usually a long period of time). **Example 2:** Stock prices of U.S. Airlines <img src="data:image/png;base64,#18_ts_charts_files/figure-html/timeseries2-1.png" height="400px" style="display: block; margin: auto;" /> --- # Panel Data **Panel Data:** Cross sectional measurements (usually many variables) repeated over time (usually over a few time periods). **Example:** World Bank's Data
.footnote[ <html> <hr> </html> **Source:** Data queried from the [World Bank Data](https://datacatalog.worldbank.org/) using the [wbstats](https://cran.r-project.org/web/packages/wbstats/wbstats.pdf)
in R. The printed results show a snapshot of 7 variables (out of a much larger panel dataset). You can think of panel data as a cross-sectional dataset with a longitudinal/time component. ] --- class: inverse, center, middle # Components of a Time Series --- # Trend A **trend** is an increasing or decreasing pattern over time. <img src="data:image/png;base64,#18_ts_charts_files/figure-html/trendUP-1.png" style="display: block; margin: auto;" /> --- count:false # Trend A **trend** is an increasing or decreasing pattern over time. <img src="data:image/png;base64,#18_ts_charts_files/figure-html/trendDown-1.png" style="display: block; margin: auto;" /> --- # Seasonality **Seasonality** refers to the property of a time series that displays REGULAR patterns that repeat at a constant frequency (*m*). <img src="data:image/png;base64,#18_ts_charts_files/figure-html/airpassengers-1.png" style="display: block; margin: auto;" /> --- # Cycle **Cyclical fluctuations** are somewhat irregular (unknown duration). <img src="data:image/png;base64,#18_ts_charts_files/figure-html/autoSales-1.png" style="display: block; margin: auto;" /> --- class: inverse, center, middle # The Goals Behind Visualizing (Time Series) Data --- # Exploratory vs Confirmatory Viz Goals > _Visualizations can be used to explore data, to confirm a hypothesis, or to manipulate a viewer. . . In exploratory visualization the user does not necessarily know what he is looking for. This creates a dynamic scenario in which interaction is critical. . . In a confirmatory visualization, the user has a hypothesis that needs to be tested. This scenario is more stable and predictable. System parameters are often predetermined._ -- [(Grinstein and Ward 2001, 22)](https://www.google.com/books/edition/Information_Visualization_in_Data_Mining/rYFvnyPRwkgC?hl=en&gbpv=1&dq=Grinstein%2C%20Georges%20G%2C%20and%20Matthew%20O%20Ward.%202001.%20%E2%80%9CIntroduction%20to%20Data%20Visualization.%E2%80%9D%20In%20Information%20Visualization%20in%20Data%20Mining%20and%20Knowledge%20Discovery%2C%20edited%20by%20Usama%20Fayyad%2C%20Georges%20G%20Grinstein%2C%20and%20Andreas%20Wierse%2C%2021%E2%80%9345.%20San%20Francisco%2C%20CA%3A%20Morg&pg=PA22&printsec=frontcover) --- # A Structured Approach for Time Series Viz <div class="figure" style="text-align: center"> <img src="data:image/png;base64,#../../figures/ts_plots_flow_chart.png" alt="A Potential Framework for Time Series Visualization" width="100%" /> <p class="caption">A Potential Framework for Time Series Visualization</p> </div> .footnote[ <html> <hr> </html> This is my best attempt to improve on the general advice provided in the previous slide. Many of the suggestions, presented in this flow chart, stem from my past and current research/consulting collaborations. They are by no means a comprehensive list of everything that you can do. ] --- # Singular TS <img src="data:image/png;base64,#18_ts_charts_files/figure-html/tsSingularPlot-1.png" style="display: block; margin: auto;" /> --- # Looking for Trends <img src="data:image/png;base64,#18_ts_charts_files/figure-html/trends-1.png" style="display: block; margin: auto;" /> --- # Looking for Seasonality <img src="data:image/png;base64,#18_ts_charts_files/figure-html/seasonal1-1.png" style="display: block; margin: auto;" /> --- # Multiple TS: Scatterplots <img src="data:image/png;base64,#18_ts_charts_files/figure-html/german1-1.png" style="display: block; margin: auto;" /> --- # Multiple TS: Scatterplot Matrix <img src="data:image/png;base64,#18_ts_charts_files/figure-html/german2-1.png" style="display: block; margin: auto;" /> --- # Multiple TS: Panel Plots <img src="data:image/png;base64,#../../figures/motivationPlot.png" width="100%" style="display: block; margin: auto;" /> --- # Spaghetti Plots (Often w/ Clustering) <img src="data:image/png;base64,#../../figures/spaghetti-1.png" width="80%" style="display: block; margin: auto;" /> --- # Summary Plots (Often w/ Clustering) <img src="data:image/png;base64,#../../figures/summaryPlot-1.png" width="80%" style="display: block; margin: auto;" /> --- class: inverse, center, middle # Recap --- # Summary of Main Points - Understand main goals behind visualizing time-series data - Explain the different types of charts for univariate and multivariate time-series