How to Use CausalLens

A step-by-step guide for non-technical users. No statistics PhD required.

5-minute quick start

  1. 1. Open the app → choose Clinical Treatment Effects
  2. 2. Click Use sample dataset
  3. 3. Set treatment = metformin, outcome = hba1c
  4. 4. Select confounders: age, bmi, baseline_severity
  5. 5. Pick 2 methods → Run causal analysis
Try it now

What is causal inference?

Correlation means two things move together. Causation means one thing makes another change. CausalLens helps you estimate causal effects — but results always depend on assumptions about your data.

TypeExampleCausalLens?
CorrelationIce cream sales and drowning both rise in summerNo
CausationDoes this drug cause lower blood sugar?Yes
CausationDid minimum wage policy cause employment changes?Yes

The 5 wizard steps

Step 1 — Choose your field

Pick the domain closest to your question. This tunes AI suggestions and recommended methods.

Step 2 — Load your data

You have three options:

Your data needs at minimum:

Step 3 — Define your question

Write your question in plain English, then map it to columns:

Example question:

“Does metformin reduce HbA1c, adjusting for age and BMI?”

Column mapping:

Treatment → metformin · Outcome → hba1c · Confounders → age, bmi, baseline_severity

Click AI suggest variables & methods for automatic suggestions. Works without an API key; richer with OpenAI configured in backend/.env.

Confounders tip: Ask “Could this factor affect who gets the treatment AND the outcome?” If yes, include it.

Step 4 — Pick methods

Select one or more analysis methods. We recommend running at least two and comparing results.

MethodLevelIn plain English
Propensity Score MatchingBeginnerMatch similar treated and control patients
Inverse Probability WeightingBeginnerReweight data to balance groups
DoWhy BackdoorIntermediateFormal causal model with explicit assumptions
Double / Debiased MLIntermediateFlexible machine learning approach
Causal ForestAdvancedDifferent effects for different subgroups
T-Learner (Uplift)IntermediateWho benefits most from a campaign?
Difference-in-DifferencesIntermediateBefore/after policy comparison
PC / LiNGAM DiscoveryAdvancedDiscover cause-effect structure from data

Step 5 — Read your results

Each method produces a result card with:

You also get an AI summary in plain English and a causal graphshowing relationships between variables.

Important: A negative effect on HbA1c is good (lower blood sugar). Always interpret results in your domain context. CausalLens estimates effects under assumptions — it cannot prove causation from data alone.

Worked example: Diabetes study

Follow along with the built-in medicine sample:

  1. Choose Clinical Treatment Effects
  2. Click Use sample dataset
  3. Question: “Does metformin reduce HbA1c?”
  4. Treatment: metformin · Outcome: hba1c
  5. Confounders: age, bmi, baseline_severity
  6. Methods: Propensity Score Matching + DoWhy Backdoor
  7. Run analysis → expect a negative effect (metformin lowers blood sugar)

Using your own CSV

Checklist

Example CSV

treatment,outcome,age,income
1,45000,35,52000
0,38000,42,48000
1,51000,28,55000

Common mistakes

Glossary

Treatment
The intervention you study (drug, policy, campaign)
Outcome
What you measure as a result
Confounder
A factor affecting both treatment and outcome
ATE
Average treatment effect for the whole population
Propensity score
Probability of receiving treatment given confounders
Difference-in-Differences
Compares change over time between treated and control groups

FAQ

How many methods should I run?

At least two. If they agree, you have more confidence. If they disagree, review assumptions and data quality.

Can the app prove causation?

No. CausalLens estimates effects under stated assumptions. Your study design and domain expertise matter.

Do I need OpenAI?

No. The app works fully without it. An API key enables richer AI explanations and hybrid causal discovery.

Where is the full written tutorial?

See TUTORIAL.md in the project folder for the complete guide with all domain examples.

Ready to start?

Try the diabetes sample — it takes about 5 minutes.

Open CausalLens