Start With the Question, Not the Plot
A plot is useful only if it makes the feature of interest visible. Before choosing one, identify the variables involved, determine whether each is categorical or quantitative, and decide whether the question concerns one variable’s distribution or a relationship between variables. A display that is suitable for one question may obscure the answer to another.
For example, a portfolio analyst might ask how claim amounts are distributed, whether claim amounts differ by sales channel, or whether claim amount changes with policy duration. These questions use related data but ask about different structures. The first concerns one quantitative variable; the second compares a quantitative variable across categories; the third concerns two paired quantitative variables.
Use the variable’s meaning, not just how its values are stored. A region label recorded as 1, 2, 3, or 4 is still categorical if those numbers identify regions. Conversely, a count such as the number of claims is quantitative even though it takes whole-number values. The key distinction is whether arithmetic differences between recorded values have a meaningful interpretation.
A Practical Matching Guide
| Question | Variable structure | Useful display |
|---|---|---|
| How are values distributed? | One quantitative variable | Histogram or boxplot |
| How frequent is each category? | One categorical variable | Bar chart |
| How does a quantitative outcome vary across groups? | One quantitative and one categorical variable | Side-by-side boxplots, or separate distribution displays |
| How do two quantitative measurements vary together? | Two paired quantitative variables | Scatterplot |
A histogram groups quantitative values along a numerical scale and shows how observations are distributed across that scale. It is appropriate for questions about concentration, gaps, or broad distributional shape. A boxplot compresses a quantitative distribution into a compact summary, making it useful when comparing distributions across groups or when a concise display is needed. A boxplot does not show every individual value.
A bar chart displays category frequencies or proportions. Each category is distinct, so the bars are separated. The order of categories can follow a meaningful convention or be arranged to support comparison; the numerical distance between category labels is not meaningful. A scatterplot represents each observation as a point whose horizontal and vertical coordinates are the two measurements recorded for that same observation.
Worked Example: Choosing a Display for Claim Categories
A hypothetical insurer classifies 40 reported claims by the main reported cause: weather, water, theft, or other. The counts are 18, 12, 6, and 4, respectively. The analyst asks which causes account for the largest shares of the reported claims. Choose a display and calculate the category proportions.
Method. There is one categorical variable, cause, and the question concerns the frequency composition across its categories. A bar chart is appropriate. The counts sum to \(18+12+6+4=40\).
For weather, the proportion is \(18/40=0.45\), or 45%. For water, it is \(12/40=0.30\), or 30%. For theft, it is \(6/40=0.15\), or 15%. For other, it is \(4/40=0.10\), or 10%. The proportions sum to \(0.45+0.30+0.15+0.10=1.00\), a check that all 40 claims have been accounted for.
A bar chart of the counts or proportions answers the question directly; the two versions have the same ordering because they use the same denominator. A basic R call for counts is barplot(c(18, 12, 6, 4)), with category labels supplied for the bars. The common mistake avoided here is treating category names as numerical measurements and using a histogram. Cause labels have no numerical scale, so histogram intervals would have no meaningful interpretation.
Worked Example: Choosing a Display for Claim Amounts
A hypothetical sample of eight paid claims has amounts, in thousands of dollars, of 2, 3, 3, 4, 4, 5, 6, and 15. The analyst wants to see the distribution and also report a compact summary of its center and spread. Which displays are useful, and what is the median and range?
Method. Claim amount is quantitative. A histogram is useful for viewing the distribution across the numerical scale. A boxplot provides a compact summary that can be compared with other groups if needed. The histogram and boxplot have complementary purposes rather than being interchangeable: the histogram shows more detail about how values are distributed, while the boxplot is more compressed.
The values are already in increasing order. There are eight observations, so the median is the mean of the fourth and fifth values: \((4+4)/2=4\) thousand dollars. The minimum is 2 and the maximum is 15, so the range is \(15-2=13\) thousand dollars. Thus the median is $4,000 and the range is $13,000.
A basic R call for a histogram is hist(amount); a boxplot can be made with boxplot(amount). The unusually high value of 15 is visible in the numerical context, but the plot alone does not establish that it is erroneous or implausible. The common mistake avoided is using a bar chart for these measurements: individual dollar amounts are quantitative values, not named categories.
Worked Example: Preserving Paired Measurements in a Scatterplot
For five hypothetical policies, an analyst records policy duration in years and annual service cost in dollars. The paired observations are \((1, 120)\), \((2, 150)\), \((3, 145)\), \((4, 210)\), and \((5, 250)\). The question is whether longer policy duration tends to occur with higher service cost. Choose a plot and interpret the pattern cautiously.
Method. Both duration and service cost are quantitative, and each duration is paired with the cost for the same policy. A scatterplot is the appropriate display. Its five points are \((1,120)\), \((2,150)\), \((3,145)\), \((4,210)\), and \((5,250)\), with duration on the horizontal axis and cost on the vertical axis.
Reading the points in order of duration, service cost rises from 120 to 150, dips from 150 to 145, then rises to 210 and 250. Overall, the displayed pattern is upward, although it is not perfectly increasing. The plot supports describing an association in this small hypothetical sample; it does not establish that longer duration causes higher service cost.
The basic R call is plot(duration, service_cost). The common mistake avoided is making separate plots of the duration values and the cost values and then trying to infer their relationship. Separate distributions do not preserve which cost belongs to which duration.
Why Pairing Matters
A scatterplot is specifically a display of paired measurements. This can be justified by considering what information the pairing adds. Suppose the quantitative values are \(X=(1,2,3)\) and \(Y=(1,2,3)\). Their means are both 2. If the pairs are \((1,1),(2,2),(3,3)\), the population covariance is
Now keep the same values of \(X\) and \(Y\), but pair them as \((1,3),(2,2),(3,1)\). The two separate distributions have not changed, and both means are still 2. However, the covariance is now
The same marginal values can therefore describe a positive or negative relationship depending on how observations are paired. The scatterplot preserves those pairs as individual points; separate histograms do not. This is why a relationship question requires a display that retains the joint information.
Worked Example: Comparing a Quantitative Outcome Across Groups
A hypothetical service team records claim amounts, in thousands of dollars, for two processing channels. Channel A has values 2, 3, 5, 8; Channel B has values 4, 6, 7, 9. The question is whether the typical amounts and overall spread appear different across channels. Choose a display and calculate medians and ranges.
Method. Channel is categorical and claim amount is quantitative. Side-by-side boxplots are useful because they place the two quantitative distributions in a common visual frame. The numerical summaries can also be calculated directly.
For Channel A, the sorted values are 2, 3, 5, 8. Its median is the average of the middle values, \((3+5)/2=4\), and its range is \(8-2=6\) thousand dollars. For Channel B, the sorted values are 4, 6, 7, 9. Its median is \((6+7)/2=6.5\), and its range is \(9-4=5\) thousand dollars.
The median for Channel B is \(6.5-4=2.5\) thousand dollars higher in this sample, while its range is 1 thousand dollars smaller. These calculations summarize the supplied observations; they do not by themselves establish a population difference or explain its cause. In R, a grouped boxplot can be produced with boxplot(amount ~ channel, data = claims). The common mistake avoided is comparing only the two overall averages while ignoring differences in the distributions; the plot makes group-level distributions the focus.
Common Plot-Selection Traps
The most consequential errors usually happen before any plotting command is run. An analyst may identify the variable type incorrectly, ignore whether observations are paired, or choose a display that answers a different question from the one asked.
- Using a histogram for category codes. A code such as 1 for North, 2 for South, and 3 for West is a label. A histogram implies meaningful numerical intervals between values; a bar chart of category counts is appropriate instead.
- Using a bar chart for measured values. If values such as claim amounts are measurements on a numerical scale, a histogram or boxplot is generally more informative than treating each distinct amount as an unrelated category.
- Using separate one-variable plots to answer a two-variable question. Separate displays show the individual distributions but omit which measurements occurred together. Use a scatterplot for paired quantitative variables.
- Ignoring the comparison being requested. When the question asks how a quantitative outcome varies across categories, preserve the group labels and compare the distributions, for example with side-by-side boxplots.
- Overstating what a plot shows. A visible association or group difference is descriptive evidence in the plotted data, not proof of causation or a guarantee that the same pattern holds in a wider population.
A useful decision sequence is to name the target variable or pair of variables, label each as categorical or quantitative, and state the question in plain language. If the question asks “how is this one measurement distributed?”, select a distribution display. If it asks “how does this measurement vary across groups?”, compare distributions by category. If it asks “how do these two measurements vary together?”, preserve the pairs with a scatterplot.
State what each observation represents and what each recorded variable measures.
Decide whether its values are categories or quantitative measurements; do not mistake numeric labels for measurements.
Decide whether it concerns a distribution, a group comparison, or a relationship between paired measurements.
Use a bar chart, histogram, boxplot, or scatterplot according to the variable types and question.
Check Your Understanding
For each situation, identify the relevant variable types, select a suitable display, and complete the requested calculation or interpretation.
- A hypothetical portfolio has 20 claims classified as wind (7), water (5), fire (4), or other (4). Which display suits a comparison of category shares, and what proportion are wind claims? (Answer: A bar chart; \(7/20=0.35\), or 35%.)
- A hypothetical set of six repair costs, in thousands of dollars, is 3, 4, 4, 5, 7, 12. Which displays could show the quantitative distribution, and what is the median? (Answer: A histogram or boxplot; median \(=(4+5)/2=4.5\) thousand dollars.)
- For four hypothetical accounts, the paired values of months active and service calls are \((10,8),(20,7),(30,12),(40,15)\). Which display preserves the pairing, and what broad pattern is present? (Answer: A scatterplot; an overall upward association, with a dip from the first to the second observation.)
- Two hypothetical groups have costs A: 2, 3, 5, 8 and B: 4, 6, 7, 9, all in thousands of dollars. Which display supports comparing their distributions, and what is the difference in sample medians? (Answer: Side-by-side boxplots; B’s median is \(6.5-4=2.5\) thousand dollars higher.)
- A data set records area codes 1, 2, 3, and 4 for four regions, with counts 8, 3, 6, and 3. An analyst uses a histogram because the codes are numbers. What is the correction, and what proportion belongs to code 3? (Answer: Treat the codes as categorical and use a bar chart; the proportion for code 3 is \(6/20=0.30\), or 30%.)