Tutorials › Exam PA - Predictive Analytics › Dotplots and Rug Displays for Small Samples

Exam PA · Visualization and Anomaly Detection · Tutorial 137 of 966

Dotplots and Rug Displays for Small Samples

Use dotplots and rug marks to display and interpret individual observations without hiding repeats or gaps.

Beginner 11 min read

What You'll Learn

  • Explain what each mark represents in a dotplot and a rug display
  • Show how stacking makes repeated observations visible
  • Identify clusters and gaps while distinguishing display from interpretation
  • Choose between a dotplot and rug marks for small or discrete samples
  • Create basic displays in R and recognize their limitations

Why Show Individual Observations?

A summary such as a mean or range can describe a data set compactly, but it does not show where the individual observations fall. That detail matters when a sample is small or values repeat. A histogram groups values into intervals; depending on its bin choices, that grouping can obscure which exact values occurred. Dotplots and rug displays offer a direct alternative: their marks correspond to the observed data.

For exploratory analysis, these displays help answer concrete questions. Are several records identical? Do observations gather in a few locations? Is there an empty interval between observed values? A display can make these features visible, but it cannot establish why they occurred or whether an unusual-looking value is an error. Those conclusions require checking the data and its context.

Definition: A dotplot places a mark at the value of each observation along a numerical axis. When values repeat, marks are commonly stacked so that each observation remains represented and the stack height shows the frequency at that value. A rug display places a short tick mark at each observed value along an axis. Repeated values may produce overlapping ticks.

Reading a Dotplot

A dotplot has a numerical scale and one mark for every observation. In a stacked dotplot, observations with the same value are placed above one another. The horizontal position gives the observed value; the number of vertically stacked marks gives its count. For example, a stack of three marks at 2 means that three observations equal 2, not that one observation has a special size or weight.

The positions also make empty stretches visible. If there are observations at 4 and 9 but none between them, the gap from 4 to 9 is a feature of the displayed sample. It does not show that no possible values can occur there, nor does it by itself establish a separate population group. A dotplot shows observed data, not a causal explanation.

Read the axis carefully before interpreting the plot. A scale can be truncated or stretched, and irregular tick spacing can distort perceived distances. The display should label the variable and its units, use a numerical scale appropriate to the values, and avoid implying more precision than the data have. If values were recorded as whole days, for instance, a dot at 12 represents an observation recorded as 12 days; it does not tell us whether the underlying duration was exactly 12.000 days.

Worked Example: Counts, Repeats, and an Empty Interval

A hypothetical claims team records the number of attachments submitted with each of nine sampled claim files: 0, 0, 1, 2, 2, 2, 4, 5, 5. Use a stacked dotplot description to report the frequencies and identify the observed gap. These are observed values; no probability distribution is assumed.

Step 1: Count each distinct value. The value 0 occurs twice; 1 occurs once; 2 occurs three times; 3 occurs zero times; 4 occurs once; and 5 occurs twice. The total is \(2+1+3+0+1+2=9\), matching the nine files.

Step 2: Translate counts into stacks. Draw two marks above 0, one above 1, three above 2, no mark above 3, one above 4, and two above 5. Each mark represents one file. The tallest stack is at 2 attachments, with three files.

Step 3: Describe the gap without overclaiming. There is no observation at 3. The observed values move from 2 to 4 across that empty position. This is a gap in this sample, not evidence that a file with three attachments is impossible in the broader process.

Check. The stack counts sum to nine, and the displayed values have minimum 0 and maximum 5. A common mistake would be to report the number of distinct values, five, as the sample size. The sample size is nine because every file contributes one mark.

Rug Displays: Precise Positions, Limited Frequency Detail

A rug display is a row of short marks along an axis, with one mark at each observation's location. It is useful when the main goal is to show the exact observed positions, often alongside another display. In base R, the function rug(x) adds marks for the values in x to an existing plot; side = 1 places them at the bottom axis. A rug is not a bar chart: the marks do not have heights that encode frequencies.

If observations are identical or very close, their rug ticks can overlap and look like a single darker or thicker mark. Thus, a rug can preserve the locations of the observations while making their multiplicity hard to count. A stacked dotplot is often clearer when exact repeats matter, especially for short discrete samples.

For a dotplot in base R, stripchart(x, method = "stack", vertical = FALSE) displays a horizontal stacked arrangement. The plotting function does not decide whether the values make sense or whether the sample is representative. Confirm the units, missingness, and recorded values before interpreting its marks.

Worked Example: Choosing Between a Rug and a Stacked Dotplot

A hypothetical service unit records resolution times, in days, for eight cases: 12, 13, 13, 15, 18, 18, 19, 31. Decide what a rug and a stacked dotplot each show. The values are observations, with no probability distribution assumed.

Step 1: Check the sample size and repeats. There are eight values. Counting them gives 12: one; 13: two; 15: one; 18: two; 19: one; 31: one. The frequency total is \(1+2+1+2+1+1=8\).

Step 2: Interpret the stacked dotplot. It has one mark at 12, two at 13, one at 15, two at 18, one at 19, and one at 31. The repeats at 13 and 18 are explicit. The observed values from 12 through 19 form a close group, followed by a large separation before 31.

Step 3: Interpret the rug. It places eight ticks at these observed positions. The two observations at 13 and the two at 18 may overlap; a reader might not be able to count the repeats reliably. The tick at 31 still shows where the largest recorded value lies.

