How Condition Analysis Works: Multiple Regression Behind Your Performance Insights

How Condition Analysis Works: Multiple Regression Behind Your Performance Insights

Michelle LiuMichelle Liu
8 min read

What is Condition Analysis?

CortexLab's "Condition Analysis" is a Pro feature that statistically analyzes the relationship between your pre-test lifestyle data and your scores, ranking the factors that most impact your cognitive performance.

For example, it might reveal that "more sleep raises your score" or "alcohol the night before lowers it" — patterns unique to you, backed by your own data.

What Data Does It Use?

Before each test, you log 12 lifestyle factors on the condition input screen:

Scaled Inputs (multiple choice)

  • Sleep duration — 4h / 5h / 6h / 7h / 8h / 9h+
  • Sleep quality — 1 (poor) to 5 (excellent)
  • Caffeine intake — None / Little / Normal / High
  • Alcohol (previous day) — None / Some / Heavy
  • Exercise — None / Walk / Light / Intense
  • Hours since waking — 0.5h / 1.5h / 3h / 5h+
  • Bathing — None / Showered / Bathed
  • Time since last meal — Just ate / 1h ago / 2h+ ago
  • Room temperature feel — Cold / Comfortable / Hot

Toggle Inputs (ON/OFF)

  • Nasal congestion — Yes / No
  • Ventilation — Yes / No
  • Medication change — Yes / No

These responses are saved alongside your test result (total score 0–100). Analysis begins once you have at least 5 data points.

The Algorithm: OLS Multiple Regression

CortexLab uses OLS (Ordinary Least Squares) multiple regression, one of the most fundamental and widely-used methods in statistics.

What Is Multiple Regression?

In simple terms, it answers: "How much does each factor contribute to the outcome, when you account for all other factors simultaneously?"

For example, if you only look at sleep duration, you might see "I scored higher on days I slept 7 hours." But maybe you also exercised that day. Multiple regression controls for other variables to estimate each factor's independent effect.

The Formula

Your score is modeled as:

Score = β₁×Sleep Hours + β₂×Sleep Quality + β₃×Caffeine + ... + β₁₂×Medication + error

Each β (beta) coefficient represents "how many points your score changes when that factor changes by one unit." Finding these β values is what regression does.

Processing Steps

  1. Data collection: Gather all test results that include condition data
  2. Standardization: Convert each variable to mean=0, standard deviation=1. This is necessary because sleep hours (4–9) and shower (0–2) have different scales
  3. Regression: Solve the normal equation β = (X'X + λI)⁻¹ X'Y using Gauss-Jordan elimination
  4. Stabilization (Ridge regularization): Adding a small λ = 0.1 keeps the computation stable even with limited data
  5. Ranking: Sort by absolute standardized β, filtering out negligible effects (|β| < 0.02)

How to Read the Results

Results are displayed as a ranked list, ordered by impact strength.

Positive (+) Values

These factors tend to raise your score. For example:

  • "Sleep Duration, more sleep: +2.3 pt" → Each extra hour of sleep is associated with ~2.3 more points
  • "Ventilation, when ventilated: +1.5 pt" → Days with ventilation tend to score ~1.5 points higher

Negative (−) Values

These factors tend to lower your score. For example:

  • "Alcohol, more alcohol: -3.1 pt" → Each level of alcohol is associated with ~3.1 fewer points
  • "Nasal Congestion, when congested: -2.0 pt" → Congestion days tend to score ~2 points lower

Bar Length

Bar length is based on the standardized beta coefficient, which measures "how much a one-standard-deviation change in each factor affects your score." This allows fair comparison across factors with different scales. Longer bars mean greater impact on your performance.

Important Caveats: 3 Things to Know

1. Correlation, Not Causation

This analysis shows that "A and B tend to move together," but it doesn't prove "A causes B."

For example, if "exercise days have higher scores," it could be the exercise itself — or it could be that you exercise and perform well on days you feel good overall. Treat these results as reference data, not definitive proof.

2. More Data = More Reliable

With 12 input variables, regression needs sufficient data to produce stable results. Analysis starts at 5 tests, but reliability improves significantly at 20+ data points. The more tests you take, the more accurately the analysis reflects your true patterns.

3. Some Relationships Are Non-Linear

For example, room temperature is encoded as "Cold(0) → Comfortable(1) → Hot(2)", but "Comfortable" is likely optimal. Regression assumes a linear relationship, so it may not fully capture these non-linear patterns.

Getting Better Results

  • Test daily: More data means more accurate analysis
  • Be accurate with inputs: Honest, careful logging leads to better insights
  • Vary your routine: Trying different conditions makes effects more visible
  • Keep it up long-term: Over time, you'll capture seasonal and lifestyle changes for a richer picture

Discover what's really affecting your cognitive performance — with your own data.

Take the CortexLab Test →
Michelle Liu

Michelle Liu

Developer & Cognitive Performance Researcher at CortexLab

Software engineer bridging cognitive science and technology. Focused on building scientifically-grounded brain performance measurement tools.

Take the Test

Take the CortexLab Test

Start Test

Related Articles