Welcome to Data Exploration and Visualization!
Hello there! If you're preparing for Exam PA, you've likely realized that data isn't just about numbers in a spreadsheet—it's about telling a story. In this chapter, we focus on the Key Principles of Constructing Graphs. Think of this as the "grammar" of visual communication. Whether you are exploring data to find patterns or presenting your final findings to a client, these principles ensure your message is clear, accurate, and professional. Don't worry if you don't consider yourself "artistic"—effective visualization is more of a science than an art!
1. The Purpose: Exploration vs. Communication
Before you even click a button in R, you need to ask: Who is this for?
Exploratory Data Analysis (EDA): This is for you, the actuary. These graphs help you understand the data's distribution, find outliers, and spot relationships. They don't have to be perfect; they just need to be informative.
Explanatory Visualization: This is for them (your boss or a client). These graphs must be polished, clearly labeled, and highlight the specific "Aha!" moment you want the audience to see.
2. The Golden Rule: Data-to-Ink Ratio
Coined by Edward Tufte, the Data-to-Ink Ratio is a fundamental concept in predictive analytics. The idea is simple: use as much "ink" as possible to show the actual data, and as little "ink" as possible on non-data elements.
High Data-to-Ink Ratio (Good): Clean lines, clear points, and minimalist design. Everything on the screen serves a purpose.
Low Data-to-Ink Ratio (Bad): Heavy gridlines, 3D effects, shadows, and distracting background images. This is often called "chartjunk."
Quick Tip: The Eraser Test
Look at your graph and ask: "If I erase this element, does the graph lose its meaning?" If the answer is no, delete it! Avoid 3D bar charts at all costs—they make it harder to read the actual values and add zero value to the analysis.
3. Cleveland’s Hierarchy of Graphical Perception
Not all visual cues are created equal. William Cleveland ranked how accurately humans perceive different types of visual information. When you want your audience to compare values accurately, use the features at the top of this list:
- Position along a common scale: (Best) Think of a Scatterplot. It’s the easiest for our brains to judge.
- Length: Think of a Bar Chart. We are very good at seeing which line is longer.
- Angle/Slope: Think of a Pie Chart. (Warning: Humans are surprisingly bad at comparing angles!)
- Area: Think of a Bubble Chart. It is much harder to tell if one circle is exactly twice the size of another compared to comparing two lines.
- Volume/Color Saturation: (Worst) Use these only for "vibe" or high-level patterns, not for precise comparisons.
Memory Aid: "People Love Apples and Oranges" (P-L-A-O)
Position > Length > Angle > Others (Area/Color). Stick to the top of the list for your most important variables!
4. Choosing the Right Plot for the Job
In Exam PA, you will often be asked to justify why you chose a specific plot. Here is a quick guide:
Univariate Analysis (Looking at one variable)
Histograms: Great for seeing the distribution (shape) of a continuous numeric variable. It helps identify skewness or bimodal patterns.
Boxplots: Excellent for spotting outliers and seeing the five-number summary (Min, Q1, Median, Q3, Max) at a glance.
Bivariate Analysis (Looking at the relationship between two variables)
Scatterplots: Use these when you have two numeric variables. They reveal correlations and non-linear patterns.
Side-by-Side Boxplots: Use these when you have one numeric variable and one categorical variable. For example, comparing "Claim Amount" (numeric) across different "Region" types (categorical).
Bar Charts: Best for categorical variables. Use them to show counts or averages per category.
5. The Importance of Scaling and Labels
A graph without labels is just a collection of dots. To score well on the exam, your graphs must be professional.
- Always label your axes: Use descriptive names like "Annual Income (USD)" rather than the raw R variable name like "ann_inc_v2".
- Include a Title: Tell the reader what they are looking at (e.g., "Relationship between Age and Claim Frequency").
- Watch the Scale: Starting the y-axis at something other than zero can sometimes be misleading, especially in bar charts. Ensure the scale is appropriate for the data—don't "zoom in" so much that tiny differences look like massive crises.
6. Common Pitfalls to Avoid
Even experienced actuaries make these mistakes. Keep an eye out for these "red flags":
1. Overplotting: When you have 10,000 data points in a scatterplot, it just looks like a giant blob. Solution: Use transparency (setting the "alpha" level) or use a "hexbin" plot.
2. Too Many Categories: A bar chart with 50 different colors for 50 states is impossible to read. Solution: Group smaller categories into an "Other" bucket or use a sorted horizontal bar chart.
3. Using Color for No Reason: If all your bars represent the same thing, they don't need different colors. Only use color when it represents an additional variable.
Quick Review Box
- High Data-to-Ink: Keep it simple.
- Position > Length: Use scatterplots and bar charts first.
- Context is King: Labels and titles are mandatory, not optional.
- No 3D: Never use 3D effects for 2D data.
Summary: Key Takeaways
Visualizing data is the first step in Predictive Analytics because it helps you "interview" your data. By following the Data-to-Ink Ratio and Cleveland’s Hierarchy, you ensure that your graphs are not just pretty, but mathematically sound and easy to interpret. On Exam PA, always explain why you chose a specific plot and what it tells you about the business problem. Happy plotting!