Step 4: Quantify the separation. The next-largest value after 19 is 31, so the gap between consecutive observed values is \(31-19=12\) days. The full observed range is \(31-12=19\) days. These arithmetic checks agree with the ordered values.

Conclusion. Use the stacked dotplot if the question concerns multiplicity and the exact pattern of this small sample; use the rug when precise positions along a shared axis are useful. Neither display establishes that the 31-day case is erroneous or explains why it took longer. The common mistake is to read an overlapping pair of rug marks as one observation; here, the frequency counts show that this would undercount the sample by two ticks if both pairs were each mistaken for one.

A Simple Justification for Stacking

Stacking works because the marks can be put into one-to-one correspondence with the data. Suppose a sample is \(x_1,\ldots,x_n\), and let \(c(a)\) be the number of observations equal to a particular value \(a\). By definition,

$$ c(a)=\sum_{i=1}^{n} I(x_i=a), $$

where \(I(x_i=a)\) is 1 when \(x_i=a\), and 0 otherwise. A stacked dotplot places one mark at \(a\) for each index \(i\) satisfying \(x_i=a\). Therefore, its stack at \(a\) contains exactly \(c(a)\) marks. Summing those stack heights over all distinct observed values counts each observation once, so the total number of marks is \(n\). This is why stacking preserves sample size and frequency, provided the plotting method actually separates equal-value marks rather than drawing them on top of one another.

Worked Display Decisions

Worked Example: Detecting an Apparent Cluster Without Inventing a Boundary

A hypothetical audit records the number of corrections required on ten randomly selected forms: 1, 1, 2, 2, 2, 3, 7, 8, 8, 9. Describe what a dotplot can establish, and avoid treating visual separation as proof of two populations. No distribution is assumed.

Step 1: Verify the frequency representation. The counts are 1: two, 2: three, 3: one, 4: zero, 5: zero, 6: zero, 7: one, 8: two, and 9: one. Their sum is \(2+3+1+0+0+0+1+2+1=10\), as required.

Step 2: Locate the observed concentrations. Six observations lie from 1 through 3: \(2+3+1=6\). Four lie from 7 through 9: \(1+2+1=4\). No observation lies at 4, 5, or 6. This describes a low-value group of six and a higher-value group of four in the displayed sample.

Step 3: State the largest consecutive gap. In sorted order, the gap from 3 to 7 is \(7-3=4\) corrections. The other successive distinct-value gaps are 1, 1, 1, and 1, so 4 is the largest. This calculation confirms the visual separation.

Step 4: Limit the conclusion. The dotplot supports saying that this sample has two visible concentrations separated by an unobserved interval. It does not prove that the forms came from two different processes; that would require contextual evidence. The common mistake is to convert a gap in ten observations into a categorical claim about the population.

Practical Choices and Common Traps

Dotplots are most informative when the sample is small enough that individual marks can be read and when the scale has room to show stacks. Rug displays are compact, especially when added below another numerical display, but they are less effective for counting repeated values. For a large sample, either display can become crowded; adding more marks does not necessarily add more clarity.

When using either display, check the following before writing an interpretation:

  • Match the mark to an observation. Confirm whether repeated values are stacked or overplotted.
  • Read the scale and units. A visual gap is meaningful only relative to the numerical axis.
  • Separate observation from explanation. A cluster or gap describes the displayed sample; it does not establish a cause.
  • Preserve the sample size. For a dotplot, sum the stack counts. For a rug, remember that overlapping ticks may conceal repeats.
  • Check data quality separately. A mark far from the rest is a reason to investigate its record and context, not automatic proof of an error.

These plots are particularly useful as a first look at small or discrete data before modeling. They make raw observations available for inspection while keeping the limits of a small sample visible. This topic is aligned with the SOA Exam PA (Predictive Analytics) syllabus.

Key takeaway: In a stacked dotplot, one mark per observation makes both value and frequency visible. A rug places a tick at each observed value but can hide repeats through overlap. Use the display to describe the sample accurately, not to infer unsupported causes or population rules.

Check Your Understanding

For each problem, identify what the marks show and state the relevant count or gap. Treat each list as hypothetical observed data, with no distribution assumed.

  1. A small equipment review records defects per item as 0, 1, 1, 1, 3, 4. What is the stack height at 1, the sample size, and the largest gap between consecutive distinct observed values? (Answer: stack height 3; sample size 6; largest gap 2, from 1 to 3.)
  2. Seven hypothetical response times in minutes are 5, 5, 6, 8, 8, 8, 14. How many marks should a stacked dotplot show at 8, and what is the gap from the greatest value below 14 to 14? (Answer: 3 marks at 8; gap \(14-8=6\) minutes.)
  3. A rug is drawn for values 2, 2, 4, 6, 6, 6. If overlapping ticks make the rug appear to have only three visible locations, how many observations are in the sample, and which display would communicate the repeats more clearly? (Answer: 6 observations; a stacked dotplot.)
  4. A sample of recorded daily counts is 3, 4, 4, 5, 11, 12, 12, 13. How many observations fall from 3 through 5, how many fall from 11 through 13, and what is the gap between the two nearest observed values on either side of the empty interval? (Answer: 4 in each group; gap \(11-5=6\).)
  5. A dotplot of nine hypothetical inspection scores has stack counts 1: 2, 2: 1, 3: 3, 5: 2, and 6: 1. Verify the sample size and identify the largest gap between consecutive distinct observed values. (Answer: sample size \(2+1+3+2+1=9\); largest gap \(5-3=2\).)
Clinical Biostats