week2.pdf
Table of contents
- Visualizing distributions
- Describing the center
- Measuring spread
- Describing the form
- Putting the summaries together
- Time series
- What have we learned? Reading distributions
- What have we learned? Summaries and time
- This week’s material
- Looking ahead
- Appendix
1. Visualizing distributions
1.1 Why explore data
Exploring data visually is crucial for several reasons:
- Data cleaning: It helps identify if the data is clean and ready for analysis, prompting a return to the cleaning phase if necessary.
- Guiding analysis: Understanding the main patterns in the data suggests appropriate subsequent analytical steps.
- Providing context: Visualizations reveal the characteristics of main variables, highlighting important features.
- Completing analysis: In rare cases, exploratory analysis alone can suffice for the entire data analysis.
- Generating questions: Uncovering interesting patterns can lead to new research questions 4.
1.2 Visualizing distributions
The distribution of a variable describes the frequency of each of its values within the dataset, expressed either as absolute or relative frequencies. Various tools are used to visualize these distributions:
- Categorical variables: Bar charts and pie charts are suitable for categorical data.
- Numerical variables: Histograms, stemplots, and boxplots are used for numerical data 5.
📝 A bar chart can illustrate the percentage of US flight delays attributed to various causes, with Carrier delays being the highest at 35.5% 6.
1.3 Bar chart
A bar chart displays the frequency of different categories. For instance, a bar chart can illustrate the percentage of US flight delays attributed to various causes 6.
| Cause of delay | Percentage |
|---|---|
| Carrier | 35.5 |
| Incoming | 28.9 |
| ATC | 22.3 |
| Cancelled | 9.3 |
| Weather | 4.0 |

1.4 Pie chart
A pie chart represents proportions of a whole, often used for categorical data. It can also show the percentage breakdown of US flight delays by cause, similar to a bar chart 7.

1.5 Histogram
A histogram is a type of bar chart that shows the frequency of values falling within specific intervals or bins.
- If a numerical variable has few distinct values, the histogram can show the frequency of each value.
- If there are many values, the data is grouped into bins of usually equal size.
- The choice of bin size is critical, as it can be set by deciding the number of bins or the size of each bin.
- Visual inspection of a histogram reveals key features of the data's distribution 8.
An example histogram displays the distribution of distances of hotels in Vienna to the city center. The x-axis represents this distance, and the y-axis shows the number of hotels at each distance interval 9.

📝 A histogram displays the distribution of distances of hotels in Vienna to the city center, with the x-axis representing distance and the y-axis showing the number of hotels at each distance interval 9.
1.6 The impact of bin choice on histograms
The way data is binned significantly affects how a histogram represents the distribution.
- Using a small number of wide bins simplifies the visualization but can obscure important details within the data.
- Conversely, using a large number of narrow bins can reveal finer details but may also exaggerate random fluctuations, making them appear more significant than they are 11.













