The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

English

Overview

chms provides tools for cleaning and summarizing accelerometer data consistent with methods applied to cycle 7 of the Canadian Health Measures Survey (CHMS):

chms requires:

By default, chms:

Age (years) Epoch level (seconds) SB cut-point (counts) LPA cut-point (counts) MPA cut-point (counts) VPA cut-point (counts)
3-4 15 0-24Evenson 25-419Pate 420+Pate
5-17 15 0-24Evenson 25-573Evenson 574-1,002Evenson 1,003+Evenson
18-64 60 0-99Troiano 100-2,019Troiano 2,020-5,998Troiano 5,999+Troiano
65+ 60 0-99Troiano 100-2,019Troiano 2,020-5,998Troiano 5,999+Troiano

SB: sedentary behaviour; LPA: light-intensity physical activity; MPA: moderate-intensity physical activity; VPA: vigorous-intensity physical activity.

For more details on the methods used in the chms R package, see Clarke J, Gribbon A, St-Laurent M, Ferrao T, Barnes J, Kuzik N, Colley R. Comparison of physical activity and sedentary time measured with the ActiGraph GT3X-BT and Actical accelerometers. Health Rep. 2026 Feb 18;37(2):3-15. doi: 10.25318/82-003-x202600200001-eng. PMID: 41730515.

Installation

remotes::install_git(
  url = "https://github.com/statcan/chms",
  force = TRUE,
  upgrade = "never"
)

Usage

# Load dependencies into current R session
library(chms)
library(dplyr)
# Create participant meta (external/non-statcan users)
meta <- tibble(
  id = c("jane-canuck", "john-canuck"),
  age = c(10, 40),
  agd_lfe = c(
    system.file("extdata", "jane-canuck-lfe.agd", package = "chms"),
    system.file("extdata", "john-canuck-lfe.agd", package = "chms")
  ),
  agd_nml = c(
    system.file("extdata", "jane-canuck-nml.agd", package = "chms"),
    system.file("extdata", "john-canuck-nml.agd", package = "chms")
  ),
  start_date = c("2021-05-30", "2021-05-27"),
  epoch_length = c(15, 60)
)

# Print/examine
glimpse(meta)
#> Rows: 2
#> Columns: 6
#> $ id           <chr> "jane-canuck", "john-canuck"
#> $ age          <dbl> 10, 40
#> $ agd_lfe      <chr> "C:/Users/Clippy/AppData/Local/R/win-library/4.4/chms/ex…
#> $ agd_nml      <chr> "C:/Users/Clippy/AppData/Local/R/win-library/4.4/chms/ex…
#> $ start_date   <chr> "2021-05-30", "2021-05-27"
#> $ epoch_length <dbl> 15, 60
# Create participant meta (statcan users)
meta <- get_chms_meta(
  clinic_file = "path/to/clinic/file.sas7bdat",
  agd_dir = "path/to/agd/files/site",
  clinic_id = "CLINICID",
  site = "SITE",
  age = "CLC_AGE",
  day = "V2_DAY",
  month = "V2_MTH",
  year = "V2_YEAR"
)
# Initialize agd R6 class
agd_data <- agd$new(
  id = meta$id,
  age = meta$age,
  agd_lfe = meta$agd_lfe,
  agd_nml = meta$agd_nml,
  epoch_length = meta$epoch_length,
  day_max = 7,
  sleep_algo = "barreira",
  non_wear_algo = "barreira",
  start_date = meta$start_date,
  cpu_max = 2
)

