Sub topic 8
Telling real cues from coincidence
This chapter covers how to test a candidate cue before you build a plan around it. It assumes you have a cue log with several entries and know the five cue categories: time, location, emotional state, other people, and preceding action. You should also be comfortable reading a short Python script, though the ideas apply equally to a paper log.
Why a frequent item is not always a cue
Reading your log for patterns gives you a list of things that show up often. Some of those things trigger the habit. Others are simply present most of the time, whether or not the habit happens.
Suppose you snack at your desk, and the log says "desk" in 9 of 10 entries. That looks like a strong cue. But if you spend most of your working day at your desk, you would expect "desk" in most entries no matter what. The location tells you where you are, not why you reached for the snack.
Three things can make a candidate look like a cue when it is not:
- Background condition. Something that is true almost all the time, such as sitting at your desk on a workday. It appears in the log because you are always in it.
- Coincidence. A pattern that appears by chance, often because you have only a few entries. Three afternoons in a row with the same coworker can happen by luck.
- A different cue in disguise. Two things travel together, and only one of them does the triggering. You always smoke on the balcony after coffee. The balcony may be incidental, and the coffee may be the real cue.
A real cue is a signal that makes the habit more likely than it would be without it. That definition gives you something to test: compare how often the habit happens with the candidate present against how often it happens without it.
The missing half of the data
A log that records only occurrences cannot make this comparison. It tells you what was true when the habit happened. It says nothing about what was true when the habit did not happen.
To test a cue you need entries from both kinds of moments. There are two practical ways to get them:
- Check-in entries. Pick a recurring situation, such as each time you sit down at your desk in the afternoon. Write one line each time, and mark whether the habit followed. The no-habit lines become your comparison group.
- Scheduled sampling. Set two or three alarms a day. When one goes off, note your time, place, mood, company, and last action, then mark whether you were doing the habit. This gives you a baseline of ordinary moments.
Both methods add a yes/no field to each entry, such as habit: True or habit: False. With that field, every candidate cue can be summarized as a rate: out of the times it was present, how often did the habit happen?
Comparing rates
For each candidate value, count two numbers:
- n: how many entries had that value.
- k: how many of those entries included the habit.
The rate is k divided by n. Compare it with the overall rate, which is the habit count divided by all entries. This overall rate is your baseline.
| Result | What it suggests |
|---|---|
| Rate well above baseline | The value may be a cue. Keep it as a candidate. |
| Rate near baseline | The value does not change the odds. It is likely a background condition. |
| Rate well below baseline | The value may protect against the habit. Note it, because it may be useful in a plan. |
| Rate extreme but n is tiny | Not enough evidence. Keep logging. |
The last row matters most for beginners at this analysis. A rate of 2 of 2 is 100%, but two entries are too few to distinguish a cue from luck.
A worked example
The script below extends the earlier counting script. It takes check-in entries that include non-habit moments and prints each value's rate next to the overall baseline. It also flags values with fewer than three entries.
from collections import defaultdict
MIN_N = 3 # values seen fewer times than this are flagged as too few to trust
checkins = [
{"place": "desk", "mood": "bored", "before": "finished a task", "habit": True},
{"place": "desk", "mood": "stressed", "before": "finished a task", "habit": True},
{"place": "desk", "mood": "bored", "before": "finished a task", "habit": True},
{"place": "desk", "mood": "calm", "before": "finished a task", "habit": True},
{"place": "sofa", "mood": "bored", "before": "finished a task", "habit": True},
{"place": "desk", "mood": "calm", "before": "finished a task", "habit": False},
{"place": "desk", "mood": "bored", "before": "opened laptop", "habit": False},
{"place": "desk", "mood": "stressed", "before": "opened laptop", "habit": True},
{"place": "desk", "mood": "calm", "before": "opened laptop", "habit": False},
{"place": "sofa", "mood": "bored", "before": "opened laptop", "habit": False},
{"place": "desk", "mood": "calm", "before": "call ended", "habit": False},
{"place": "desk", "mood": "bored", "before": "call ended", "habit": False},
]
total_hits = sum(c["habit"] for c in checkins)
baseline = total_hits / len(checkins)
print(f"overall: habit in {total_hits} of {len(checkins)} ({baseline:.0%})")
for field in ("place", "mood", "before"):
totals = defaultdict(int)
hits = defaultdict(int)
for c in checkins:
totals[c[field]] += 1
hits[c[field]] += c["habit"]
for value in sorted(totals):
n, k = totals[value], hits[value]
note = " (too few to trust)" if n < MIN_N else ""
print(f"{field}={value}: habit in {k} of {n} ({k / n:.0%}){note}")The overall rate is 6 of 12, or 50%. Here is how each field reads:
- Place. Desk is 5 of 10 (50%) and sofa is 1 of 2 (50%). Neither differs from the baseline. The desk dominates the log, but it does not change the odds, so it is a background condition.
- Preceding action. "Finished a task" is 5 of 6 (83%), well above baseline. "Opened laptop" is 1 of 4 (25%) and "call ended" is 0 of 2 (0%). The first is a strong candidate cue. The call-ended value has only two entries, so it is not yet evidence of protection.
- Mood. Stressed is 2 of 2 (100%), but n is 2, so the script flags it. Calm is 1 of 4 (25%), a modest hint that calm moments are safer. Bored is 3 of 6 (50%), the same as the baseline.
If you had only logged the habit moments, "desk" and "bored" would have led the counts and "finished a task" would have looked like one cue among several. The comparison group reverses that picture.
Checking a candidate step by step
When a candidate stands out, run it through a short series of questions. The diagram shows the order.
Each question catches a different error.
Does it come before the habit?
A cue must precede the routine. If your log says "felt guilty" in most habit entries, check the timing. Guilt that arrives after the habit is a consequence, not a trigger. Mood entries are the most common place for this mix-up, because people often write down how they felt at the end of the episode. Log mood at the moment before the urge.
Is the rate higher than baseline?
This is the comparison from the previous section. A cue that does not raise the rate is a bystander.
Does another cue explain it?
Check whether two candidates overlap. In the example, "finished a task" and "desk" overlap heavily, because most tasks end at the desk. The place rate sits at baseline while the task rate is high, which points to the task. You can test this directly by looking at the entries where the two come apart. Here, the sofa entry with "finished a task" had the habit. That is one entry, but it fits the idea that the preceding action travels with you and the place does not.
When two candidates overlap in every entry, you cannot separate them from the log alone. Treat them as a bundle for now, and see the next section.
Testing a cue on purpose
When the log cannot settle a question, run a small experiment. Change one candidate and keep the others fixed, for a few days.
- To test a place, do the same afternoon task somewhere else, such as a library table or a different room. If the habit still follows task completion, the place was not the cue.
- To test a time, move the activity earlier or later.
- To test company, work alone on some days and with others on other days, if your schedule allows it.
Keep the experiment short and keep logging. A one-day change is a single data point and can mislead you in the same way a tiny log can.
Common mistakes
- Counting only the occurrences. Without a comparison group, background conditions look like cues.
- Trusting a small streak. Three matches in a row feel like a pattern. With so few entries, chance can produce it easily.
- Logging mood after the fact. Feelings recorded at the end of an episode can look like causes when they are results.
- Picking the most dramatic story. A vivid memory, such as the argument last Tuesday, can stand out more than the dull but more frequent cue.
- Stopping at one cue. Habits can have more than one cue. A rate of 83% leaves 17% of entries unexplained, and those entries may point to a second trigger.
- Confusing a protective condition with a missing cue. A low rate under "call ended" might mean the habit is blocked, or it might mean you had no time. Check which before using it in a plan.
When the answer stays unclear
Sometimes the analysis never produces a clean cue. The rates stay near baseline for every field, or two candidates always appear together. This is a result, not a failure. It can mean:
- the real cue is not in the fields you are logging, for example hunger, a specific app notification, or a smell;
- the habit has several weak cues that add up;
- you need more entries, particularly more no-habit moments.
In those cases, add a free-text note field to your log and write a few words about anything else you noticed. Review the notes after another week and look for a repeating word.
Exercise
Your log has 20 entries, and the habit occurred in 12 of them (60%). The value "with coworker" appears in 5 entries, and the habit occurred in 3 of those. Is "with coworker" a likely cue? Explain, and say what you would do next.
Show answer
No. The rate with a coworker is 3 of 5, or 60%, which equals the baseline of 60%. Being with a coworker does not make the habit more likely than it already is, so it is probably a background condition or coincidence. Five entries is also a small sample. The next step is to look at other fields for a value whose rate is clearly above 60%, and to keep logging, including moments when the habit did not happen.
Exercise
A friend's cue log lists "felt guilty" in 9 of 10 habit entries and names it as the cue. What two checks would you run before accepting this?
Show answer
First, check the timing. Guilt that arrives after the habit is a consequence, so the friend should record mood just before the urge, not at the end of the episode. Second, check the comparison group. The friend should log how often they felt guilty at moments when the habit did not happen. If guilt is also present in most of those moments, it is a background condition and its rate will sit near baseline.
Exercise
"Desk" and "finished a task" appear together in nearly every entry, so the log cannot separate them. Describe one short experiment that could.
Show answer
Do the same task, finishing it, in a different place for a few days, such as a library table or another room, and log whether the habit follows. If the habit still happens after finishing the task away from the desk, the preceding action is the cue. If it disappears away from the desk, the place is the stronger candidate. Change only the place, and keep logging both habit and no-habit moments.