class: center, middle, inverse, title-slide # {mctq}:
An R Package for the Munich ChronoType Questionnaire ### Daniel Vartanian ### July 2021 --- ## Overview .pull-left[ {mctq} is an R package that provides a complete and consistent toolkit to process the Munich ChronoType Questionnaire (MCTQ), a validated tool to assess chronotypes using peoples’ sleep behavior presented by Till Roenneberg, Anna Wirz-Justice, and Martha Merrow in [2003](https://doi.org/10.1177/0748730402239679). The aim of {mctq} is to facilitate the work of sleep and chronobiology scientists with MCTQ data while also helping with research reproducibility. ] .pull-right[ <img src="img/logo.png" title="Hex logo of the {mctq} R package" alt="Hex logo of the {mctq} R package" width="50%" style="display: block; margin: auto;" /> Code repository: [https://github.com/gipso/mctq](https://github.com/gipso/mctq) Documentation website: [https://gipso.github.io/mctq](https://gipso.github.io/mctq) ] --- class: chapter-slide # The MCTQ questionnaire --- background-image: url("img/thewep_mctq-core_1.png") background-position: center background-size: contain --- background-image: url("img/thewep_mctq-core_2.png") background-position: center background-size: contain --- ## Main challenges * MCTQ requires a lot of date/time manipulation. * Lack of consistency in computations. * Inconsistencies can lead to irreproducible results. --- class: chapter-slide # The {mctq} package --- ## Workdays and work-free days variables * `fd()`: compute MCTQ work-free days. * `so()`: compute MCTQ local time of sleep onset. * `gu()`: compute MCTQ local time of getting out of bed. * `sdu()`: compute MCTQ sleep duration. * `tbt()`: compute MCTQ total time in bed. * `msl()`: compute MCTQ local time of mid-sleep. * `napd()`: compute MCTQ nap duration (only for MCTQ Shift). * `sd24()`: compute MCTQ 24 hours sleep duration (only for MCTQ Shift). --- ## Combining workdays and work-free days variables * `sd_week()`: compute MCTQ average weekly sleep duration. * `sd_overall()`: compute MCTQ overall sleep duration (only for MCTQ Shift). * `sloss_week()`: compute MCTQ weekly sleep loss. * `le_week()`: compute MCTQ average weekly light exposure. * `msf_sc()`: compute MCTQ chronotype or corrected local time of mid-sleep on work-free days. * `sjl_rel()` and `sjl()`: compute MCTQ social jet lag. * `sjl_weighted()`: compute MCTQ absolute social jetlag across all shifts (only for MCTQ Shift). --- ## Combining workdays and work-free days variables Example: ```r # Local time of mid-sleep on workdays msw <- c(hms::parse_hm("02:05"), hms::parse_hm("04:05")) # Local time of mid-sleep on work-free days msf <- c(hms::parse_hm("23:05"), hms::parse_hm("08:30")) # Relative social jetlag sjl_rel(msw, msf) ``` ``` ## [1] "-10800s (~-3 hours)" "15900s (~4.42 hours)" ``` --- class: chapter-slide # Final remarks --- ## Notes * {mctq} is currently under a [rOpenSci software peer review](https://github.com/ropensci/software-review/issues/434). * We plan to submit {mctq} to CRAN soon after the review process ends. * We plan to invite the MCTQ authors to review and author the package. * An article about {mctq} will be published soon. --- class: chapter-slide # Thank you!