Journal Logo

SPECIAL COMMUNICATIONS: Methodological Advances

Differentiating Sitting and Lying Using a Thigh-Worn Accelerometer


Author Information
Medicine & Science in Sports & Exercise: April 2016 - Volume 48 - Issue 4 - p 742-747
doi: 10.1249/MSS.0000000000000804
  • Free


Wearable sensors are used to collect continuous physiologic and/or kinematic information for extended periods of time (e.g., days to weeks) in community-dwelling individuals. In physical activity and health research, these devices are typically used to estimate attributes of active behavior (e.g., energy expenditure, time in moderate-to-vigorous physical activity) (10,23). However, in light of emerging epidemiological, preclinical, and clinical research, recent emphasis has been placed on developing devices and data processing methodologies that can also estimate attributes of sedentary behavior (sitting and lying) (3,10). A single device that can estimate various features of both active and sedentary behaviors in community-dwelling individuals is necessary to understand how various components of habitual behavior interact to affect health and disease etiology.

The activPAL3™ (AP) (PAL Technologies Ltd, Glasgow, UK) is a thigh-worn accelerometer-based activity monitor that detects static (gravity) and dynamic accelerations of the x-axis to detect sedentary (sitting and lying), standing, and ambulatory events. Currently, the AP does not distinguish between sitting and lying events. However, because the AP is sensitive to acceleration from three orthogonal axes, it can also provide information about thigh rotation. During periods of lying, it is common for an individual to roll onto his/her side or stomach and such transitions in lying position alter the orientation of the sensor in the AP, which can be detected by changes in the acceleration signal from the y-axis. The y-axis is in the same plane but perpendicular to the long axis of the femur (see Fig. 1A). With these data, it may be possible to further differentiate sedentary behavior as either sitting or lying. Therefore, the purpose of this study was to develop and test a classification algorithm to differentiate sedentary events as sitting and lying using acceleration data collected from a single AP activity monitor worn on the thigh.

A, The direction of sensitivity of the x, y, and z axes of the accelerometer in the AP when the device is worn on the thigh and when the person is sitting or supine. B, Cross-section of the thigh depicting the thresholds of the rotational angle (±65°) of the y-axis that classify sedentary events as lying. Rotational angle of 0° indicates sitting/lying on the back when the y-axis is oriented in the plane of the horizon (i.e., acceleration = 0g). Rotational angles of ±90° indicates lying on the left or right sides when the y-axis is orthogonal to horizon (i.e., acceleration = 1g). a, acceleration.



Data used to develop and validate the classification algorithm were obtained from a larger cross-sectional study, which measured 7 d of objective physical activity and sedentary behavior, and self-reported waking times in healthy working adults. Participants were community-dwelling office employees from the Glasgow area of the United Kingdom age 18–65 yr. Fourteen participants were randomly selected for our study, which resulted in a total of 98 d and nights of data that were used to develop and validate the classification algorithm. The School of Health & Life Sciences Ethics Committee, Glasgow Caledonian University, granted ethical approval for the study, and written informed consent was obtained from participants.

Measurement of physical behavior

Physical behavior was measured using the AP worn on the midline of the thigh, midway between the hip and knee. The AP uses a digital triaxial acceleration sensor (ADXL345; Analog Devices, Norwood, MA; ±2g) to detect static and dynamic acceleration. The AP has excellent validity in differentiating among sitting/lying, standing, and stepping (13,15,19,21,25,26). Participants were given a waterproofed AP with instructions to wear it on their dominant thigh at all times for 7 d (including overnight and during water-based activities) using a double-sided hypoallergenic pad. Each night, participants used a diary to record the time they went to bed at night and the time they got up in the morning. Total time “lying in bed” for each overnight period was computed as the difference between these two time points. If the monitor was removed from the thigh, participants recorded the times when the monitor was not worn. Nonwear data were not included in the analyses.

Algorithm development

AP data were downloaded and postprocessed using AP Professional Research Software v7.2.29 (PAL Technologies). Both raw acceleration and event files were used in conjunction to develop the algorithm (14). The raw acceleration output file contains a digitized representation of the acceleration signal at an 8-bit resolution and a sampling rate of 20 Hz. The event file contains classifications of “sedentary,” “standing,” and “stepping” events. Three participants were randomly selected from the sample of 14 to develop the algorithm. The three participants in the development group had 7 d of continuous AP data each (21 d), complete diaries, and did not report removing the monitor at any time during the recording period.

