Building Better Habits: Machine Learning’s Role in Understanding Routine Behaviors

Date:

Ever wondered how habits form and what factors influence them? Understanding habit formation is crucial, whether you’re trying to develop a new exercise routine or improve hygiene practices. This guide will break down a recent study that used machine learning to explore how habits are formed in gym attendance and handwashing behaviors.

Insights from the Study

The study by Buyalskaya et al. (2023) investigates habit formation in exercise and hygiene using machine learning techniques, specifically the Predicting Context Sensitivity (PCS) approach. The research focuses on gym attendance and hospital handwashing behaviors, analyzing large datasets to understand how habits form over time.

Participants and Methodology

The researchers applied the PCS approach, which uses machine learning to identify context variables that predict individual behaviors. This study focused on two distinct groups of participants: gymgoers and healthcare workers.

Participants in the Study: Who Were They?

This method was used on two datasets:

  1. Gym Attendance: Data from 30,110 gym members, totaling over 12 million observations.
    • Demographics: The gymgoers were predominantly female, with 62% of the sample identifying as female. The median age of participants was 34 years, with ages ranging from early 20s to mid-40s.
    • Data Collection: Data was collected from 24-Hour Fitness, a large North American gym chain. Participants were tracked over a long period, with the dataset covering 14 years, from 2006 to 2019. Each participant’s gym attendance was monitored, with over 12 million data points recorded.
    • Behavioral Context: The study tracked gym check-ins, which provided information on the frequency and consistency of gym attendance. Variables such as time of day, day of the week, and time since the last visit were analyzed to predict future gym visits and understand habit formation.
  2. Hospital Handwashing: Data from 3,124 healthcare workers, totaling over 40 million observations.
    • Data Collection: The handwashing data was obtained from healthcare workers across 30 hospitals. The study used RFID technology to monitor whether individuals washed their hands at every opportunity during their shifts.
    • Behavioral Context: The dataset contained over 40 million data points, tracking whether healthcare workers complied with hand hygiene guidelines when entering and exiting patient rooms. The analysis focused on the context in which handwashing occurred, such as time of day, shift length, and room location.
    • Demographics and Work Context: Unlike gymgoers, specific demographic details such as the age and gender of healthcare workers were not highlighted in the study. However, the study noted that participants had varying levels of compliance and different numbers of shifts recorded, providing a diverse sample for analyzing handwashing habits.

What is the PCS Approach?

The Predicting Context Sensitivity (PCS) approach is a machine learning technique used to understand and predict human behavior by looking at the context in which that behavior occurs. Here’s a straightforward breakdown of how it works and why it’s useful.

The PCS approach helps researchers figure out what factors (or “context variables”) are most likely to influence a person’s behavior. It’s like having a smart assistant that learns your routine and can predict what you’re likely to do next, helping you understand your habits better and make positive changes. These factors could be things like the time of day, the day of the week, how long it’s been since the last similar action, or even what other people around them are doing.

How Does PCS Work?

  1. Data Collection: First, PCS collects a lot of data about when and where people do certain things. For example, it might track when someone goes to the gym or when healthcare workers wash their hands.
  2. Identifying Context Variables: The PCS approach then looks at all the different variables—like the day of the week, the last time the person did the same activity, or whether it’s a weekday or weekend—and figures out which of these variables best predicts the behavior.
  3. Predicting Behavior: Using these context variables, PCS creates a “predictability score” for each person. This score tells us how likely it is that the person will repeat the behavior under similar circumstances. A higher score means the behavior is more predictable, which often indicates it’s becoming a habit.

Why is PCS Important?

  • Habit Formation: By understanding which context variables influence behavior, PCS can show how habits form over time. For example, it can reveal that someone is more likely to go to the gym on Mondays after work, which might help them turn gym visits into a regular habit.
  • Personalized Interventions: PCS can also be used to design more effective interventions. If you know what triggers a behavior, you can create strategies to encourage good habits (like regular exercise) or discourage bad ones (like skipping handwashing).

Key Findings

1. Context Sensitivity and Predictability

The PCS approach identified several context variables that were crucial in predicting individual behaviors in gym attendance and handwashing. The predictability measure ranged from 0.5 (completely random) to 1 (highly predictable), indicating how much behavior could be anticipated based on contextual factors.

  1. Gym Attendance: Key context variables included:
    • Time Lag: The time since the last gym visit was the most significant predictor. The longer the gap, the less likely an individual was to return on a given day.
    • Day-of-Week Streak: Individuals were more likely to attend the gym on specific days they had previously visited, with Monday and Tuesday being particularly influential.
    • Attendance Rate: The recent frequency of gym visits also played a significant role in predicting future attendance.
  2. Handwashing in Hospitals: Important context variables included:
    • Previous Shift Compliance: A healthcare worker’s compliance in their last shift was the most robust predictor of handwashing behavior.
    • Room Entry/Exit: Compliance was higher upon exiting a room compared to entering.
    • Room Compliance of Others: The behavior of colleagues within the same room influenced individual compliance.

2. Time to Habit Formation

The study found substantial variability in the time required to form habits between different behaviors and individuals. Contrary to popular belief, there is no “magic number” of days for habit formation.

  • Gym Attendance: The median time to form a gym habit was between 68 to 78 days (about 2 to 3 months). This was based on the time taken for behavior to reach a predictable steady state.
  • Handwashing in Hospitals: The median time to form a handwashing habit was much shorter, around 9 to 10 shifts (approximately 220 washing opportunities). This rapid formation is likely due to the repetitive and frequent nature of the behavior.

3. Behavioral Interventions and Predictability

