Measuring Trial-to-Paid Conversion Rate with Censored Data
Statistics & ExperimentsModel answerLast updated
Estimate conversion probability from free trial to paid subscription, handling incomplete observations and confounding factors.
Problem
Your company runs a product with a free trial period. Leadership wants to know: "What percentage of trial users convert to paying customers?"
You have access to two datasets:
Trial starts table:
user_idtrial_start_at(timestamp)trial_length_days(integer, e.g., 14 or 30)- Optional:
country,channel,device_type,plan_tier
Conversion events table:
user_idpaid_start_at(timestamp; null if user never converted)- Optional:
revenue
Your Task
-
Define the metric precisely. What exactly does "conversion probability" mean? Specify the cohort, the event, and the measurement window.
-
Compute the estimate. Explain your calculation approach, addressing:
- Users whose trials haven't ended yet (right-censored observations)
- Users who convert days or weeks after their trial expires
- Changes in user mix over time (different channels, countries, etc.)
-
Quantify uncertainty. Provide confidence or credible intervals and explain your choice of method.
-
Recommend diagnostics. What additional checks and metrics would you track to ensure this estimate is trustworthy and actionable?
Hints
Hint 1
Define the observation window relative to trial start, not calendar time
Hint 2
Kaplan-Meier estimation handles incomplete observations without bias
Hint 3
Segment-level rates and mix shifts can both drive aggregate changes
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Model Answer: Measuring Trial Conversion Probability
A strong answer transforms an ambiguous business question into a well-defined statistical estimand, applies appropriate methods for incomplete data, and communicates results with honest uncertainty bounds.
1. Precise Metric Definition
Conversion probability is meaningless without specifying three components: who, what, and when.
Cohort (who):
- Users who initiated their first trial during a fixed calendar period (e.g., all of March 2025, UTC).
- Exclude test accounts, employees, and flagged fraud.
- Handle repeat trials by keeping only each user's initial trial, so no user is counted multiple times.
Event (what):
- First occurrence of
paid_start_atfollowingtrial_start_at. - Optionally require "valid" conversion: no refund or chargeback within 14 days. Document which definition you use.
Window (when):
- Measure conversions within W days from trial start. For example, W = trial_length_days + 7 (grace period for late conversions).
- Justify W empirically: plot the cumulative distribution of time-to-conversion and choose where the curve flattens (e.g., 95th percentile). This captures most conversions while keeping the window finite.
- If trial lengths vary significantly, either normalize W relative to trial end or report separate rates per trial length bucket.
Final estimand:
p_W = Probability that (paid_start_at − trial_start_at ≤ W days | user in cohort)
This formulation eliminates ambiguity before any computation begins.
2. Estimation Strategy
Basic Approach (Mature Cohorts Only)
For users whose full W-day window has elapsed (trial_start_at + W ≤ today), compute:
p̂ = k / n
where k = number who converted within W days, n = cohort size.
SELECT
COUNT(*) AS n,
SUM(CASE
WHEN c.paid_start_at >= t.trial_start_at
AND c.paid_start_at < t.trial_start_at + INTERVAL '1 day' * (t.trial_length_days + 7)
THEN 1 ELSE 0
END) AS k
FROM first_trials t
LEFT JOIN conversions c USING (user_id)
WHERE t.trial_start_at + INTERVAL '1 day' * (t.trial_length_days + 7) <= CURRENT_DATE;
This is unbiased but excludes recent cohorts entirely, making the estimate stale.
Handling Incomplete Observations
Including users whose windows haven't closed yet and counting them as non-converters biases estimates downward. Three solutions:
Option 1: Kaplan-Meier Survival Analysis
Treat time-to-conversion as a survival problem. Users are right-censored at min(W, days_since_trial_start).
- Estimate the survival function Ŝ(t), then p̂_W = 1 − Ŝ(W).
- This uses all available data and is unbiased when censoring is non-informative (determined only by calendar cutoff, not user behavior).
- Compute standard errors via Greenwood's formula or bootstrap.
Option 2: Cohort Maturity Curves
From fully mature cohorts, compute the ratio r_d = cumulative_conversion_rate_at_day_d / final_rate_at_day_W. For an immature cohort, project its final rate as observed_rate_at_day_d / r_d. This assumes conversion curve shapes are stable over time—validate on historical cohorts.
Option 3: Drop Immature Users
Report only on cohorts with W days of follow-up. Simple and unbiased, but lags reality by W days.
Late Conversions
Users often convert in two waves: one spike immediately at trial end (auto-renewal) and a long tail of manual opt-ins weeks later. Handle this by:
- Setting W based on empirical plateaus in the cumulative curve.
- Reporting a conversion curve (at 7 days, at trial end, at trial end + 30) rather than a single number.
- Separating automatic conversions (card on file, opted into auto-renew) from active opt-ins—they have different retention profiles.
Segmentation and Mix Effects
Aggregate conversion rate is a weighted average: p = Σ_s w_s · p_s, where w_s is segment s's share of trials. A change in p over time can result from:
- Rate effect: actual behavior change (p_s changes)
- Mix effect: composition shift (w_s changes, e.g., more low-intent traffic from a new channel)
To disentangle:
- Stratify: Report p_s separately by channel, country, device, plan tier.
- Standardize: Fix a reference mix (e.g., Q1 2025 proportions) and compute p_std = Σ w_s^ref · p̂_s. This isolates rate changes from mix changes.
- Decompose: Δp = Σ Δw_s · p_s (mix) + Σ w_s · Δp_s (rate).
- Regression adjustment: Fit a logistic model with segment covariates and time period. For censored data, use Cox regression or discrete hazard models.
Important: This adjusts for observed confounders only. Causal claims about interventions (e.g., changing trial length) require randomized experiments.
3. Uncertainty Quantification
Binomial Confidence Intervals (Mature Cohorts)
For n = 10,000, k = 1,200: p̂ = 12.0%.
Standard error: SE = √(p̂(1−p̂)/n) = √(0.12 × 0.88 / 10,000) ≈ 0.00325 = 0.33 percentage points.
95% Wald CI: [11.4%, 12.6%]
Better: Use the Wilson score interval, especially for small segments or extreme rates (near 0% or 100%).
from statsmodels.stats.proportion import proportion_confint
k, n = 1200, 10000
ci = proportion_confint(k, n, alpha=0.05, method='wilson')
print(f"Conversion: {k/n:.1%}, 95% CI: [{ci[0]:.1%}, {ci[1]:.1%}]")
Bayesian Credible Intervals
With a Beta(1,1) prior (uniform), the posterior is Beta(1+k, 1+n−k). Report the 2.5th and 97.5th percentiles. This approach naturally handles small segments and provides intuitive probability statements.
Kaplan-Meier Standard Errors
Use Greenwood's formula for Var(Ŝ(W)) or compute a log-log transformed confidence band.
Bootstrap
Resample users (not events) with replacement and recompute the entire pipeline. Works for any estimator, including projected rates. Run 1,000+ iterations.
Communication
State the full context:
"Among users who started their first trial in March 2025, 12.0% (95% CI: 11.4%–12.6%) converted to paid within 37 days of trial start. 88% of conversions occurred within 2 days of trial expiration. The April cohort is still maturing; projected rate is 11.5% (bootstrap 95% CI: 10.3%–12.8%)."
Visualize cumulative conversion curves by cohort with confidence bands. Flag small-sample segments rather than ranking them on noise.
4. Diagnostics and Guardrails
Data Quality Checks:
- Match rate between trial and conversion tables.
- Duplicate trials per user.
- Conversions timestamped before trial start (indicates bugs).
- Timezone consistency across tables.
- Share of bot/fraud accounts in the cohort.
Temporal Stability:
- Overlay weekly cohort curves. Shape shifts invalidate projection methods.
- Account for seasonality (holiday cohorts behave differently).
Conversion Quality Metrics:
- Refund and chargeback rate within 30 days of conversion.
- Payment failure rate for auto-renewed users.
- Retention at month 2 and month 3 post-conversion.
Business Metrics:
- Revenue per trial start = p × average revenue per user. This matters more than p alone when comparing channels with different plan mixes.
- Expected lifetime value (LTV) per trial start = p × LTV_paid. Channels with lower p but higher LTV can still be more valuable.
Segment Deep Dives:
- Compare new vs. returning users.
- Break down by trial length (7-day vs. 30-day trials).
- Identify high-converting micro-segments for targeted growth.
By treating this as a statistical estimation problem with explicit assumptions and uncertainty, you deliver an answer that is both rigorous and actionable.