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 & LEARNING OBJECTIVES
A brand manager wants to mail 20,000 "first bottle free" coupons, about $70,000, because the loyalty-card
data shows that a shopper who bought last week is far likelier to buy this week. A free trial that
turns a shopper into a regular pays for itself many times over. One that goes to someone who was going to
buy anyway is $3.50 handed away. This tool tells the two apart.
🎯 What You'll Learn
"Bought last week" has two explanations, and they need different marketing. Habit
means trials pay back; loyalty means finding the right customers pays back.
A pooled model always leans toward habit. Stacking customers lets the loyal ones'
streaks pose as habit.
Separating them needs each customer's own baseline. A column that records why
customers differ (a segment) helps; when nothing records it, the random-effects model estimates it
from each customer's history.
Crude fixes help only when they carry information. A customer's first week and their
average driver levels pull the estimate back when offers were targeted, and barely at all when they
were not.
Targeted offers look more powerful than they are. If the best customers get the most
coupons, coupons and buying go together whether or not coupons work.
Forecast the same customers' next periods, and beat their own history. A customer's
own purchase rate so far is a very hard forecast to beat.
The three models, each a logistic regression for customer \(i\) in period \(t\):
A, every customer alike:
\( \text{logit}\,P(y_{it}) = \alpha + \phi\, y_{i,t-1} + \beta x_{it} \)
B, plus what the data records about each customer: A \( + \gamma_0 y_{i0} + \gamma
\bar{x}_i \) (+ segment), where \(y_{i0}\) is the customer's first period and \(\bar{x}_i\) their
average level of each driver
C, each customer gets their own baseline (random effects): B \( + u_i \), with \( u_i \sim
N(0, \sigma^2) \)
\(\phi\) is the habit (state dependence). \(\sigma\) is how much customers differ beyond what the data
records (loyalty). Only C can tell them apart when no column says why customers differ.
📘 Key concepts
Habit (state dependence): buying changes the customer, so a purchase today makes
the next one likelier.
Loyalty (heterogeneity): customers differ, so last week's purchase mostly tells you
which kind of customer this is.
Habit effect: how many percentage points last period's purchase adds to this
period's chance, on the same scale for all three models.
Trial value: extra purchases that follow one induced purchase. Only real habit makes
a trial echo.
Holdout: the last few periods are held back for every customer and forecast one at a
time from the period before.
🧭 When to use it, and when not to
Use it when many customers' yes/no behaviour is recorded period after period: bought this week,
ordered this month, opened the app, renewed.
A number per customer per period (spend, units): not this tool; its outcome is
yes/no.
Why not give every customer their own fixed term? With last period's outcome in
the model, that approach is itself biased when each customer's history is short, so this tool does not
offer it. (Analysts call this the Nickell problem.)
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.