Raw acceleration files were postprocessed using an algorithm developed in Matlab software (The MathWorks, Inc, Natick, MA). Briefly, each digitized sample of the raw acceleration signal from the AP was first converted to its equivalent g force value (16) using ADXL345 specifications released publicly by the manufacturer (2). This signal transformation translates to a linear scaling of the digital output within the ±2g dynamic range of the AP. The converted signal was low-pass filtered using a 20-s moving average digital filter to smooth the signal by eliminating random noise that disrupt the static acceleration signal. An inverse sine function was used on the filtered output to compute tilt angle of the y-axis in radians, which was subsequently converted to degrees to yield an angle between ±90°. Time series graphical outputs of the rotational angles in each axis were visually compared to corresponding periods of “lying in bed.” Several arbitrarily selected threshold angles were tested to determine the one that returned the maximum classifications of lying events (event file) during the lying-in-bed periods. A threshold of ±65° in the y-axis (where 0°, +90°, and −90° represented lying on one’s back and on the right and left sides, respectively) yielded the highest classification accuracy in the development data. We did not use information from either the x or z axes because it did not improve classification accuracy.

Each time the angle of rotation in the y-axis exceeded a threshold of ±65° (i.e., an angle equal to or between +65° and +90° and −65° and −90°), the algorithm recorded a crossing point value of “1.” When the signal subsequently fell below the threshold (i.e., an angle equal to or between: +64° and −64°), a crossing point value of “0” was recorded. Time-stamped occurrences of threshold crossings were compared with corresponding time-stamped information from the event file. Any sedentary event with at least one crossing point of both 0 and 1 was classified as lying. The start and end times for lying in bed were identified by the start and end times of the corresponding sedentary event (obtained from event file). Figure 1A illustrates the directions of sensitivity of the triaxial accelerometer within the AP when worn on the thigh in a sitting/supine position. Figure 1B depicts a cross-section of the thigh indicating the y-axis’s sensitivity to gravitational acceleration, the corresponding angles of rotation when lying supine and on either side, and the lying threshold angle of ±65°.

Algorithm validation

The remaining 11 participants (77 d of AP data) were used as an independent validation sample. The algorithm was applied to continuous AP data for the total duration of measurement to determine the accuracy of the algorithm to detect lying in bed and its sensitivity and specificity during both lying-in-bed and “out-of-bed” periods. Participants did not self-report their behaviors (e.g., lying vs nonlying) during out-of-bed periods, and thus all time out of bed was assumed to be nonlying.

Start and end times for self-reported lying in bed were obtained from diaries and were visually compared with event files showing the time sequence of events over the course of each 24-h period each to determine if there were any substantial errors in self-report. Before validating the algorithm, we “refined” the self-reported lying in bed start and end times using the event file in conjunction with the self-report diaries. This was done to minimize errors attributable to self-report bias (e.g., rounding off: self-reporting 10:30 p.m. instead of 10:22 p.m.). The following rules were used to refine the start times: 1) a duration of 15 min was considered as an acceptable error for self-reported lying in bed start and end times; 2) if the self-reported lying in bed start time was within an upright event, the start time of the next sedentary event was considered to be the refined lying in bed start time; 3) if the self-reported lying in bed start time was within a sedentary event but was more than 15 min before the next upright event then the start time of the sedentary event was used as the refined lying in bed start time, and 4) if the self-reported lying in bed start time was within a sedentary event but within 15 min of the next upright event, then the start of the subsequent sedentary event was considered as the refined lying in bed start time. The following rules were used to refine the end times: 1) if the self-reported lying in bed end time was within a sedentary event then the end of that sedentary event was used as the lying in bed end time, and 2) if the self-reported lying in bed end time was within an upright event then the end of the previous sedentary event was considered as the refined lying in bed end time.

