Actuarial Notes

Exploratory Data Analysis

Study guides: Exam PA, Exam MAS-I, DISC-DA, Exam PCPA, Exam ACIA-CAPSTONE

Exploratory Data Analysis (EDA) is the initial investigation of a data set through summaries and plots, made before any model is built, to find its patterns and problems and to generate questions about it. Its purpose is to form hypotheses, not to confirm conclusions. An exploration proceeds in four steps:

  1. Examine the variation within each variable: its typical, rare and unusual values. Plot the distribution of each variable, with a histogram for a numeric field and a bar chart for a categorical field, and check whether the values meet expectations.
  2. Examine the covariation between variables: whether two or more tend to vary together.
  3. Treat each pattern found as a question to check, not as a conclusion.
  4. Fit a model only after the exploration has shown the data's shape and problems.

Examining each variable's distribution doubles as a data quality check. An impossible value, a zero standing in for a missing value or a duplicated record is found by looking at the data before anything is built on it.

An analyst receives a claims file with paid amount, accident date, report date, vehicle class and driver age, and is asked to build a severity model. What should the first round of exploration look at?

  • A histogram of paid amounts, and of their logarithm, shows the shape of severity.
  • A bar chart of claims by vehicle class shows which classes have little data.
  • Checking the values finds problems: a report date before its accident date, a driver aged 0, or a duplicated claim.
  • Box plots of paid amount by vehicle class and a scatter plot against driver age then show the covariation.
  • The model is fitted only after these checks.

Variation within a variable

The plot of a single variable depends on its data type. A histogram shows the shape of a numeric variable's distribution. For a heavily right-skewed positive variable, such as claim severity, a histogram of the logarithm spreads out the bulk of the data so that the shape is visible. A bar chart shows how often each level of a categorical variable occurs. A box plot displays a variable's median, first and third quartiles, and outliers.

Covariation between variables

Side-by-side box plots, one for each level of a categorical variable, compare a numeric variable such as severity across the levels. Levels with nearly identical boxes and medians can be grouped into a single level of a categorical predictor, while a clearly shifted box suggests a separate level. A scatter plot shows the relationship between two numeric variables. A correlation matrix gives the pairwise correlations among numeric predictors and is used to screen for strongly related, collinear pairs. It captures only linear relationships, and only between pairs.

Side-by-side box plots of severity for four vehicle classes show medians of 3.0, 3.1, 3.2 and 6.8 thousand, with the first three boxes overlapping almost completely. How should vehicle class enter the model?

  • The first three classes have nearly identical boxes and medians, so the data do not distinguish them.
  • They can be grouped into one level.
  • The fourth class's box is clearly shifted upward, so it should be a separate level.

Patterns as hypotheses

A pattern seen in an exploratory plot is a hypothesis, not a conclusion or a rating relativity, and it must be checked before it is acted on. Two checks apply to most patterns:

  1. A difference in a group statistic, such as a median, may arise by chance when the group has few observations, so check the group's count.
  2. An apparent effect of one variable may be explained by a third variable, such as coverage mix or policy limits, so check whether the pattern holds within subgroups.

In a box plot of severity by territory, territory 7 has a median twice that of every other territory, but it has only 12 claims. What should the analyst conclude?

  • A median of 12 claims can differ by chance, so the difference may not be real.
  • Territory 7 may also have a different coverage mix or limits, which could explain the difference.
  • The pattern is a hypothesis to test with more data, or within subgroups, not a relativity to price.

Treating an exploratory pattern as a conclusion A plot made while exploring shows where to look, not what is true. A pattern resting on a few records, or one that disappears within subgroups, was not a real effect of the variable.

Practice questions

Actuarial Notes