Welcome to Univariate Data Exploration!
Hello there! Welcome to one of the most important first steps in your Exam PA journey. Before we can build fancy predictive models, we have to get to know our data. Think of Univariate Data Exploration like a first date with your dataset—you’re just trying to learn the basic facts about one variable at a time ("uni" means one). By the end of this chapter, you’ll know how to summarize and visualize individual variables to spot patterns, errors, or surprises.
Don't worry if you aren't a math whiz yet. We’ll break everything down into simple pieces with plenty of examples!
1. Categorical vs. Numeric: The Two Big Buckets
Before we do anything, we need to know what kind of data we are looking at. In the actuarial world, data usually falls into two buckets:
Categorical (Qualitative) Data
These are labels or names. You can't perform math on them (you can't add "Red" + "Blue").
- Nominal: Categories with no natural order (e.g., Gender, State of residence, Car color).
- Ordinal: Categories with a specific order (e.g., Education level: High School, Bachelor's, Master's).
Numeric (Quantitative) Data
These are numbers that represent a measurement or count.
- Discrete: Countable numbers (e.g., Number of claims, Number of children).
- Continuous: Can take any value in a range (e.g., Claim amount, Policyholder age).
Quick Review: If you can calculate a meaningful average, it’s probably Numeric. If you are grouping things into "types," it’s Categorical.
2. Exploring Categorical Data
Since we can’t calculate an "average" color or "average" state, we use frequencies to explore categorical data.
Frequency Tables
This is just a count of how many times each category appears. We often look at Relative Frequency, which is the percentage of the total.
Visualizing with Bar Charts
The Bar Chart is your best friend here. Each bar represents a category, and the height represents the count or percentage.
Example: A bar chart showing the number of policies sold by "Region" (North, South, East, West). If the "North" bar is twice as high as "South," you immediately know where your business is concentrated.
Common Mistake: Don't confuse a Bar Chart with a Histogram! Bar charts have gaps between the bars because the categories are distinct. Histograms have no gaps because the data is continuous.
3. Exploring Numeric Data: Central Tendency
We want to know where the "center" of our data lies. There are three main ways to measure this:
- Mean: The arithmetic average. Sum all values and divide by the count.
\( \bar{x} = \frac{\sum x_i}{n} \) - Median: The middle value when the data is sorted. If the data has outliers (extreme values), the median is usually a better representation of "typical" than the mean.
- Mode: The value that appears most often.
Real-World Analogy: Imagine 10 people in a room making \$50,000 a year. Then, a billionaire walks in. The Mean salary will skyrocket, making everyone look rich. However, the Median (the middle person's salary) will stay almost exactly the same. This is why we say the Median is robust to outliers!
\n\n\n\n
4. Exploring Numeric Data: Dispersion (Spread)
\nKnowing the center isn't enough. We need to know if the data is tightly packed or spread out.
\n\nVariance and Standard Deviation
\nThese measure how far, on average, the data points are from the mean.
\n- \n
- Variance (\( \sigma^2 \)): The average of the squared differences from the Mean. \n
- Standard Deviation (\( \sigma \)): The square root of the Variance. It is in the same units as the data (e.g., Dollars), making it easier to interpret. \n
The Five-Number Summary and IQR
\nThis is a great way to see the spread without being distracted by outliers:
\n- \n
- Minimum \n
- First Quartile (Q1 - 25th percentile) \n
- Median (Q2 - 50th percentile) \n
- Third Quartile (Q3 - 75th percentile) \n
- Maximum \n
Interquartile Range (IQR): \( Q3 - Q1 \). This tells you the range of the "middle 50%" of your data.
\n\n\n\n
5. Shape of the Distribution
\nWhen you look at a graph of your data, what does the "silhouette" look like?
\n\nSkewness
\nSkewness tells us about the symmetry of the data.
\n- \n
- Right Skewed (Positive Skew): The "tail" points to the right. Most values are small, but a few very large values pull the mean to the right. (Example: Insurance claim amounts—most are small, but a few are huge!) \n
- Left Skewed (Negative Skew): The "tail" points to the left. (Example: Age at retirement—most people are older, but a few retire very young.) \n
- Symmetric: The left and right sides are mirror images (like the Normal distribution). \n
Memory Aid: "The tail tells the tale." If the long thin tail is on the right, it's right-skewed!
\n\nKurtosis
\nThis describes how "fat" the tails are. High kurtosis means there is a higher risk of extreme outliers (heavy tails).
\n\n\n\n
6. Visualizing Numeric Data
\n\nHistograms
\nA histogram groups numeric data into "bins" (ranges) and shows the frequency. It’s perfect for seeing the shape and skewness.
\n\nBoxplots (Whisker Plots)
\nA boxplot visually displays the Five-Number Summary:
\n- \n
- The Box shows the IQR (middle 50%). \n
- The Line inside the box is the Median. \n
- The Whiskers extend to show the range (usually 1.5 times the IQR). \n
- Dots outside the whiskers represent potential outliers. \n
Did you know? Boxplots are incredible for spotting outliers. If you see dots far away from the whiskers, those are points you should investigate during your Exam PA project!
\n\n\n\n
7. Spotting Issues: Outliers and Missing Values
\nUnivariate exploration is your first chance to find "dirty" data.
\n\n- \n
- Outliers: Data points that are significantly different from the rest. They could be errors (a 200-year-old policyholder) or legitimate but extreme cases (a \$10 million claim).
- Missing Values: Look for "NA" values or blanks. Sometimes "0" or "999" is used to represent missing data—be careful!
Quick Summary Table:
Feature: Central Tendency | Metric: Mean, Median, Mode
Feature: Spread | Metric: Std Dev, IQR, Range
Feature: Shape | Metric: Skewness, Kurtosis
Feature: Visualization | Metric: Histogram, Boxplot, Bar Chart
Key Takeaways for Exam PA
1. Always check the type of variable first (Categorical vs. Numeric).
2. For Numeric data, look at the Mean vs. Median. If they are far apart, your data is likely skewed.
3. Use Histograms to see the distribution shape and Boxplots to find outliers.
4. Right-skewed data is very common in insurance (claims/losses). You may need to transform this data (like using a Log transform) later in the modeling process.
Keep going! You're building the foundation needed to explain your data to the graders. You've got this!