Refined self-reported times were determined for each of the 77 d of data in the validation group and were compared with estimates obtained from our algorithm using prediction bias and precision (95% confidence interval). We also computed the sensitivity and specificity of the algorithm in correctly identifying time lying in bed. Sensitivity of the algorithm was defined as the ratio of the total time classified as lying in bed by our algorithm to the total self-reported lying-in-bed time. Specificity of the algorithm was defined as the ratio of the total time sedentary when not lying in bed that was not classified as lying by the algorithm to the total time sedentary when not lying in bed.


All data are presented as mean ± SD unless otherwise noted. Our sample consisted of three males and 11 females (age = 48 ± 9 yr; BMI = 26.6 ± 2.7 kg·m−2) who continuously wore the AP for an average of 120.8 ± 25.9 h. The mean time self-reported as lying and not lying was 53.6 ± 14.5 and 67.1 ± 11.4 h per recording period, respectively.

The duration of time in bed detected by our algorithm was similar to that reported previously using a combination of self-report and accelerometry (20). Figure 2 shows the total hours per recording period estimated as lying in comparison with self-reported lying for the development (nos. 1–3) and validation (nos. 4–14) participants. For the validation group, mean time estimated as lying by the algorithm was 50.9 ± 8.9 h, and mean self-reported lying time was 54.8 ± 10.4 h. This resulted in a small bias (95% confidence interval) of −3.9 (−0.63, 8.4 h), or 36.2 min per night. Additionally, when applied to 24 h of continuous data, the algorithm demonstrated high (≥90%) sensitivity (range, 76.4%–99.2%) and specificity (range, 87.6%–99.9%) in correctly classifying a sedentary event as lying (Fig. 3).

Total hours per recording period estimated as lying in comparison to self-reported lying for the development (participants 1–3) and validation (participants 4–14) groups.
Sensitivity and specificity of the algorithm to distinguish sedentary events as sitting or lying when applied to continuous 24-h data.

During self-reported lying time, the average length of sedentary events classified by the algorithm as lying was considerably longer (5.4 ± 2.1 h) than those classified as not lying (0.3 ± 0.3 h). However, during self-reported not lying time, the mean duration of sedentary events classified as lying and not lying were relatively short (0.9 ± 0.7 and 0.2 ± 0.1 h, respectively). During self-reported lying time, the lying threshold (±65°) was crossed approximately 5 to 17 times during sedentary events classified by the algorithm as lying. During self-reported not lying time, the lying threshold (±65°) was crossed approximately one to six times during sedentary events classified by the algorithm as lying.


Main Findings

Detecting lying in bed

This is the first study to demonstrate that acceleration data from a single sensor on the thigh can be used to accurately distinguish sedentary events as sitting or lying. The algorithm developed and validated in this study used the acceleration signal from the y-axis (medial–lateral plane) of a thigh-worn AP to determine rotation of the thigh. Using a threshold of ±65°, the algorithm correctly identified self-reported lying for 96.7% ± 2.8% of the time.

In general, we observed similar patterns across participants during the lying-in-bed periods. Lying-in-bed periods often comprised of few but long sedentary events, which resulted from the occurrence of short upright events in between. Occasionally, the short upright events were also separated by a short sedentary event. These patterns are consistent with what we would expect if an individual were to briefly wake up from sleep to get a drink of water or to use the bathroom. Thus, instances when the algorithm falsely classifies lying in bed as sitting could actually be brief sitting events that were not captured by the self-report diaries. Conversely, if an individual is in the lying posture, but does not rotate their thigh beyond the ±65° threshold (i.e., flat on their back) at any point during the sedentary event, the current algorithm will misclassify the event as sitting. However, most individuals typically change positions (back, side, or stomach) up to 45 times per night over an 8-h sleep period (17). More than 90% of these transitions occur with 10 to 15 min of each other, and it is very rare for a position to be held for more than 1 h (17). These lying patterns typically tend to be consistently repeated over several nights (17). Additionally, more sophisticated statistical modeling using features from the AP triaxial acceleration in combination with our lying threshold may reduce estimation errors.

Detecting lying out of bed

The algorithm developed in this study can also be used to detect lying during waking periods. Most studies currently use self-report to determine the duration of lying at night (18,25) and do not provide information on daytime lying/sleep, which may be considerably shorter than that at night and more interspersed during the day. Because of the inability of the current AP software to distinguish between sitting and lying, studies using the AP to objectively measure sedentary behavior mostly assume that sedentary behavior recorded during the day represents only sitting. This assumption may have additional implications on associations between sedentary behavior and health. The methodology developed in our study can be used to distinguish between diurnal sitting and lying behaviors.

