Skip to content

Commit

Permalink
Patch documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvartan committed Nov 29, 2023
1 parent 0133509 commit 79ac6c9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 39 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/lint.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion data-raw/micro_mctq.R
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ tidy_micro_mctq <- function(write = FALSE) {
id = as.integer(.data$`ID`),

shift_work = dplyr::case_when(
tolower(.data$`SHIFT WORK`) == "yes" ~ TRUE, #nolint
tolower(.data$`SHIFT WORK`) == "yes" ~ TRUE, # nolint
tolower(.data$`SHIFT WORK`) == "false" ~ FALSE,
tolower(.data$`SHIFT WORK`) == "no" ~ FALSE),
wd = as.integer(.data$`WORK DAYS`),
Expand Down
4 changes: 2 additions & 2 deletions data-raw/random_mctq.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ std_mctq_par <- function() {

values <- list( # Extracted from the base article
w = list(
suffix = "W", #nolint
suffix = "W", # nolint
title = "Workdays (W)",
sd_mean = hms::parse_hms("07:22:00"),
sd_sd = hms::parse_hms("01:09:00"),
ms_mean = hms::parse_hms("03:10:00"),
ms_sd = hms::parse_hms("00:50:00")),
f = list(
suffix = "F", #nolint
suffix = "F", # nolint
title = "Work-free days (F)",
sd_mean = hms::parse_hms("08:27:00"),
sd_sd = hms::parse_hms("01:32:00"),
Expand Down
2 changes: 1 addition & 1 deletion data-raw/shift_mctq.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ build_shift_mctq <- function(write = FALSE, random_cases = TRUE) {
dplyr::mutate(`ID` = as.character(i)) %>% # Don't change the pipe.
dplyr::relocate(.data$`ID`, .before = .data$n_w_m)

## nolint start: object_name_linter.
# nolint start: object_name_linter.
for (i in values) {
random_case <-
random_case %>% # Don't change the pipe.
Expand Down
6 changes: 3 additions & 3 deletions vignettes/sjl-computation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ knitr::opts_chunk$set(
)
```

This article shows some notes about different approaches that can be used to compute the social jetlag ($SJL$) for the Munich ChronoType Questionnaire (MCTQ). It also explains how the `method` argument from the `sjl_rel()`, `sjl()`, `sjl_sc_rel()`, and `sjl_sc()` functions works.
This article shows some notes about different approaches that can be used to compute the social jetlag ($SJL$) for the Munich ChronoType Questionnaire (MCTQ). It also explains how the `method` argument from the `sjl_rel()`, `sjl()`, `sjl_sc_rel()`, and `sjl_sc()` functions work.

It's a good idea to have the standard MCTQ questionnaire and the guidelines for the standard MCTQ variable computation open while reading this article/vignette. That way you can have a better understanding of the data objects we are going to deal with. You can download a copy of the MCTQ full standard version [here](https://www.thewep.org/documentations/mctq/item/english-mctq-full). Click [here](https://www.thewep.org/documentations/mctq/item/mctq-variables) to download a copy of the guidelines for the standard MCTQ variables.

## The two intervals problem

According to Roenneberg, Allebrandt, Merrow, & Vetter ([2012](https://doi.org/10.1016/j.cub.2012.03.038)) supplemental materials, the relative social jetlag ($SJL_{ rel}$), i.e., the discrepancy between social and biological time, must be computed as the difference between $MSF$ (local time of mid-sleep on work-free days) and $MSW$ (local time of mid-sleep on workdays).
According to Roenneberg et al. ([2012](https://doi.org/10.1016/j.cub.2012.03.038)) supplemental materials, the relative social jetlag ($SJL_{ rel}$), i.e., the discrepancy between social and biological time, must be computed as the difference between $MSF$ (local time of mid-sleep on work-free days) and $MSW$ (local time of mid-sleep on workdays).

$$SJL_{rel} = MSF - MSW$$

Expand All @@ -36,7 +36,7 @@ If you dive into the MCTQ articles, you can see that this computation have two o
1. To represent the distance between $MSW$ and $MSF$ (i.e., the discrepancy).
2. To establish what value comes before or after the other, representing that with a $+/-$ signal. That is, when $MSW$ comes before $MSF$, $SJL_{rel}$ must be positive, and when $MSW$ comes after $MSF$, $SJL_{rel}$ must be negative.

You can find the rationale about the $SJL_{rel}$ signal in Roenneberg, Pilz, Zerbini, & Winnebeck ([2019](https://doi.org/10.3390/biology8030054)) (see item "3.2 Social Jetlag Computation").
You can find the rationale about the $SJL_{rel}$ signal in Roenneberg et al. ([2019](https://doi.org/10.3390/biology8030054)) (see item "3.2 Social Jetlag Computation").

Most people have some trouble understanding this. To illustrate what we mean, let's visualize a timeline overlapping an $MSW$ and $MSF$ value:

Expand Down

0 comments on commit 79ac6c9

Please sign in to comment.