shannon conners, phd jmp, sas - quantified selfquantifiedself.com/docs/shannonconnersposter.pdf ·...

23
Personal activity monitors measure sleep, steps, exercise duration and intensity, and are useful tools for weight loss and maintenance when paired with meal tracking software and a wireless scale. Apps that show daily summaries are common, but exporting summary data sets can allow for deeper exploration of large personal data sets using JMP. I wrote two JSL scripts to combine and parse nearly four years of my monthly food log and activity data sets exported from BodyMedia® software 1 . While the exported summary data was not optimal for import with JMP’s many point-and-click options, even a novice scripter like me could write the JSL to import and format these data sets for further filtering, analysis and visualization. Analysis of Personal Diet and Fitness Data With JMP® Shannon Conners, PhD JMP, SAS Abstract Export files from BodyMedia® web interface Import activity and food log data into JMP Categorize food items Explore and visualize data Objectives 49 Excel workbooks of summary data 6 different worksheets (activity, sleep, etc..) Imported an example of each sheet interactively to create a JSL template Constructed an import and concatenation loop using an example from a SESUG paper by Michael Hecht 2 Added data and modeling types, column formats and missing value codes via JSL 48 food log PDFs saved as text files PDF to Excel conversion was problematic ~30 pages each as PDFs, 24 pages each as text Imported and concatenated via JSL Parsed with JSL regex pattern matching, thanks to coaching from Craige Hales Raw Data Files Standardized food item names and categorized foods Used newly enhanced JMP 12 Recode platform Consolidated similar food item names with new manual grouping feature Used Filter field to view related items from 1,816 row food item table Placed items from cleaned list into food categories Merged grouped item list with food log data set Imported files from 12/21/2010 - 7/28/2014 date range 1,316 rows of activity summary data 34,432 rows of summarized food log data Click pictures to zoom Data Preparation

Upload: buingoc

Post on 23-Aug-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Personal activity monitors measure sleep, steps,

exercise duration and intensity, and are useful tools

for weight loss and maintenance when paired with

meal tracking software and a wireless scale. Apps

that show daily summaries are common, but

exporting summary data sets can allow for deeper

exploration of large personal data sets using JMP.

I wrote two JSL scripts to combine and parse nearly

four years of my monthly food log and activity data

sets exported from BodyMedia® software1. While

the exported summary data was not optimal for

import with JMP’s many point-and-click options,

even a novice scripter like me could write the JSL to

import and format these data sets for further

filtering, analysis and visualization.

Analysis of Personal Diet and Fitness Data With JMP®

Shannon Conners, PhD

JMP, SAS

Abstract

• Export files from BodyMedia® web interface

• Import activity and food log data into JMP

• Categorize food items

• Explore and visualize data

Objectives

• 49 Excel workbooks of summary data

– 6 different worksheets (activity, sleep, etc..)

– Imported an example of each sheet interactively to

create a JSL template

– Constructed an import and concatenation loop

using an example from a SESUG paper by Michael

Hecht 2

– Added data and modeling types, column formats

and missing value codes via JSL

• 48 food log PDFs saved as text files

– PDF to Excel conversion was problematic

– ~30 pages each as PDFs, 24 pages each as text

– Imported and concatenated via JSL

– Parsed with JSL regex pattern matching, thanks to

coaching from Craige Hales

Raw Data Files

• Standardized food item names and categorized foods

– Used newly enhanced JMP 12 Recode platform

– Consolidated similar food item names with new manual grouping feature

– Used Filter field to view related items from 1,816 row food item table

– Placed items from cleaned list into food categories

– Merged grouped item list with food log data set

• Imported files from 12/21/2010 - 7/28/2014 date range

– 1,316 rows of activity summary data

– 34,432 rows of summarized food log data

Click pictures

to zoom

Data Preparation

Page 2: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Exploring Activity, Eating, and Sleep Patterns

Analysis of Personal Diet and Fitness Data With JMP®

Shannon Conners, PhD

JMP, SAS

• Is my activity seasonal?

• My sleep patterns showed the impact of

– my son’s birth

– seasonal fluctuations

Favorite Visualizations

• How did I gain and lose the baby weight…and how have I kept it off?