We did not provide specific instructions to record lying time during the day. Thus, we calculated wake time as the period that was not reported as lying in bed and assumed that waking periods did not consist of any lying bouts. Therefore, a portion of the sedentary events registered by the AP as sitting may actually be lying. Additionally, most of the out-of-bed sedentary events classified as lying occurred in the evening, close to when the individual reported having gone to bed. This suggests that the individual may either have inaccurately reported the start of the in bed period or may have been lying on a couch or in bed before lying in bed to sleep.

Lying events (both in and out of bed) where the threshold is not breached at least once will be misclassified as sitting. Such instances are more likely to occur during short lying events compared with longer events. The longer an individual lies, the more opportunity there is for them to “adjust” their lying position and breach the threshold at least once during that event. Although lying-out-of-bed events are likely to be shorter than lying in bed, we do not anticipate that these events will be predominantly characterized as lying without position adjustment. Potential factors that contribute to minimizing such instances are the physiological responses to tissue compression and a greater sensitivity to these physiological responses due to wakefulness (or likelihood of less intense sleep). It is likely that an individual will respond much earlier to the onset of musculoskeletal discomfort when lying and awake as compared with when in deep sleep. Nonetheless, measurement error will occur occasionally; however it is likely to be marginal in the context of estimating lying time over a period of 24 h.

Practical Implications

Improving human behavior assessment

Research participants are often asked to wear activity monitors for 24 h·d−1, over multiple days in order to capture detailed estimates of habitual activity and sedentary behavior. Sedentary behavior is defined as sitting or lying while awake (27), and differentiating between waking and sleeping during 24-h monitoring is currently a methodological challenge in the assessment of sedentary behavior (10). Our method may allow for a clearer distinction between physical activity, sedentary behavior, and lying while asleep during such investigations and ultimately a better understanding of the dose–response relationship between these behaviors and health. Although lying is not synonymous with sleep, the algorithm developed in this study will provide valuable information that may prove useful to future methods aimed at estimating sleep.

Duration of sleep is suggested to be associated with chronic conditions including type II diabetes, respiratory disorders, cardiovascular disease, and obesity and morbidity and mortality (4,7,9,11,12). For example, chronic sleep deprivation may increase the risk for obesity by increasing fatigue leading to decreased physical activity and increased sedentary behavior and by activating neurohormonal pathways that increase appetite (e.g., leptin, ghrelin) and caloric intake (8,24,28). Thus, objectively measuring total lying time while asleep during surveillance and intervention research is essential to determine the relationship between daily habitual behavior and health. Accurate estimates of physical activity, sedentary behavior, and sleep durations will not only allow the quantification of the independent and synergistic effect of these behaviors on health, but may also provide valuable insight on tailoring interventions to target and modify these individual behaviors to optimize health outcomes.

Improving energy expenditure estimation

Accurate estimates of energy expenditure may be necessary to establish causal relationships between physical behaviors and health outcomes. The compendium of physical activities reports the energy requirements of sleeping, lying down, and sitting to be approximately 0.90, 1.0, and 1.30 METs, respectively (1). Given that an individual engages in lying and sitting for a major portion of the 24-h day (22), distinguishing between lying, sitting, and sleeping will help to further refine the estimation of daily energy expenditure.

Increasing feasibility of long-term monitoring

The accuracy of existing methods to distinguish lying from sitting increases with the number of sensors worn at multiple locations on the body. The Intelligent Device for Energy Expenditure and Activity monitor, which uses five acceleration sensors placed on different parts of the body can correctly classify lying with almost 100% accuracy in a laboratory setting (29), and similar findings have been reported with other multisensing devices (5). A recent study used two time-synchronized AP monitors, one on the thigh and the other on the torso, to detect the precise times when a person transitions from an upright or sitting position to the lying position (6). Drawbacks to the abovementioned multisensor methodologies are associated with the feasibility of long-term behavior monitoring in the free-living environment. Form factor and technical limitations including connecting cables, short battery life (3–15 h) to sustain wireless transmission, need for advanced computational resources, and physical discomfort increase both participant and researcher burden and thereby compromise wear time and data quality or loss. The high accuracy of our methodology in community-dwelling adults over a relatively long period using a single thigh-worn AP is a potential improvement over existing methods to distinguish among physical activity, lying, and sitting in the free-living environment.


