Visualizing a correlation with a third variable
Bivariate viz plus confound awareness.
A scatter plot with a trend line shows the relationship; encode network type by color or facets to expose a lurking variable.
Treating the correlation as causal.
WHY IT MATTERS A correlation between two continuous measures is best understood visually before you make claims, and a strong bivariate relationship can be entirely reshaped by a hidden third variable.
WHAT IT TESTS Choosing the correct chart for two continuous variables and showing maturity about confounders and causality.
A GOOD ANSWER COVERS For two continuous variables the natural choice is a scatter plot, with load time on the x-axis and session duration on the y-axis. Each point is a session or a user. Add a fitted trend or regression line to make the negative slope explicit, and consider a density or hexbin overlay if there are too many points to read. To probe whether network type drives the relationship, introduce it as a third encoding: color the points by WiFi versus Cellular and fit a separate trend line per group, or use faceting with small multiples, one scatter per network type, so slopes can be compared side by side. A bubble chart could add a fourth variable through point size if needed. The key insight is that comparing within-group slopes can reveal Simpson's paradox, where the pooled trend masks or even reverses the within-segment trend, for example if cellular users simply have both slower loads and shorter sessions for unrelated reasons.
WHEN IT MATTERS Use color or faceting whenever a categorical covariate might confound a continuous relationship; reach for it before asserting any causal story.
COMMON WRONG ANSWERS A bar chart, which collapses the point-level relationship. Asserting load time causes shorter sessions without controlling for confounds. Cramming too many encodings into one unreadable chart. Forgetting to add a trend line, leaving the relationship to the eye.
ONE CONCRETE EXAMPLE A scatter shows session duration falling as load time rises. Coloring by network reveals two clouds: within both WiFi and cellular the slope is mild, but cellular sessions cluster at high load and low duration, so the steep pooled slope was partly driven by network type, prompting a deeper, segment-aware analysis rather than a premature causal claim.
Interview question
You color a load-time vs session-duration scatter by network type and the per-group slopes look mild while the pooled slope is steep. What does this most likely indicate?
- a.A possible Simpson's paradox where network type confounds the pooled relationshipCorrect
- b.Load time and session duration are statistically independent
- c.The scatter plot is the wrong chart and a bar chart is needed
- d.The correlation is now proven to be causal
Why? this is the answer
Divergent within-group and pooled slopes are the signature of Simpson's paradox driven by a confounder. It does not prove causation, the scatter is appropriate, and a strong pooled slope means the variables are not independent.
Just read this? Test yourself on what you have been reading.
Read the original → lookerstudiomasterclass.com
- #data-visualization
- #scatter-plot
- #correlation
- #confounding
- #analytics
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles