Sub topic 7
Reading your log for patterns
This chapter assumes you already know the habit loop (cue, routine, reward) and the five cue categories: time, place, emotional state, other people, and preceding action. It also assumes you have kept a cue log for at least a week or two, with one entry for each time the habit happened. Here you will turn those entries into a short list of candidate cues.
What you are looking for
A single entry tells you little. A pattern across entries tells you more. Your goal is to find which values in each category show up most often, and then to check whether they show up together.
Reading a log has three steps:
- Count how often each value appears in each category.
- Look at the top value in each category and note how dominant it is.
- Check whether the top values appear together in the same entries.
Counting by hand or by script
For a log of fifteen or twenty entries, a tally on paper is enough. Write each category as a column and make a mark for each value.
If you keep the log in a file or spreadsheet, a short script does the counting. The script below takes a small log and prints the most frequent value for each category.
from collections import Counter
log = [
{"time": "afternoon", "place": "desk", "mood": "bored", "with": "alone", "before": "finished a task"},
{"time": "afternoon", "place": "desk", "mood": "stressed", "with": "alone", "before": "finished a task"},
{"time": "evening", "place": "sofa", "mood": "bored", "with": "alone", "before": "opened laptop"},
{"time": "afternoon", "place": "desk", "mood": "bored", "with": "coworker", "before": "finished a task"},
]
for field in ("time", "place", "mood", "with", "before"):
counts = Counter(entry[field] for entry in log)
value, n = counts.most_common(1)[0]
print(f"{field}: {value} ({n} of {len(log)})")The output is:
time: afternoon (3 of 4)
place: desk (3 of 4)
mood: bored (3 of 4)
with: alone (3 of 4)
before: finished a task (3 of 4)Interpreting the counts
Every category here has a top value that appears in three of four entries. That is the first thing to question. When every category looks equally strong, the counts do not help you choose.
Use these checks:
- Share of entries. A value that appears in 3 of 4 entries is stronger than one that appears in 2 of 4. With only four entries, though, the difference is weak. Aim for at least 15 to 20 entries before you trust a ranking.
- Spread. If one value has 80% of entries and the next has 10%, the leader stands out. If the top three values are close, no single value stands out.
- Co-occurrence. Look at the entries where the top values appear together. In the sample, "afternoon", "desk", and "finished a task" occur together in three entries. A cluster like this is a stronger lead than any one value alone.
You can check co-occurrence with a small addition to the script:
from collections import Counter
log = [
{"time": "afternoon", "place": "desk", "before": "finished a task"},
{"time": "afternoon", "place": "desk", "before": "finished a task"},
{"time": "evening", "place": "sofa", "before": "opened laptop"},
{"time": "afternoon", "place": "desk", "before": "finished a task"},
]
combos = Counter((e["time"], e["place"], e["before"]) for e in log)
for combo, n in combos.most_common():
print(n, combo)This prints each combination with its count, with the most common first. A combination that repeats is a candidate cue cluster.
Count the misses too
Your log only records times the habit happened. It says nothing about times you were at the desk in the afternoon and the habit did not happen. A value can be frequent in your log simply because it is frequent in your life.
For each top value, estimate how often you are in that situation without doing the habit. If you are at your desk most of the day and the habit only happens after finishing a task, then "desk" is probably background and "finished a task" is the better candidate. The next chapter covers this distinction in more detail.
Connect the cue to the reward
The habit loop has a reward, so use it to sort candidates. Look at what you noted after each entry. If the habit consistently follows boredom and the payoff is a few minutes of distraction, "bored" fits the loop. If a value has no plausible link to the reward, treat it with suspicion.
Write down your candidates
End this step with a short written list. Each line should name the cue, the evidence, and your confidence:
| Candidate cue | Evidence | Confidence |
|---|---|---|
| Finishing a task | 3 of 4 entries | Medium |
| Desk | 3 of 4 entries, but present most of the day | Low |
| Boredom | 3 of 4 entries, fits the reward | Medium |
You will test and refine this list in the next chapter, and you will use it later to build an if-then plan.
Exercise
Your log has 20 entries. "Evening" appears in 14 of them, and "sofa" appears in 13. You spend most evenings on the sofa without doing the habit. Which is the stronger candidate cue, and what should you check next?
Show answer
Neither is clearly a cue yet. Because you are on the sofa most evenings, the high counts may only reflect where you spend time. Check what happens just before the habit on those evenings (the preceding action and your mood) and compare entries with evenings on the sofa where the habit did not happen.
Exercise
A log of 5 entries shows "stressed" in 4 of them. Why is it too early to call stress the cue?
Show answer
Five entries is too few to rule out chance. Keep logging until you have at least 15 to 20 entries, and check whether stress also occurs often when the habit does not.