The main limitation of this study is the use of self-report diaries to identify lying-in-bed periods and our assumptions that all sedentary events during lying-in-bed time correspond to lying, and all sedentary events during out-of-bed time correspond to sitting. This may result in misclassification of some of the algorithm estimated lying time, which may have compromised the sensitivity of our algorithm (e.g., subjects 4 and 10 in Fig. 3). We anticipate that validating the algorithm using a more robust criterion (e.g., direct observation) may provide a true representation of the accuracy of the algorithm to distinguish between sitting and lying for a 24-h duration. A second limitation is our small sample. However, despite the small training (N = 3) and validation (N = 11) groups, each participant was studied for seven continuous days, resulting in 2352 h of accelerometer data sampled at 20 Hz. Although our sample was predominantly female, we do not believe this limits the generalizability of the results. In general, men have different body shapes than women; however, we do not expect the method to be impacted significantly by gender so long as placement of the AP is standardized to the anterior portion of the thigh. The lying threshold is conservative and will account for minor discrepancies attributable to anthropometrics. Similarly, we do not believe the algorithm threshold is biased by behavioral characteristics unique to our sample; however, validation, in a more diverse sample, would be beneficial.


This proof of concept study demonstrates that accelerometer data from a commonly used activity monitor can be used to accurately distinguish between sitting and lying postures more than 96% of the time. Future work will use a more robust criterion and sophisticated modeling techniques to improve the current algorithm in a larger sample with varying anthropometric and demographic characteristics. Although we examined the use of dual and triaxial signals in detecting lying in our sample and found no improvement in classification accuracy, future work could explore this further in a larger and diverse sample. Although sensor response characteristics may yield subtle yet inconsequential differences between the lying thresholds when using dual or triaxial acceleration, there will be a greater demand for computational resources to process multiaxial signals which may impact analyses efficiency. We anticipate that the concepts developed and tested in the current study will inform the development of new methods to estimate detailed features of sleep from wearable accelerometers.

The authors would like to thank all participants who volunteered to participate in this study. Current addresses and affiliations: Kate Lyden is now a Biomedical Research Associate at Misfit, Inc (Burlingame, CA).

The results of the present study do not constitute endorsement by ACSM. Malcolm Granat is a coinventor of the activPAL and director of PAL Technologies Ltd that manufactures the activPAL devices used in this study. No funding was provided to this study by PAL Technologies Ltd. The remaining authors declare no competing interests.