# Print/examine
agd_data
#> 
#> ── 🍁chms::agd$print() method ──
#> 
#> Settings
#> 
#> # A tibble: 2 × 9
#>   id         age   agd_lfe agd_nml epoch_length day_max sleep_algo non_wear_algo
#>   <chr>      <chr> <chr>   <chr>   <chr>        <chr>   <chr>      <chr>        
#> 1 jane-canu… 10    C:/Use… C:/Use… 15           7       barreira   barreira     
#> 2 john-canu… 40    C:/Use… C:/Use… 60           7       barreira   barreira     
#> # ℹ 1 more variable: start_date <chr>
#> 
#> Log
#> 
#> # A tibble: 1 × 4
#>   method timestamp           status  message
#>   <chr>  <dttm>              <chr>   <chr>  
#> 1 new()  2026-08-25 19:22:40 success ""
# Run processing pipeline (load, clean, classify and summarize data)
agd_data$run()
#> 
#> ── 🍁chms::agd$run() method ──
#> 
#> ℹ Crunching data for 2 participants across 2 CPUs.
#> 
#> ■■■■■■■■■■■■■■■■                  50% | ETA:  7s
#> ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  100% | ETA:  0s
#> ✔ Done!
# Export results
agd_data$export(dir = tempdir())
#> 
#> ── 🍁chms::agd$export() method ──
#> 
#> ℹ Exporting results to 'C:\Users\Clippy\AppData\Local\Temp\Rtmp0kKTmq/agd-run-2026-08-25-19-22-48-815256'.
#> 
#> ✔ Done!
# Export statcan-formatted results
agd_data$export(dir = tempdir(), stc = TRUE)
#> 
#> ── 🍁chms::agd$export() method ──
#> 
#> ℹ Exporting `self$results$summary_full_stc` and `self$results$summary_run` to 'C:\Users\Clippy\AppData\Local\Temp\Rtmp0kKTmq'.
#> 
#> ✔ Done!
# Get settings and pipeline run log
agd_data
#> 
#> ── 🍁chms::agd$print() method ──
#> 
#> Settings
#> 
#> # A tibble: 2 × 9
#>   id         age   agd_lfe agd_nml epoch_length day_max sleep_algo non_wear_algo
#>   <chr>      <chr> <chr>   <chr>   <chr>        <chr>   <chr>      <chr>        
#> 1 jane-canu… 10    C:/Use… C:/Use… 15           7       barreira   barreira     
#> 2 john-canu… 40    C:/Use… C:/Use… 60           7       barreira   barreira     
#> # ℹ 1 more variable: start_date <chr>
#> 
#> Log
#> 
#> # A tibble: 2 × 4
#>   method timestamp           status  message
#>   <chr>  <dttm>              <chr>   <chr>  
#> 1 new()  2026-08-25 19:22:40 success ""     
#> 2 run()  2026-08-25 19:22:48 success ""
# Plot data
plot(agd_data, id = "jane-canuck")
#> 
#> ── 🍁chms::plot(agd) method ──
#> 
#> ℹ Rendering scatter plot for participant `jane-canuck`

#> ✔ Done!
# Summarize data
summary(agd_data)
#> 
#> ── 🍁chms::summary(agd) method ──
#> 
#> Waking hours summary
#> Participant count: 2
#> 
#> # A tibble: 2 × 14
#>   participant_id device_serial_number wear_time  steps   lpa   mpa   vpa  mvpa
#>   <chr>          <chr>                    <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 jane-canuck    MOS2E26200432             14.7 10659.  251.  35.5  25.8  61.3
#> 2 john-canuck    MOS2E26200637             16.4 11166.  309.  32.4  17.9  50.3
#> # ℹ 6 more variables: lmvpa <dbl>, mpa_bouts <dbl>, vpa_bouts <dbl>,
#> #   mvpa_bouts <dbl>, sb <dbl>, valid_day <dbl>
#> 
#> Sleeping hours summary
#> Participant count: 2
#> 
#> # A tibble: 2 × 16
#>   participant_id device_serial_number wear_time sleep_period_time sleep_episodes
#>   <chr>          <chr>                    <dbl>             <dbl>          <dbl>
#> 1 jane-canuck    MOS2E26200432             9.32              9.63              1
#> 2 john-canuck    MOS2E26200637             7.28              7.28              1
#> # ℹ 11 more variables: nocturnal_sleep_midpoint <chr>, wake_episodes <dbl>,
#> #   total_wake_episode_time <dbl>, total_sleep_episode_time <dbl>,
#> #   sleep_episode_efficiency <dbl>, total_restful_sleep_time <dbl>,
#> #   sleep_episode_movements <dbl>, total_disrupted_sleep <dbl>,
#> #   restful_sleep_efficiency <dbl>, valid_day <dbl>, sleep_episode_log <chr>
# View all results in tab
agd_data$view()

