Correlation does not imply causation. But if you have been tracking 8 data sources for 3 months and you still do not know whether sleep affects your coding output, you are leaving insight on the table. The correlation engine exists to surface these relationships automatically.
How It Works
The daily rollup edge function computes a daily summary for each user: total productive time, coding hours, steps, sleep duration, listening time, app switches, focus sessions, and more. The correlation engine takes these daily summaries and computes Pearson correlation coefficients across 19 predefined metric pairs.
Pearson correlation ranges from -1 (perfect inverse relationship) to +1 (perfect direct relationship), with 0 meaning no linear relationship. Each pair also gets a statistical significance flag — if you only have 5 days of data, a correlation of 0.8 is meaningless. With 60+ days, it starts to matter.
The 19 Pairs
Choosing which metrics to correlate was harder than computing the correlations. Too many pairs produce noise — with 15 metrics you could compute 105 pairs, most of which would be spurious. We hand-picked 19 pairs that represent actionable relationships:
- Sleep × Productive Time — do you work more on well-rested days?
- Sleep × Coding Time — same, but specifically deep coding work
- Steps × Focus Duration — does physical activity improve sustained focus?
- Music Listening × Coding Time — does music help or hurt?
- Music × App Switches — does music reduce context switching?
- Screen Time × Sleep — does more screen time mean worse sleep?
- Heart Rate × Productive Time — does resting HR predict output?
- Exercise × Next-Day Productivity — a lagged correlation
Plus 11 more covering GitHub activity, communication time, distraction frequency, and location-based patterns.
Plain-English Interpretations
A correlation coefficient of -0.42 is meaningless to most people. So every pair comes with a plain-English interpretation generated from the coefficient and the sample size:
- Strong positive (0.6+): "More sleep is strongly associated with more productive time"
- Moderate positive (0.3-0.6): "Days with more steps tend to have longer focus sessions"
- Weak/none (-0.3 to 0.3): "Music listening has no clear relationship with coding output"
- Moderate negative (-0.6 to -0.3): "More screen time is moderately associated with less sleep"
- Strong negative (-0.6-): "Higher app switching is strongly associated with less coding"
The Correlations Page
The dashboard's Correlations page shows all 19 pairs as cards, sorted by absolute correlation strength. Each card shows the metric pair, the coefficient (with a colored bar — green for positive, red for negative), the sample size, significance level, and the plain-English interpretation.
You can filter by category (productivity, health, lifestyle) and expand any card to see a scatter plot of the raw daily data points. The scatter plot lets you visually confirm whether the correlation is driven by a real trend or a few outlier days.
When Correlations Lie
A correlation page without caveats would be irresponsible. The dashboard includes a persistent note: correlations show relationships in your data, not causes. "Steps correlate with focus" might mean exercise improves focus, or it might mean you walk more on days you feel good, and feeling good also helps focus. The common cause (mood, energy) drives both.
The correlations page is a starting point for experiments, not conclusions. If you see that sleep correlates with coding output at r=0.65, try sleeping an extra hour for two weeks and see if the relationship holds.