Find the Row Behind Any Point
An outlier on a chart is a question about a row. Here's the loop from "what is that?" to "how much does it matter?" — without leaving the file.
gapminder, 2007 only — 142 countries. Download the file (the data behind The Gap That Closed), then in Organize ▸ Filter set the action to Keep with the rule year equals 2007, and add log_gdp = log10([gdpPercap]) with Data ▸ Add Column….Requires Stratum 1.5.
Plot 2007 life expectancy against income (Charts ▸ Relationship ▸ Scatter, X Columns = gdpPercap on a log axis, Y Columns = lifeExp) and the curve is clean except for a handful of points sitting 20-plus years below it, at incomes where most countries live past 65. That gap is the interesting part of the chart. Here's how to get from those dots to the records, and then to an answer.
1. Identify: hover, then Reveal in Datasheet
Open Labels, pick country and continent, and set Show labels on to Tooltip Only: nothing is drawn, but hovering any point now names it. The lowest one is Swaziland, Africa.
To see the whole record, right-click the point and choose Reveal in Datasheet. Stratum switches to the data sheet, selects that row's cell — on the chart's value column — and scrolls it into view. It works the same from a gallery panel or a zoom-loupe panel, and on every chart whose marks are rows: Box-Whisker and Violin points, Q-Q, PCA Biplot, the regression diagnostic plots, the control charts. A Trend point that averages several rows reveals the first of them.
2. Mark the suspects — every chart rings them
One row is an anecdote. Mark all five that sit far below the curve — Swaziland, Angola, Botswana, South Africa and Equatorial Guinea: shift-click each, or shift-drag a rectangle around the low band (Option-shift-drag, or Alt-shift on Windows, takes a point back out). Each marked point wears a ring.
The mark is on the row, so it's on every view of the row. Open a Box-Whisker of lifeExp with Partition = continent and Overlays ▸ Data Points on: the five are ringed inside Africa's box — not one of them beyond its whiskers, which is worth knowing. A box plot within Africa doesn't flag them; the income relationship does.
3. Look at them together in the sheet
In the data sheet, marked rows are tinted with a dot in the row gutter. Choose Data ▸ Rows ▸ Sort by Marked — or click the row gutter's header — and the five move to the top, with your other sort levels kept as tie-breakers. Now their incomes, populations and life expectancies sit side by side. Select Marked Rows selects them for any row command that follows.
4. Measure: does the model care?
Run Analyze ▸ Linear Regression with Response (Y) = lifeExp and Numeric Predictors = log_gdp. R² is about 0.65, a slope of about 16.6 years per tenfold income. Right-click the coefficient row for Residuals vs. Fitted, pick country under Labels, and its default Outliers setting names exactly these five: each has an externally studentized residual beyond −3. The same rings are already on them.
Now ask the counterfactual. In Organize ▸ Filter (action Keep, All), add a second rule with is not marked. Every chart and report recomputes on 137 rows: R² rises to about 0.76 and the slope barely moves, to about 16.9. Five rows were costing a tenth of the explained variance, not bending the line. Delete the rule and everything comes back.
For a version that keeps all 142 rows in the model, add a column flagged = marked() — 1 for a marked row, 0 otherwise — and add it to the regression as a second predictor. Its coefficient is about −24 years: the size of the shortfall, estimated rather than eyeballed. Because marked() is live, marking a sixth country updates the column, the filter and the fit.
5. Write down what you found
Right-click a ringed point and choose Edit Label…. Store the note in a New Column… — a label is data, so it lands in a text column you can sort, filter and export — and the rows stay marked. The mark, the note and the filter are saved with the file, so whoever opens it next sees the same five rings and why.
Presenting rather than investigating? How to Label Specific Points on a Scatter Plot covers placement and dragging. Reading the diagnostics themselves: Reading Regression Diagnostics.
Frequently asked questions
How do I find which row a point on a chart comes from?
Right-click the point and choose Reveal in Datasheet. Stratum switches to the data sheet, selects that row's cell — on the chart's value column when it can — and scrolls it into view. It works on single charts, gallery panels and zoom-loupe panels.
Which charts support Reveal in Datasheet?
Every chart whose marks are rows: Scatter, Bubble, Trend, Q-Q, Box-Whisker, Violin, Clustering, PCA Biplot, Parallel Plot, the regression diagnostic plots and the control charts. A point that stands for several rows — a Trend average or a control-chart subgroup — reveals the first of them. Aggregate charts such as Histogram or Pie, where a mark is a bin or a slice, don't.
How do I keep only the marked rows, or leave them out?
In Organize ▸ Filter, add a rule with is marked or is not marked. Set the filter action to Keep to keep the matching rows (the default action, Exclude, removes them). Every chart and report recomputes, and the rule follows the marks as you change them.
What does marked() do in a formula?
marked() returns 1 when the row is marked and 0 when it is not. A formula column built on it updates as you mark and unmark rows, so you can use it as a group, a filter or a model term.
Does marking a row change my data?
No. A mark is a row state saved with the file, not a value in a column. It changes results only where you ask it to: a filter rule on is marked, or a formula that calls marked().
Is this the same on Windows?
Yes — Reveal in Datasheet, marking, Sort by Marked, the is marked filter rule and marked() all work the same on Mac and Windows. Where the Mac uses Command-click to add a row to a selection, Windows uses Ctrl-click.
Related: Color by Group or Color by Row? → · Linear Regression →