Customers who bought last week are likelier to buy this week. Find out whether that is habit (buying makes
them buy again) or loyalty (some customers were always going to buy), because the two call for opposite
marketing.
π¨βπ« Professor Mode: Guided Learning Experience
New to habit and loyalty? Professor Mode walks you through why repeat buying is not proof of habit,
and how the three models pull the two apart.
QUICK START: Choose Your Path
OVERVIEW & WHAT THIS TOOL SOLVES
A brand manager wants to mail 20,000 "first bottle free" coupons ($70,000) because loyalty-card data shows a shopper who bought last week is far likelier to buy this week. A free trial that turns a shopper into a regular (True Habit) pays for itself many times over; one that goes to someone who was going to buy anyway (Baseline Loyalty) is $3.50 handed away. This tool estimates three nested panel models to pull true habit apart from pre-existing customer loyalty.
π― Questions It Answers
Does buying this week actually cause a shopper to come back next week (habit), or are we just seeing loyal fans repeat-buy?
Will a "first purchase free" trial coupon echo into extra future orders after the promotion ends?
How much is our promotional lift inflated because offers were targeted to our best customers?
π What Data You Need
A balanced or unbalanced customer panel (one row per customer per period, e.g., week or month).
Customer ID, Period Index, and a binary 0/1 Outcome (bought, renewed, opened app).
Optional time-varying drivers (coupon, feature, price) and a static customer segment column.
π‘ What You'll Discover
Side-by-Side Model Ladder (A, B, C): Watch how pooled habit shrinks once customer heterogeneity is accounted for.
Trial Echo Multiplier: Extra future purchases generated per induced trial order.
Out-of-Sample Holdout Check: Forecast accuracy on held-back future periods vs. each customer's own baseline rate.
π Key Nuances & Common Traps to Watch ForClick to expand βΎ
"Bought last week" has two explanations that need opposite marketing: True habit (state dependence) means trial subsidies pay back across future periods; loyalty (unobserved heterogeneity) means targeting existing fans pays back, while blanket trial coupons subsidize purchases that would have happened anyway.
Why a pooled model (Model A) always overstates habit: Stacking all customer-weeks together lets loyal regulars' long buying streaks pose as habit.
Why fixed effects fail on short panels (The Nickell Problem): Giving every customer a separate dummy intercept alongside a lagged outcome \(y_{i,t-1}\) biases the habit estimate downward when panel history \(T\) is shortβwhich is why Model C uses correlated random effects (Wooldridge / Mundlak).
π Under the Hood: Model Equations & Variable DefinitionsClick to expand βΎ
The Three-Model Ladder (Pooled → Mundlak/Wooldridge → Random Effects)Panel Dynamic Logit
π¬ Read it in plain English: Model A assumes all shoppers start with the same baseline appetite; Model B adjusts for each shopper's initial purchase and average exposure to promotions; Model C gives every shopper their own persistent latent loyalty baseline \(u_i\) so that \(\phi\) captures only true week-to-week habit.
Variable & Symbol Directory (Every Term Defined)Hover or focus any role badge for details
yit, yi,t-1
Current & Prior Period Purchase (0/1)YOUR DATA β
Equals \(1\) if customer \(i\) bought in period \(t\) (or \(t-1\)), and \(0\) otherwise.
φ
True Habit (State Dependence)ESTIMATED β
How much buying in period \(t-1\) causally shifts the log-odds of buying in period \(t\).
β, xit
Marketing Driver Slope & ValueESTIMATED β
\(x_{it}\) is customer \(i\)'s promotional/marketing input in period \(t\); \(\beta\) is its immediate effect.
\(u_i\) is customer \(i\)'s time-invariant latent loyalty; \(\sigma\) measures how widely baseline loyalty varies across shoppers.
Step 1DATA SOURCE
Start with a case: each was generated from a known model (or, for Crave, comes from the CLV tool with its
model known), so at the end you can check the three models against the truth. Or bring your own panel:
one row per customer per period.
π
Use a Case Study
Four cases: a free-trial campaign for a grocery cold brew, a food-delivery app's win-back credits,
a pet shop's VIP coupon, and a bookshop whose readers may all be much alike.
πUse a Case Studyclick to switch
π€
Upload Your Data
Drag & Drop raw data file (.csv, .tsv, .txt)
Long format: one row per customer per period, with a customer id, a period
and a yes/no outcome, plus optional driver columns and a segment. CLV's activity panels load as
they are. At least 100 customers; at most 100,000 rows.
No file uploaded.
π€Upload Your Dataclick to switch
INPUTS & SETTINGS
Step 2Tell the model who, when and what
Pick the column that says who each row is, the column that says when, and the yes/no outcome. Then pick
the drivers: things that could change a customer's chance of a "yes" in a given period, such as a coupon.
Then say in a word or two what a "yes" is, and whether it is good or bad news: the write-ups use your words.
Drivers
Tick a driver to include it. "Same period" means this period's value; "1 period earlier"
means the customer's value in the period before.
Driver
Same period
1 period earlier
Load data to see its columns.
Step 3Decide what the model may know about each customer
Model A treats every customer alike. Model B adds what the data records about each one. Model C also
gives every customer their own baseline. Switch pieces off to see what each one does to the habit
estimate.
Advanced
π€ Try this:
Load Thistledown Market and run with every box ticked. Note the habit effect under A, B and C.
Untick Fit model C and run again. Read the "Start here" box: what can the page no
longer tell you?
Load Crave and run. Then untick The segment column and run again. Which model moved,
and which did not?
Load a case or upload a
panel to begin.
Step 4VISUAL OUTPUT
Start with the customers themselves, then watch the habit estimate change as the model learns more about
each one.
Twelve customers, period by period
Each row is one customer and each square one period: dark means a "yes". Rows are sorted from the
customers with the most to those with the fewest. These twelve are a random draw from the data.
π How to Read This Chart
Long dark rows at the top and nearly empty rows at the bottom are loyalty: customers who differ.
Habit shows up as runs that start after a purchase in customers of every kind, not just the top
rows.
Customers who never change say nothing about habit; it rests on those who switch.
Habit or loyalty?
Each bar is how many percentage points a "yes" last period adds to the chance of another this period,
under one model, with its 95% interval. If the bar shrinks as the model learns more about each customer,
the difference was between customers, not carried over from one period to the next.
π How to Read This Chart
Model A treats every customer alike, so it credits all of the loyalty to habit. Its bar is the
number a naive analysis would report.
Model C compares each customer with their own usual rate. Its bar is the habit that is left.
If model B lands close to A, the obvious extra columns did not carry the information needed; that
is a finding too.
How different are the customers?
The bars count customers by how often they had a "yes" over the fitted periods. The shaded band is model
C's middle 80% of customers' chance of a "yes" in a typical period.
π How to Read This Chart
A wide spread, often with piles at both ends, is a market where loyalty can explain a lot.
A narrow pile in the middle means customers are much alike; then the three models should agree.
What is a trial worth?
Extra purchases per 100 trials over the trial horizon, among customers who had not bought in the last
fitted period. Only real habit makes a trial echo; loyalty does not.
π How to Read This Chart
Weigh the model C bar against what a trial costs. The model A bar is what a campaign built on the
naive analysis would expect.
The count excludes the trial purchase itself: it is what follows.
Does it forecast the same customers' next periods?
Lower is better. Each bar is the average penalty on the held-back periods: a confident miss costs a lot.
The bar to beat is each customer's own purchase rate so far.
π How to Read This Chart
Model C forecasts each customer from their own history plus the drivers, so it should beat their
own rate when the model is right.
"Same as last period" has no bar: it only says 0% or 100%. It appears in the table instead.
Forecast
Log loss
Brier
AUC
Accuracy
Switches caught
Step 5WHAT THIS MEANS
Start with the plain reading, then the two write-ups. The numbers below are the ones to quote.
Habit or loyalty?
–
Habit effect, model C
Run the analysis to see what this means here.
How different are the customers?
–
Middle 80% of usual rates
What is a trial worth?
–
Extra purchases per 100 trials
Does it beat each customer's own history?
–
Holdout log loss vs own rate
Start here
Managerial Interpretation
Run the analysis to see the managerial interpretation.
APA-Style Report
Run the analysis to see the APA-style report.
MODEL DETAILS
Coefficients for the three models (log-odds)
Each cell is a coefficient on the log-odds scale with its standard error in brackets. Don't compare the
habit row's odds ratios across columns: model C measures it within each customer and the others across
customers. Compare the habit effect in points, in the chart above, instead.
Term
A: every customer alike
B: plus customer terms
C: random effects
C: odds ratio [95% CI]
Customers / customer-periods fitted:–
Log-likelihood, A / B / C:–
Between-customer SD (Ο):–
Latent ICC:–
Test that customers differ (Ο = 0):–
Quadrature check:–
π How to Read This Table
The "last period" row is the habit on the log-odds scale. Watch it fall from A to C in a
loyalty-driven market.
The first-period and customer-average
rows are not effects. They stand in for each customer's
baseline.
A driver whose coefficient falls a lot from A to C went mostly to customers who buy anyway.
REVEAL THE TRUTH
This case comes from a model with known values. Decide which of the three models you believe first,
then compare.
DIAGNOSTICS & ASSUMPTIONS
Each check below says what it found and what to do about it. A failed check is a next step, not a
verdict on the data.
When it says 30%, does it happen 30% of the time?
Held-back forecasts from the best model, grouped by how confident they were. Points on the diagonal
mean the probabilities can be read as real chances; points below mean the model overstated them.
EXPLORATORY QUESTIONS
On Thistledown, the model with each shopper's first week and coupon average barely moves the habit
estimate. What information is it missing that model C finds, and where does C find it?
On Crave, the segment column lands model B close to model C. Why would that not have worked on
Thistledown?
On Fernhill, the coupon's effect falls between A and C. Write one sentence for the loyalty manager
that explains why, without using the word "coefficient".
On Saltmarsh, the three models agree. Is that a disappointing result or a useful one? Why?
A colleague says "just use each customer's own purchase rate as a control". When would that help,
and what does it cost?
LEARNING RESOURCES
π Going further
Only randomisation settles it: habit versus loyalty is exactly why marketers keep a
random holdout group out of trial offers.
Hidden segments: latent-class models drop the bell-curve assumption and find
groups of customers no column records.
Counts instead of yes/no: units per week need a count model built on the same
idea.