1. Ainsworth BE, Haskell WL, Herrmann SD, et al. 2011 Compendium of physical activities: a second update of codes and MET values. Med Sci Sports Exerc. 2011; 43(8): 1575–81.
2. Analog Devices Web site [Internet]. Analog Devices; (cited 2015 Oct 17) Available from:—product-overview.
3. Atkin AJ, Gorely T, Clemes SA, et al. Methods of Measurement in epidemiology: sedentary behaviour. Int J Epidemiol. 2012; 41(5): 1460–71.
4. Ayas NT, White DP, Al-Delaimy WK, et al. A prospective study of self-reported sleep duration and incident diabetes in women. Diabetes Care. 2003; 26(2): 380–4.
5. Bao L, Intille SS. Activity recognition from user-annotated acceleration data. In. Pervasive Computing. Springer; 2004, pp. 1–17.
6. Bassett DR Jr, John D, Conger SA, Rider BC, Passmore RM, Clark JM. Detection of lying down, sitting, standing, and stepping using two activPAL monitors. Med Sci Sports Exerc. 2014; 46(10): 2025–9.
7. Cizza G, Skarulis M, Mignot E. A link between short sleep and obesity: building the evidence for causation. Sleep. 2005; 28(10): 1217–20.
8. Dinges DF, Pack F, Williams K, et al. Cumulative sleepiness, mood disturbance, and psychomotor vigilance performance decrements during a week of sleep restricted to 4–5 hours per night. Sleep. 1997; 20(4): 267–77.
9. Ferrie JE, Shipley MJ, Cappuccio FP, et al. A prospective study of change in sleep duration: associations with mortality in the Whitehall II cohort. Sleep. 2007; 30(12): 1659–66.
10. Freedson P, Bowles HR, Troiano R, Haskell W. Assessment of physical activity using wearable monitors: recommendations for monitor calibration and use in the field. Med Sci Sports Exerc. 2012; 44(1 Suppl 1): S1–4.
11. Gangwisch JE, Heymsfield SB, Boden-Albala B, et al. Short sleep duration as a risk factor for hypertension: analyses of the first National Health and Nutrition Examination Survey. Hypertension. 2006; 47(5): 833–9.
12. Gangwisch JE, Malaspina D, Babiss LA, et al. Short sleep duration as a risk factor for hypercholesterolemia: analyses of the National Longitudinal Study of Adolescent Health. Sleep. 2010; 33(7): 956–61.
13. Godfrey A, Culhane KM, Lyons GM. Comparison of the performance of the activPAL Professional physical activity logger to a discrete accelerometer-based activity monitor. Med Eng Phys. 2007; 29(8): 930–4.
14. Granat MH. Event-based analysis of free-living behaviour. Physiol Meas. 2012; 33(11): 1785.
15. Grant PM, Ryan CG, Tigbe WW, Granat MH. The validation of a novel activity monitor in the measurement of posture and motion during everyday activities. Br J Sports Med. 2006; 40(12): 992–7.
16. John D, Freedson P. ActiGraph and Actical physical activity monitors: a peek under the hood. Med Sci Sports Exerc. 2012; 44(1 Suppl 1): S86–9.
17. Johnson H, Swan T, Weigand G. In what positions do healthy people sleep? JAMA. 1930; 94(26): 2058–62.
18. Knutson KL, Lauderdale DS. Sociodemographic and behavioral predictors of bed time and wake time among US adolescents aged 15 to 17 years. J Pediatr. 2009; 154(3): 426–30.
19. Kozey-Keadle S, Libertine A, Lyden K, Staudenmayer J, Freedson PS. Validation of wearable monitors for assessing sedentary behavior. Med Sci Sports Exerc. 2011; 43(8): 1561–7.
20. Lauderdale DS, Knutson KL, Yan LL, et al. Objectively measured sleep characteristics among early-middle-aged adults: the CARDIA study. Am J Epidemiol. 2006; 164(1): 5–16.
21. Lyden K, Kozey Keadle SL, Staudenmayer JW, Freedson PS. Validity of two wearable monitors to estimate breaks from sedentary time. Med Sci Sports Exerc. 2012; 44(11): 2243–52.
22. Matthews CE, Chen KY, Freedson PS, et al. Amount of time spent in sedentary behaviors in the United States, 2003–2004. Am J Epidemiol. 2008; 167(7): 875–81.
23. Matthews CE, Hagstromer M, Pober DM, Bowles HR. Best practices for using physical activity monitors in population-based research. Med Sci Sports Exerc. 2012; 44(1 Suppl 1): S68–76.
24. Patel SR, Malhotra A, White DP, Gottlieb DJ, Hu FB. Association between reduced sleep and weight gain in women. Am J Epidemiol. 2006; 164(10): 947–54.
25. Reynolds CF 3rd, Serody L, Okun ML, et al. Protecting sleep, promoting health in later life: a randomized clinical trial. Psychosom Med. 2010; 72(2): 178–86.
26. Ryan CG, Grant PM, Tigbe WW, Granat MH. The validity and reliability of a novel activity monitor as a measure of walking. Br J Sports Med. 2006; 40(9): 779–84.
27. Sedentary Behavior Research Network. Letter to the editor: standardized use of the terms “sedentary” and “sedentary behaviours.” Appl Physiol Nutr Metab. 2012; 37(3): 540.
28. Spiegel K, Tasali E, Penev P, Van Cauter E. Brief communication: Sleep curtailment in healthy young men is associated with decreased leptin levels, elevated ghrelin levels, and increased hunger and appetite. Ann Intern Med. 2004; 141(11): 846–50.
29. Zhang K, Werner P, Sun M, Pi-Sunyer FX, Boozer CN. Measurement of human daily physical activity. Obes Res. 2003; 11(1): 33–40.


© 2016 American College of Sports Medicine