Raw Accelerometer Data Analysis with GGIR R-package: Does... : Medicine & Science in Sports & Exercise (original) (raw)

Wrist-worn accelerometry-based activity monitors are increasingly being used to assess physical activity in large population surveys (e.g., the U.S. National Health and Nutrition Examination Survey [10]) and very large cohorts (e.g., UK Biobank). The wrist-worn devices contain a triaxial microelectromechanical accelerometer, which continuously samples and records raw accelerations at up to 100 Hz. Two commercially available research-grade wrist-worn accelerometers that are widely used globally are the GENEActiv and the ActiGraph (5,10,18,21).

The availability of raw acceleration data instead of proprietary counts should facilitate the interpretation of findings from studies using different brands of accelerometer. Accumulating evidence suggests that data from the frequency domain (i.e., underlying frequencies or repeating patterns [14,15]) and on the orientation of the monitor (determined from the orientation of the gravity component of acceleration [7,16,17]) are near equivalent between the GENEActiv and the ActiGraph. However, although highly correlated, the magnitude of accelerations measured by the GENEActiv appear to be greater than those measured by the ActiGraph (14,15). These differences are primarily evident at very low accelerations, e.g., during sitting and standing (unpublished data from our laboratory). The extent to which these differences may affect different outcome measures of habitual physical activity is not clear.