# View specific results in tab
agd_data$view("summary_full")
agd_data$view("summary_full_stc")
agd_data$view("summary_run")
agd_data$view("summary_sleeping_hours")
agd_data$view("summary_waking_hours")

# View issues and run log
agd_data$view("issues")
agd_data$view("log")
# Store results in stand-alone data frames
summary_full <- agd_data$results$summary_full
summary_full_stc <- agd_data$results$summary_full_stc
summary_run <- agd_data$results$summary_run
summary_sleeping_hours <- agd_data$results$summary_sleeping_hours
summary_waking_hours <- agd_data$results$summary_waking_hours
# Render sanity check report
agd_data$sanity_check(dir = tempdir(), name = "My sanity check report")

Documentation

?agd

How to cite

citation("chms")
#> To cite chms in publications, please use:
#> 
#>   Clarke J, Gribbon A, St-Laurent M, Ferrao T, Barnes J, Kuzik N,
#>   Colley R (2026). "Comparison of physical activity and sedentary time
#>   measured with the ActiGraph GT3X-BT and Actical accelerometers."
#>   _Health Rep_, *18*(37(2)), 3-15.
#>   doi:10.25318/82-003-x202600200001-eng
#>   <https://doi.org/10.25318/82-003-x202600200001-eng>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {Comparison of physical activity and sedentary time measured with the ActiGraph GT3X-BT and Actical accelerometers},
#>     author = {J Clarke and A Gribbon and M St-Laurent and T Ferrao and J Barnes and N Kuzik and R Colley},
#>     journal = {Health Rep},
#>     year = {2026},
#>     volume = {18},
#>     number = {37(2)},
#>     pages = {3-15},
#>     doi = {10.25318/82-003-x202600200001-eng},
#>   }

Français

Vue d’ensemble

L’ECMS fournit des outils pour nettoyer et résumer les données de l’accéléromètre conforme aux méthodes appliquées au cycle 7 du Enquête canadienne sur les mesures de la santé (ECMS) :

L’ECMS exige :

Par défaut, l’ECMS :

Âge (années) Niveau d’époque (secondes) Point de coupure de SB (nombres) Point de coupure de l’APL (nombre) Point de coupure de l’AMP (nombre) Seuil de l’APV (nombre)
3-4 15 0-24Evenson 25-419Pate 420+Pate
5-17 15 0-24Evenson 25-573Evenson 574-1,002Evenson 1,003+Evenson
18-64 60 0-99Troiano 100-2,019Troiano 2,020-5,998Troiano 5,999+Troiano
65+ 60 0-99Troiano 100-2,019Troiano 2,020-5,998Troiano 5,999+Troiano

SB : comportement sédentaire ; APL : physique d’intensité légère activité ; APM : activité physique d’intensité modérée ; APV : activité physique d’intensité vigoureuse.

Pour plus de détails sur les méthodes utilisées dans l’ensemble R de l’ ECMS , voir Clarke J, Gribbon A, St-Laurent M, Ferrao T, Barnes J, Kuzik N, Colley R. Comparaison de l’activité physique et du temps consacré à des activités sédentaires mesurés à l’aide des accéléromètres ActiGraph GT3X-BT et Actical. Représentant de la santé 2026 févr. 18; 37(2):3-15. DOI : 10.25318/82-003-x202600200001-fra. PMID : 41730515.

L’installation

remotes::install_git(
  url = "https://github.com/statcan/chms",
  force = TRUE,
  upgrade = "never"
)

Utilisation

# Load dependencies into current R session
library(chms)
library(dplyr)
# Create participant meta (external/non-statcan users)
meta <- tibble(
  id = c("jane-canuck", "john-canuck"),
  age = c(10, 40),
  agd_lfe = c(
    system.file("extdata", "jane-canuck-lfe.agd", package = "chms"),
    system.file("extdata", "john-canuck-lfe.agd", package = "chms")
  ),
  agd_nml = c(
    system.file("extdata", "jane-canuck-nml.agd", package = "chms"),
    system.file("extdata", "john-canuck-nml.agd", package = "chms")
  ),
  start_date = c("2021-05-30", "2021-05-27"),
  epoch_length = c(15, 60)
)