– Number of days in deficit or surplus impacts my weight trend

– Weight changes happen with little macronutrient variation

– Lowering carbs or eliminating alcohol helps me lose weight

• Used enhancements to JMP 12 axis settings dialog including

– axis preview

– categorical tick marks

– positioning reference lines with crosshairs tool

• How complete is my meal logging data?

– Filtered by number of meals logged and

reviewed food log for low calorie days

Click any picture

to zoom

The quality of self-reported diet and fitness data can be highly variable and vulnerable to non-compliance!

Page 3: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

1 www.bodymedia.com2 Hecht, Michael. “From Raw Data to Beautiful Graph using JSL.” Paper,

SESUG 2012. http://analytics.ncsu.edu/sesug/2013/JMP-02.pdf

• Even carefully tracked diet and activity data has inaccuracies and gaps

that could contribute to incorrect conclusions if you don’t see them

• Exploring my personal data helped me discover

– reporting biases associated with my device usage

– strategies I am using to summarize and group data (e.g., recipe, food

categories) that might obscure the real trends

• Deeper statistical analyses of this data set must focus on subsets of

completely tracked days or adjust for variability in reporting compliance

to ensure that results are truly meaningful

Observations

References

Favorite Visualizations

Analysis of Personal Diet and Fitness Data With JMP®

Shannon Conners, PhD

JMP, SAS

• Weight trends during and after pregnancy

– Gained ~43 lbs in total, ~25 lbs was baby-related

– 9 months of “eating for 2” = 6 months weight loss work

– Used new JMP 12 feature to embed pre- and post-baby

pictures in my data table and display them in hover labels

• Food log composition by category

– Used new Treemap Squarify algorithm in to show which

food groups and items contributed the most calories

– Created bar charts by category calorie contribution

– Used Local Data Filter to explore meal by year trends

• Maintenance weight control chart

– Focused on past 2.5 years maintaining weight

– Calculated range was close to my preferred weight

– Used Control Chart Builder

Click any picture

to zoom

Page 4: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Return to poster

BodyMedia® web interface

Page 5: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Return to poster

Page 6: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Food Log Text File

Return to poster

Page 7: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Combined Activity Data

Return to poster

Page 8: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Combined Food Log Data Table

Return to poster

Page 9: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

JMP 12 RecodeRecode

Return to poster

Page 10: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Density plot of calories and meals

Return to poster

Page 11: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Seasonal Activity and Wear Pattern

Return to poster

Page 12: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Graph Builder

Return to poster

Page 13: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Weight, Deficit and Macronutrients

Return to poster

Page 14: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Year by Year Treemap

Combined Treemapwith Item Names

Treemap of Breakfast Items by Year

Return to poster

Page 15: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Food Log by Primary Category and Item

Graph Builder

Return to poster

Treemap of Breakfast Items by Year

Page 16: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Breakfast in 2011 and 2014

Where(Year = 2014 and Meal = Breakfast)Where(Year = 2011 and Meal = Breakfast)

Return to poster

Page 17: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Graph Builder

Year by Year ViewReturn to poster

Page 18: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Graph Builder

Return to poster

Page 19: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Graph Builder

Return to poster Food Trends in Early Pregnancy

Page 20: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Food Diversity in Early Pregnancy

Graph Builder

Return to poster

Page 21: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Control Chart Builder

Return to poster

Page 22: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Effect of Recipes on Categories

Return to posterMore views of recipe impact

Page 23: Shannon Conners, PhD JMP, SAS - Quantified Selfquantifiedself.com/docs/ShannonConnersPoster.pdf · Exploring Activity, Eating, and Sleep Patterns Analysis of Personal Diet and Fitness

Effect of Using Recipes on Food Logging

Return to poster

Early Pregnancy

Coffee Aversion

Decaf Salted Caramel Mocha Recipe

• Decaf espresso• Milk• Cocoa Powder• Toffee Nut syrup• Caramel sauce

Cocoa Powder• Used in

chocolate Greek yogurt before recipe creation

Chocolate Greek Yogurt Recipe Created• Yogurt (plain andvanilla coconut)• Cocoa Powder• SF caramel syrup• Caramel sauce

Greek yogurt• Used in

chocolate Greek yogurt before recipe creation