The open source package GGIR (18,19,20) enables the processing and analyzing of raw accelerometer signals in R (http://cran.r-project.org). The signal processing includes automatic calibration, detection of sustained abnormally high values, detection of nonwear, and calculation of the average magnitude of dynamic acceleration (Euclidean norm minus one [ENMO]). A range of outcome variables to describe activity profile, moderate-to-vigorous physical activity (MVPA), and sleep are also calculated. Critically, both GENEActiv and ActiGraph raw data can be processed and analyzed, ensuring identical standardized treatment of data from both monitors. The autocalibration is an important step as the ENMO statistic is vulnerable to calibration error because of the inherent assumption that gravity is measured as 1_g_ (18).

GGIR is freely available and is being used in studies with GENEActiv data (5) and with ActiGraph data (9). Knowledge of the agreement between outcomes from the two brands will inform the extent to which each outcome can be considered comparable between studies using GENEActiv and studies using ActiGraph. Therefore, the aim of this study was to determine the agreement between outputs from contemporaneous measures of acceleration from wrist-worn GENEActiv and ActiGraph accelerometers when processed using GGIR. Outputs included measures of acceleration and derived variables, i.e., wear time, sleep time, and MVPA.

We hypothesized the following:

  1. The magnitude of accelerations recorded by the GENEActiv would be higher than that recorded by the ActiGraph.
  2. Agreement between the accelerometer brands would be weakest at very low accelerations and strongest at midrange to high accelerations.
  3. Derived variables based on monitor orientation (e.g., sleep) and variability in acceleration (e.g., wear time) would have high agreement.
  4. The classification of participants as meeting MVPA and sleep guidelines would be similar between brands.

METHODS

Participants

A convenience sample of 34 adult participants was recruited from Loughborough University and University of Leicester (staff and students) via e-mail and word of mouth. All participants provided written informed consent, and the study was approved by the Ethics Committee of Loughborough University. Data were collected between March 2014 and August 2014.

Each participant was fitted with a GENEActiv and an ActiGraph GT3X+ on their nondominant wrist; the monitors were adjacent with the GENEActiv distal to the ActiGraph. Participants were requested to wear all monitors continuously for 2 d to ensure one complete 24-h day and one complete nocturnal sleep were captured. Participants completed a logbook recording whether they wore the monitors to bed.

Measures and Data Processing

Accelerometers

The GENEActiv is a triaxial accelerometry-based activity monitor with a dynamic range of ±8_g_, where g is equal to the earth’s gravitational pull (Gravity Estimator of Normal Everyday Activity; ActivInsights Ltd., Cambridgeshire, UK). The ActiGraph GT3X+ is a triaxial accelerometry-based activity monitor with a dynamic range of ±6_g_ (ActiGraph LLC, Pensacola, FL). There is no consensus on the optimal sampling frequency to use when collecting raw accelerometer data. Previous studies have used sampling frequencies of 80 Hz (ActiGraph [10]), 85.7 Hz (GENEActiv [5,21]), and 100 Hz (Both GENEActiv and ActiGraph [9]). To match sampling frequency between the two monitors, both were configured to collect data at 100 Hz. GENEActiv data were downloaded using GENEActiv PC software version 2.2 and saved in raw format as binary files. ActiGraph data were downloaded using ActiLife version 6.11.4, saved in raw format as .gt3x files, and converted to .csv format for data processing.

Data processing and analysis

GENEActiv .bin files and ActiGraph .csv files were analyzed with R-package GGIR version 1.2-0 (http://cran.r-project.org) (18,19). Signal processing in GGIR includes the following steps: 1) autocalibration using local gravity as a reference (18), 2) detection of sustained abnormally high values, 3) detection of nonwear, and 4) calculation of the average magnitude of dynamic acceleration, i.e., the vector magnitude of acceleration corrected for gravity (Euclidean norm minus 1_g_) for 5-s epochs:

with negative values rounded up to zero.

Files were excluded from all analyses if the postcalibration error was greater than 0.02_g_ (5) or fewer than 16 h of wear time was recorded by either monitor during the 24-h day of interest. Participants were excluded from the sleep analyses if the participant recorded not wearing either monitor at night or visual examination of plots suggested one or both monitors were not worn at night.

The detection of nonwear has been described in detail previously [see “Procedure for Nonwear Detection” in the Supplementary document to van Hees et al. (19)]. Nonwear is estimated based on the standard deviation and value range of each axis, calculated for 60-min windows with 15-min moving increments. If the SD is less than 13 mgal or the value range is less than 50 m_g_ for at least two of the three axes, the time window is classified as nonwear.

The average magnitude of dynamic wrist acceleration (ENMO), the time accumulated in MVPA, the time and magnitude of the least (L5_h, L5_m_g_) and most active (M5_h, M5_m_g_) 5 h, and the time spent in 10-min bouts of MVPA (MVPA10min) were calculated for the entire 24-h day. MVPA was calculated using an acceleration threshold of 100 mgal (5); this is close to the MVPA device-specific thresholds (12) for the GENEActiv (93.2 m_g_) and the ActiGraph (100.6 m_g_). Bouts were identified as 10 min of consecutive 5-s epochs where 80% of epochs were equal to, or higher than, the 100 m_g_ threshold. To enable a detailed examination of the monitors across the spectrum of acceleration magnitudes, the distribution of time spent across acceleration levels in a 40-m_g_ resolution (0–40, 40–80, …, >400 m_g_) as previously reported (5) and the percentile distribution (5th, 10th, 25th, 50th, 75th, 95th, and 97th) of acceleration values were calculated from daytime data (7:00 a.m.–11:00 p.m.).

Van Hees et al. (21) recently developed and validated a nocturnal sleep detection algorithm that they subsequently incorporated into the latest version of GGIR (version 1.2-0). In brief, periods of sustained inactivity, defined as no changes in arm angle greater than 5° for 5 min or more during a predefined nocturnal sleep window, e.g., from a participant sleep log, are classified as sleep.

The time window used for sleep parameters (window during which sustained inactivity assumed to represent sleep) was 11:00 p.m.–7:00 a.m. A visual examination of the data confirmed that this was a reasonable approximation for nocturnal sleep in this data set, with only four participants appearing to sleep beyond this window. As the purpose of this study was to compare two brands undergoing identical processing, it was deemed acceptable not to determine individual sleep and wake times. Variables automatically extracted were time in bed (time between sleep onset and waking time determined from accelerometer data) and sleep duration (total sleep duration determined from accelerometer data excluding detected waking episodes during the night).

Statistical analyses

Descriptive statistics (mean ± SD) were calculated for all outputs. Paired _t_-tests (two-tailed) with sequential Bonferroni corrections were completed to account for multiple comparisons (1). The level of agreement between outputs from the two accelerometer brands was determined using intraclass correlation coefficients (ICC, single measures, absolute agreement) with 95% confidence intervals (CI) and limits of agreement (LOA) (3). The number of participants who met MVPA guidelines (6,22) and recently developed sleep guidelines (13) was determined for data from both monitors. Percent classification agreement and kappa were calculated.

Physical activity guidelines recommend adults accumulate 150 min MVPA per week, accumulated in 10-min bouts (6,22); for the purposes of this study, the guidelines were interpreted as 30 min MVPA per day in bouts ≥10 min. The sleep guidelines classify sleep duration as follows: low, not recommended (<6 h); low, but may be appropriate (6–<7 h); recommended (7–<9 h); high, but may be appropriate (9–<10 h); and high, not recommended (>10 h) (13).

Analyses were conducted in IBM SPSS Statistics version 22.0. Alpha was set at 0.05.

RESULTS

No data files were excluded based on calibration error. Nine of the 34 participants were excluded as both monitor brands recorded fewer than 16 h of wear time during the 24-h day of interest, giving an N of 25 (16 females and 9 males) for the physical activity analyses (age = 28.2 ± 5.8 yr, height = 1.69 ± 0.10 m, mass = 69.4 ± 14.4 kg). Five participants did not wear the monitor at night, leaving an N of 20 (13 females and 7 males) for the sleep analyses (age = 28.6 ± 6.0 yr, height = 1.69 ± 0.10 m, mass = 68.2 ± 12.8 kg). Demographics did not differ between included and excluded participants for the physical activity analyses or the sleep analyses. ENMO, the distribution of time spent across acceleration levels, and the percentile distribution are presented in Figures 1, 2, and 3, respectively. The remaining output variables are presented in Table 1.

T1-10

TABLE 1:

Summary GGIR outcome variables from acceleration measured at the wrist by the GENEActiv and the ActiGraph (mean ± SD).

F1-10

FIGURE 1:

Average magnitude of dynamic wrist acceleration (ENMO) measured by the GENEActiv and the ActiGraph.

F2-10

FIGURE 2:

Acceleration distribution of time spent in 40 m_g_ categories (intensity) measured by the GENEActiv and the ActiGraph (7:00 a.m.–11:00 p.m.). Note, for clarity, the natural log of time in minutes is plotted on the y axis. *P < 0.05 after sequential Bonferroni correction.

F3-10

FIGURE 3:

Percentile distribution of acceleration values measured by the GENEActiv and the ActiGraph (7:00 a.m.–11:00 p.m.). Note, for clarity, the natural log of acceleration in m_g_ is plotted on the y axis. *P < 0.05 after sequential Bonferroni correction.

Values for ENMO and the magnitude of the least active 5 h were significantly greater for the GENEActiv (Fig. 1, Table 1). Correspondingly, the number of minutes recorded between 0 and 40 m_g_ was significantly greater for the ActiGraph, the number of minutes recorded between 40 and 80 m_g_ was significantly greater for the GENEActiv (Fig. 2), and the magnitudes of acceleration at the 5th–75th percentile of the distribution were significantly greater for the GENEActiv (Fig. 3). There were no further significant differences; notably, there were no differences between brands for the derived variables: wear time, MVPA, and sleep.

Agreement between accelerometer brands was strong for the majority of outcomes (ICC ≥ 0.93), including wear time, ENMO, MVPA, sleep, the distribution of time across acceleration levels, and magnitudes of acceleration ≥75th percentile (Table 2). However, the 95% CI spanned zero for the magnitude of acceleration at the 25th and 50th percentile of the distribution (ICC = 0.415 and 0.823, respectively). There was no agreement between accelerometer brands for the magnitude of the acceleration for the least active 5 h and the acceleration at the 5th and 10th percentiles of the distribution. Overall, mean biases were low but positive, indicating a tendency for higher magnitudes of acceleration (or fewer minutes accumulated in the lowest band of acceleration) recorded by the GENEActiv, with small to moderate LOA.

T2-10

TABLE 2:

Agreement between the wrist-worn GENEActiv and the ActiGraph for GGIR outcome variables.

The Bland and Altman plots for total MVPA and MVPA in 10-min bouts are shown in Figures 4A and 4B, respectively. Notably, the mean bias was low (0.2 min) for MVPA when considered in bouts of 10 min (Fig. 4C). There was 100% agreement (kappa = 1.0, P < 0.001) between brands for the classification of people as meeting the guidelines of accumulating 30 min MVPA in 10-min bouts of MVPA10min (n = 7/25).

F4-10

FIGURE 4:

Mean bias (solid line) and 95% LOA (dashed lines) for the GENEActiv and the ActiGraph for (A) total time accumulated in moderate-to-vigorous physical activity (MVPA). (B) MVPA accumulated in 10-min bouts. Note: n = 25 for both plots; 13 participants scored 0 for 10-min bouts of MVPA resulting in one data point at (0,0) representing 13 participants.

There was 95% agreement for the classification of sleep duration (19/20 participants, kappa = 0.93, P < 0.001). The misclassified participant scored 9.05 h (high, but may be appropriate) with the GENEActiv and 8.88 h (recommended) with the ActiGraph.

DISCUSSION

GGIR is an open source package that processes and analyses the raw acceleration data from two of the most widely deployed research-grade accelerometers: the GENEActiv and the ActiGraph. This study shows that the majority of the outcome variables from GGIR have a high agreement between the accelerometer brands. Key outcome variables of MVPA, sleep, wear time, and the distribution of time across acceleration levels were comparable. However, differences between the accelerometer brands were evident for ENMO (the measure indicative of overall activity) and the time spent in acceleration ranges indicative of sedentary to light activity.

The strong agreement evident between the brands for the derived variables that rely on monitor orientation (i.e., sleep) and variability (i.e., wear time) was hypothesized and is consistent with previous research (7,14,16,17). MVPA also compared very well, with high levels of agreement between brands. The LOA were fairly wide for total MVPA but narrow for MVPA accumulated in 10-min bouts. Clearly, agreement between brands is stronger when considering activity accumulated in bouts; this is important as MVPA accumulated in bouts is recommended in adult physical activity guidelines (6,22) and the key outcome used in surveillance studies (e.g., National Health and Nutrition Examination Survey). There was 100% agreement for meeting guidelines of accumulating 30 min of MVPA in 10-min bouts. Similarly, there was excellent agreement for assessment of meeting sleep recommendations (13).

ENMO, the average magnitude of dynamic acceleration, was greater when measured by the GENEActiv than when measured by the ActiGraph. This is as hypothesized and is consistent with previous research reporting the magnitudes of accelerations recorded by the GENEActiv are greater than those recorded by the ActiGraph (14,15). ENMO was around 7% higher for the GENEActiv than the ActiGraph; this is smaller than the 12%–13% difference between these brands reported for the average of the high-pass filtered total acceleration measured at the hip in 58 children, age 10–12 yr (15). The smaller differences found in the current study may be related to the signal-processing steps in GGIR, which include autocalibration, correction of the signal for gravity, and detection of sustained abnormally high values.

The acceleration signal contains acceleration due to the earth’s gravitational field and due to movement. To quantify physical activity, it is necessary to attempt to remove the gravitational component from the signal. ENMO, the metric used in the current study, does this by subtracting one gravitational unit from the Euclidean norm (vector magnitude) of the three raw signals (19). An assumption inherent in this metric is that gravity is measured as 1_g_; thus, if the acceleration sensors are not accurately calibrated, the ENMO metric will be biased (19). To deal with this vulnerability of the ENMO, metric GGIR contains an autocalibrate function. Data are extracted from periods of nonmovement within the free-living accelerometer data; as there is no movement during these periods, the vector magnitude of the acceleration should be equal to gravity (1_g_). This property enables calibration correction factors to be derived and applied to the data (18). The calibration of the data against the device-specific measured gravitational component may help account for any differences between the brands in measurement of the gravity component of the signal.

In the current study, the GENEActiv recorded greater magnitudes of low accelerations, and hence the time spent in the two lowest acceleration bands differed between brands. This would affect estimates of the time spent inactive or sedentary, if derived from acceleration magnitudes. Field-based research suggests that the 100 counts per minute cut point commonly used to determine sedentary time from ActiGraph counts (11) equates to an acceleration threshold of around 50 m_g_ (unpublished data), supporting laboratory-based estimates (8). Daytime estimates of the time spent between 0 and 40 m_g_ were approximately 12 min higher for the ActiGraph than the GENEActiv; this reduces to approximately 9 min if time spent between 0 and 50 m_g_ is considered (ActiGraph = 781 ± 68, GENEActiv = 772 ± 68, P = 0.001, data not shown). As this represents only approximately 1.2% of the total daytime spent less than 50 m_g_, this difference may have limited effect on estimates of inactive or sedentary time. However, the significant difference in ENMO appears to be largely attributable to differences between brands in the time recorded at these low magnitudes of acceleration. As, for most people, the majority of the day is spent in these low acceleration ranges (5), this difference may be meaningful. For example, light walking elicits an acceleration of approximately 75 m_g_ (12); therefore, 30 min of light walking could increase overall 24 h acceleration (ENMO) by 1.6 m_g_ (75 m_g_/(24 h/0.5 h)). This is lower than the bias between the two brands, indicating that the comparison of overall activity level (ENMO) between brands would likely not be a reliable indicator of differences in light activity and sedentary patterns. Therefore, caution is advised when comparing the absolute values of the ENMO metric between brands. Notably, the ICC values for ENMO (and the majority of output variables) were high, indicating that the ranking of individuals for activity level would be comparable between monitors and the direct comparison of the ENMO metric between monitors may be facilitated by application of an affine conversion, as previously suggested (15).

Differences between the magnitudes of accelerations may relate to technical differences between the brands, including the microelectromechanical sensors used, their dynamic ranges, the reference voltage, and the analog-to-digital conversion rate (14,15). In particular, it appears there is some onboard processing of the raw accelerometer data in the ActiGraph device, but the details are proprietary (4,14).

Sedentary time is defined as sitting or reclining and low energy expenditure during waking hours (2). The time spent at low levels of acceleration or below count thresholds can only measure inactivity, not the posture of sitting or reclining specifically. We have previously shown how the gravitational component of the triaxial acceleration signal when a person is inactive can be exploited to determine the orientation of the monitor, and hence wrist position, from which the most likely posture can be estimated (16,17). The approach is equally valid with data from both the GENEActiv and the ActiGraph accelerometers (17). The use of the sedentary sphere approach to estimate sedentary time would avoid the problems associated with using inactivity to infer sedentary time (2) and the differences evident between the brands at low accelerations.

Strengths of this study include the assessment of a full 24-h day and complete nocturnal sleep and identical automated processing and analysis of the data from both accelerometer brands. The use of two of the most widely used research-grade accelerometers and GGIR, a freely available package that runs in the open source software, R, to process the data and derive the activity profile and sleep duration means the results are widely applicable. The study is limited by the relatively small, homogenous sample and 2-d data collection period; in particular, the effect of the discrepancies at low acceleration levels may have more effect on a very low active population. Further, a longer data collection period would likely have covered a greater variety of physical activity and sedentary behavior patterns, which may have enabled a more rigorous test of the GGIR output between monitors. There was also a relatively high rate of exclusion for insufficient wear time, which may affect the generalizability of the results. The current version of GGIR (1.2-0) has been tested with data from GENEActiv and ActiGraph accelerometers. Future research should also consider data from the Axivity triaxial accelerometer, as deployed in UK Biobank, with data collected in nearly 100,000 participants to date.

In conclusion, there was a very high agreement between the derived outcomes (wear time, MVPA, and sleep) between accelerometer brands. The bias between brands for MVPA accumulated in 10-min bouts was negligible with 95% LOA less than 2 min. Time spent across acceleration levels compared well, except for low accelerations (<40–50 m_g_). Some caution is advised when comparing the magnitude of overall activity level (ENMO) between brands, but the ranking of individuals by activity level showed a high consistency between brands.

This research was supported by the National Institute for Health Research (NIHR) Diet, Lifestyle and Physical Activity Biomedical Research Unit based at University Hospitals of Leicester and Loughborough University, the National Institute for Health Research Collaboration for Leadership in Applied Health Research and Care–East Midlands (NIHR CLAHRC–EM), and the Leicester Clinical Trials Unit. The views expressed are those of the authors and not necessarily those of the NHS, the NIHR, or the Department of Health. The results of the present study do not constitute endorsement by the authors or the American College of Sports Medicine of the products described in this article.

REFERENCES

1. Aickin M, Gensler H. Adjusting for multiple testing when reporting research results: the Bonferroni vs Holm methods. Am J Public Health. 1996;86:726–8.

2. Barnes J, Behrens TK, Benden ME, et al. Sedentary Behavior Research Network. Letter to the editor: standardized use of the terms “sedentary” and “sedentary behaviours.” Appl Physiol Nutr Metab. 2012;37:540–2.

3. Bland JM, Altman GA. Statistical methods for assessing agreement between two methods of clinical measurement. Lancet. 1986;1(8476):307–10.

4. Brønd JC, Arvidsson D. Sampling frequency affects the processing of ActiGraph raw acceleration data to activity counts. J Appl Physiol. 2016;120(3):362–9.

5. da Silva ICM, van Hees VT, Ramires VV, et al. Physical activity levels in three Brazilian birth cohorts as assessed with raw triaxial wrist accelerometry. Int J Epidemiol. 2014;43(6):1959–68.

6. Department of Health. Physical Activity Guidelines in the UK: Review and Recommendations. 2011. https://www.gov.uk/government/publications/uk-physical-activity-guidelines. Accessed: 25 January 2016.

7. Edwardson CL, Rowlands AV, Bunnewell S, et al. Accuracy of posture allocation algorithms for thigh and waist-worn accelerometers. Med Sci Sports Exerc. 2016;48(6):1085–90.

8. Esliger DW, Rowlands AV, Hurst TL, Catt M, Murray P, Eston RG. Validation of the GENEA accelerometer. Med Sci Sports Exerc. 2011;43(6):1085–93.

9. Fairclough SJ, Noonan R, Rowlands AV, van Hees V, Knowles Z, Boddy LM. Wear compliance and activity in children wearing wrist and hip mounted accelerometers. Med Sci Sports Exerc. 2016;48(2):243–53.

10. Freedson PS, John D. Comment on “Estimating activity and sedentary behaviour from an accelerometer on the hip and wrist.” Med Sci Sports Exerc. 2013;45(5):962–3.

11. Healy GN, Dunstan DW, Salmon J, Cerin E, Shaw JE, Zimmet PZ, et al. Breaks in sedentary time: beneficial associations with metabolic risk. Diabetes Care. 2008;31:661–6.

12. Hildebrand M, Van Hees VT, Hansen BH, Ekelund U. Age-group comparability of raw accelerometer output from wrist- and hip-worn monitors. Med Sci Sports Exerc. 2014;46(9):1816–24.

13. Hirshkowitz M, Whiton K, Albert SM. National Sleep Foundation’s sleep time duration recommendations: methodology and results summary. Sleep Health. 2015;1(1):40–3.

14. John D, Sasaki J, Staudenmayer J, Mavilia M, Freedson PS. Comparison of raw acceleration from the GENEA and ActiGraphTM GT3X+ activity monitors. Sensors. 2013;13:14754–63.

15. Rowlands AV, Fraysse F, Catt M, et al. Comparison of measured acceleration output from accelerometry-based activity monitors. Med Sci Sports Exerc. 2015;47(1):201–10.

16. Rowlands AV, Olds TS, Hillsdon M, et al. Assessing sedentary behaviour with the GENEActiv: introducing the sedentary sphere. Med Sci Sports Exerc. 2014;46(6):1235–47.

17. Rowlands AV, Yates T, Olds TS, Davies M, Khunti K, Edwardson CE. Sedentary sphere: wrist-worn accelerometer-brand independent posture classification. Med Sci Sports Exerc. 2016;48(4):748–54.

18. van Hees VT, Fang Z, Langford J, et al. Auto-calibration of accelerometer data for free-living physical activity assessment using local gravity and temperature: an evaluation on four continents. J Appl Physiol. 2014;117(7):738–44.

19. van Hees VT, Gorzelniak L, Dean León EC, et al. Separating movement and gravity components in an acceleration signal and implications for the assessment of human daily physical activity. PLoS One. 2013;8(4):e61691.

20. van Hees VT, Renstrőm F, Wright A, et al. Estimation of daily energy expenditure in pregnant and non-pregnant women using a wrist-worn tri-axial accelerometer. PLoS One. 2011;6(7):e22922.

21. van Hees VT, Sabia S, Anderson KN, et al. A novel, open access method to assess sleep duration using a wrist-worn accelerometer. PLoS One. 2015;10(11):e0142533.

22. World Health Organisation. Global Recommendations on Physical Activity for Health. 2010. http://whqlibdoc.who.int/publications/2010/9789241599979_eng.pdf. Accessed: 25 January 2016.

Keywords:

GENEActiv; ActiGraph; WRIST-WORN; SLEEP; OPEN SOURCE

© 2016 American College of Sports Medicine