# Print/examine
glimpse(meta)
#> Rows: 2
#> Columns: 6
#> $ id           <chr> "jane-canuck", "john-canuck"
#> $ age          <dbl> 10, 40
#> $ agd_lfe      <chr> "C:/Users/Clippy/Desktop/chms/inst/extdata/jane-c…
#> $ agd_nml      <chr> "C:/Users/Clippy/Desktop/chms/inst/extdata/jane-c…
#> $ start_date   <chr> "2021-05-30", "2021-05-27"
#> $ epoch_length <dbl> 15, 60
# Create participant meta (statcan users)
meta <- get_chms_meta(
  clinic_file = "path/to/clinic/file.sas7bdat",
  agd_dir = "path/to/agd/files/site",
  clinic_id = "CLINICID",
  site = "SITE",
  age = "CLC_AGE",
  day = "V2_DAY",
  month = "V2_MTH",
  year = "V2_YEAR"
)
# Initialize agd R6 class
agd_data <- agd$new(
  id = meta$id,
  age = meta$age,
  agd_lfe = meta$agd_lfe,
  agd_nml = meta$agd_nml,
  epoch_length = meta$epoch_length,
  day_max = 7,
  sleep_algo = "barreira",
  non_wear_algo = "barreira",
  start_date = meta$start_date,
  cpu_max = 2
)

# Print/examine
agd_data
#> 
#> ── 🍁chms::agd$print() method ──
#> 
#> Settings
#> 
#> # A tibble: 2 × 9
#>   id         age   agd_lfe agd_nml epoch_length day_max sleep_algo non_wear_algo
#>   <chr>      <chr> <chr>   <chr>   <chr>        <chr>   <chr>      <chr>        
#> 1 jane-canu… 10    C:/Use… C:/Use… 15           7       barreira   barreira     
#> 2 john-canu… 40    C:/Use… C:/Use… 60           7       barreira   barreira     
#> # ℹ 1 more variable: start_date <chr>
#> 
#> Log
#> 
#> # A tibble: 1 × 4
#>   method timestamp           status  message
#>   <chr>  <dttm>              <chr>   <chr>  
#> 1 new()  2026-08-25 19:23:04 success ""
# Run processing pipeline (load, clean, classify and summarize data)
agd_data$run()
#> 
#> ── 🍁chms::agd$run() method ──
#> 
#> ℹ Crunching data for 2 participants across 2 CPUs.
#> 
#> ■■■■■■■■■■■■■■■■                  50% | ETA:  7s
#> ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  100% | ETA:  0s
#> ✔ Done!
# Export results
agd_data$export(dir = tempdir())
#> 
#> ── 🍁chms::agd$export() method ──
#> 
#> ℹ Exporting results to 'C:\Users\Clippy\AppData\Local\Temp\Rtmp0kKTmq/agd-run-2026-08-25-19-23-11-65182'.
#> 
#> ✔ Done!
# Export statcan-formatted results
agd_data$export(dir = tempdir(), stc = TRUE)
#> 
#> ── 🍁chms::agd$export() method ──
#> 
#> ℹ Exporting `self$results$summary_full_stc` and `self$results$summary_run` to 'C:\Users\Clippy\AppData\Local\Temp\Rtmp0kKTmq'.
#> 
#> ✔ Done!
# Get settings and pipeline run log
agd_data
#> 
#> ── 🍁chms::agd$print() method ──
#> 
#> Settings
#> 
#> # A tibble: 2 × 9
#>   id         age   agd_lfe agd_nml epoch_length day_max sleep_algo non_wear_algo
#>   <chr>      <chr> <chr>   <chr>   <chr>        <chr>   <chr>      <chr>        
#> 1 jane-canu… 10    C:/Use… C:/Use… 15           7       barreira   barreira     
#> 2 john-canu… 40    C:/Use… C:/Use… 60           7       barreira   barreira     
#> # ℹ 1 more variable: start_date <chr>
#> 
#> Log
#> 
#> # A tibble: 2 × 4
#>   method timestamp           status  message
#>   <chr>  <dttm>              <chr>   <chr>  
#> 1 new()  2026-08-25 19:23:04 success ""     
#> 2 run()  2026-08-25 19:23:11 success ""
# Plot data
plot(agd_data, id = "jane-canuck")
#> 
#> ── 🍁chms::plot(agd) method ──
#> 
#> ℹ Rendering scatter plot for participant `jane-canuck`