The study also examined how established habits affected responsiveness to interventions.

  • Gym Attendance:
    • Reward Sensitivity: Individuals with more predictable gym attendance (those whose behavior was more habitual) showed less responsiveness to interventions designed to increase gym visits. This finding aligns with the idea that strong habits reduce sensitivity to external rewards.
    • Intervention Example: The StepUp intervention, aimed at increasing gym attendance, had a more significant impact on less predictable gymgoers, suggesting that those with weaker habits are more responsive to motivational nudges.
  • Handwashing in Hospitals:
    • Monitoring Technology Impact: The introduction of RFID (Radio Frequency Identification) monitoring technology significantly increased handwashing compliance initially, indicating a strong initial response to the new context. However, over time, the behavior stabilized, showing that the habit formation was influenced by continuous monitoring.
    • Final Shift Opportunity: The hypothesis that handwashing behavior would differ in the final room visit of a shift (due to perceived reward change) was not supported. This indicates that handwashing behavior remained consistent regardless of the shift context.

Additional Analyses

  • Reward Sensitivity: The study explored how changes in rewards affected habit formation. While it found strong evidence of reward insensitivity in gym attendance, similar patterns were not observed in handwashing behavior. This suggests that reward insensitivity may be more context-specific and not uniformly applicable across all habitual behaviors.
  • Demographic Analysis: Older individuals in rural areas with children showed higher predictability in gym attendance, while younger individuals in urban areas showed lower predictability.

Tips for Applying Insights from the Habit Formation Study

After learning about how habits form, especially in the contexts of exercise and hygiene, here are some practical tips you can follow to apply these insights to your own life:

1. Start Small and Build Gradually

When forming a new habit, start with small, manageable actions. For example, if you’re trying to build a gym habit, start with short, regular workouts rather than committing to long sessions right away.

  • Why: The study showed that habits take time to form—weeks for simple behaviors and months for more complex ones. Starting small helps you stay consistent and build up over time.

2. Be Consistent with Timing and Context

Perform your new habit at the same time of day and in the same context as much as possible. For example, if you’re trying to establish a handwashing routine, always wash your hands when entering and exiting a specific room.

  • Why: Consistency in timing and context was found to be a key factor in making behaviors more predictable and habitual.

3. Use Contextual Cues to Your Advantage

Identify and use specific cues in your environment that can trigger the habit you want to form. For instance, placing your gym shoes by the door can serve as a reminder to exercise.

  • Why: The PCS approach highlighted how certain context variables, like the day of the week or the time since the last activity, play a significant role in habit formation.

4. Track Your Progress

Keep track of your habit-building journey using a journal, app, or simple calendar check-off. Monitoring your progress can help you stay motivated.

  • Why: Tracking your habits allows you to see your progress over time, reinforcing your commitment and helping you adjust if needed.

5. Leverage “Fresh Start” Moments

Take advantage of natural “fresh start” moments, like the beginning of a new week, month, or even after a holiday, to start a new habit.

  • Why: The study found that certain days, like Mondays, were more effective for starting or maintaining habits. These moments can psychologically motivate you to begin anew.

6. Prepare for Obstacles and Plan Ahead

Anticipate challenges that might disrupt your habits, such as a busy schedule or lack of motivation, and plan how to overcome them. For example, set up a backup plan for workouts on days when you can’t go to the gym.

  • Why: Understanding that habits take time to form means accepting that there will be obstacles. Planning for these can help you stay on track.

7. Seek Support and Accountability

Share your habit goals with friends, and family, or join a community group with similar interests. Having someone to check in with can keep you accountable.

  • Why: Social support can be a powerful motivator, and knowing that others are aware of your goals can encourage you to stick to your habits.

8. Reward Yourself

Celebrate small victories along the way, like hitting a milestone or staying consistent for a certain number of days. Rewards can be simple, like a treat or a relaxing activity.

  • Why: Positive reinforcement helps solidify habits by associating them with rewards, making you more likely to repeat the behavior.

Conclusion

The PCS approach provides a nuanced understanding of habit formation, revealing significant differences in how habits develop across behaviors and individuals. The study underscores the importance of personalized interventions tailored to individual context sensitivity and predictability.

“Our research shows that habit formation is a highly individual process, taking months to establish for complex behaviors like gym attendance, but just weeks for simpler actions like handwashing in a hospital setting. Understanding these nuances allows for more personalized and effective behavioral interventions.” — Buyalskaya et al. (2023)

By recognizing the importance of context and predictability, you can better tailor your strategies to form lasting habits and design strategies to promote healthy habits. Try applying these insights to your own life. Whether you’re aiming to hit the gym regularly or improve your hand hygiene, understanding the mechanics of habit formation can help you succeed.


References:

  1. Buyalskaya, Anastasia, et al. “What can machine learning teach us about habit formation? evidence from exercise and hygiene”. Proceedings of the National Academy of Sciences, vol. 120, no. 17, 2023. https://doi.org/10.1073/pnas.2216115120
Veronica Salvador
Veronica Salvador
Co-founder and editor!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Share post:

Popular

More like this
Related

Is Pumpkin a Superfood? How Is This Fall-Time Favorite Good For You?

As fall arrives, pumpkins take center stage—not just as...

The Best Superfoods to Eat This Fall: A Seasonal Guide to Boosting Health

As the leaves change and temperatures drop, fall brings...

10 Remarkable Health Benefits of Blueberries

Blueberries, those small, deep-blue gems, have been celebrated for...

Seeing Stress as a Challenge, Not a Threat, Can Improve Your Life

We all experience stress, whether it comes from small...