#> ✔ Done!
# Summarize data
summary(agd_data)
#> 
#> ── 🍁chms::summary(agd) method ──
#> 
#> Waking hours summary
#> Participant count: 2
#> 
#> # A tibble: 2 × 14
#>   participant_id device_serial_number wear_time  steps   lpa   mpa   vpa  mvpa
#>   <chr>          <chr>                    <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 jane-canuck    MOS2E26200432             14.7 10659.  251.  35.5  25.8  61.3
#> 2 john-canuck    MOS2E26200637             16.4 11166.  309.  32.4  17.9  50.3
#> # ℹ 6 more variables: lmvpa <dbl>, mpa_bouts <dbl>, vpa_bouts <dbl>,
#> #   mvpa_bouts <dbl>, sb <dbl>, valid_day <dbl>
#> 
#> Sleeping hours summary
#> Participant count: 2
#> 
#> # A tibble: 2 × 16
#>   participant_id device_serial_number wear_time sleep_period_time sleep_episodes
#>   <chr>          <chr>                    <dbl>             <dbl>          <dbl>
#> 1 jane-canuck    MOS2E26200432             9.32              9.63              1
#> 2 john-canuck    MOS2E26200637             7.28              7.28              1
#> # ℹ 11 more variables: nocturnal_sleep_midpoint <chr>, wake_episodes <dbl>,
#> #   total_wake_episode_time <dbl>, total_sleep_episode_time <dbl>,
#> #   sleep_episode_efficiency <dbl>, total_restful_sleep_time <dbl>,
#> #   sleep_episode_movements <dbl>, total_disrupted_sleep <dbl>,
#> #   restful_sleep_efficiency <dbl>, valid_day <dbl>, sleep_episode_log <chr>
# View all results in tab
agd_data$view()

# View specific results in tab
agd_data$view("summary_full")
agd_data$view("summary_full_stc")
agd_data$view("summary_run")
agd_data$view("summary_sleeping_hours")
agd_data$view("summary_waking_hours")

# View issues and run log
agd_data$view("issues")
agd_data$view("log")
# Store results in stand-alone data frames
summary_full <- agd_data$results$summary_full
summary_full_stc <- agd_data$results$summary_full_stc
summary_run <- agd_data$results$summary_run
summary_sleeping_hours <- agd_data$results$summary_sleeping_hours
summary_waking_hours <- agd_data$results$summary_waking_hours
# Render sanity check report
agd_data$sanity_check(dir = tempdir(), name = "My sanity check report")

Documentation

?agd

Comment citer

citation("chms")
#> To cite chms in publications, please use:
#> 
#>   Clarke J, Gribbon A, St-Laurent M, Ferrao T, Barnes J, Kuzik N,
#>   Colley R (2026). "Comparison of physical activity and sedentary time
#>   measured with the ActiGraph GT3X-BT and Actical accelerometers."
#>   _Health Rep_, *18*(37(2)), 3-15.
#>   doi:10.25318/82-003-x202600200001-eng
#>   <https://doi.org/10.25318/82-003-x202600200001-eng>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {Comparison of physical activity and sedentary time measured with the ActiGraph GT3X-BT and Actical accelerometers},
#>     author = {J Clarke and A Gribbon and M St-Laurent and T Ferrao and J Barnes and N Kuzik and R Colley},
#>     journal = {Health Rep},
#>     year = {2026},
#>     volume = {18},
#>     number = {37(2)},
#>     pages = {3-15},
#>     doi = {10.25318/82-003-x202600200001-eng},
#>   }

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.