Title: | Munich ChronoType Questionnaire Tools |
---|---|
Description: | A complete toolkit for processing the Munich ChronoType Questionnaire (MCTQ) in its three versions: standard, micro, and shift. The MCTQ is a quantitative and validated tool used to assess chronotypes based on individuals' sleep behavior. It was originally presented by Till Roenneberg, Anna Wirz-Justice, and Martha Merrow in 2003 (2003, <doi:10.1177/0748730402239679>). |
Authors: | Daniel Vartanian [aut, cre, ccp, cph] , Ana Amelia Benedito Silva [sad] , Mario Pedrazzoli [sad] , Jonathan Keane [rev] , Mario Andre Leocadio-Miguel [rev] , University of Sao Paulo (USP) [fnd] |
Maintainer: | Daniel Vartanian <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.3.2.9001 |
Built: | 2024-11-11 06:46:34 UTC |
Source: | https://github.com/ropensci/mctq |
fd()
computes the number of work-free days per week for standard
and micro versions of the Munich ChronoType Questionnaire (MCTQ).
fd(wd)
fd(wd)
wd |
An integerish
|
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
An integer
object corresponding to the
difference between the number of days in a week (7) and the number of
workdays (wd
).
Roenneberg, Allebrandt, Merrow, & Vetter (2012) and The Worldwide
Experimental Platform (n.d.) guidelines for fd()
() computation are
as follows.
Where:
= Number of work-free days per week.
= Number of workdays per week ("I have a regular work schedule and
work ___ days per week").
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example fd(5) #> [1] 2 # Expected fd(4) #> [1] 3 # Expected fd(as.numeric(NA)) #> [1] NA # Expected ## Vector example fd(0:7) #> [1] 7 6 5 4 3 2 1 0 # Expected fd(c(1, NA)) #> [1] 6 NA # Expected
## Scalar example fd(5) #> [1] 2 # Expected fd(4) #> [1] 3 # Expected fd(as.numeric(NA)) #> [1] NA # Expected ## Vector example fd(0:7) #> [1] 7 6 5 4 3 2 1 0 # Expected fd(c(1, NA)) #> [1] 6 NA # Expected
gu()
computes the local time of getting out of bed for standard and
shift versions of the Munich ChronoType Questionnaire (MCTQ).
gu(se, si)
gu(se, si)
se |
An |
si |
A |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
An hms
object corresponding to the vectorized sum of
se
and si
in a circular time frame of 24 hours.
Roenneberg, Allebrandt, Merrow, & Vetter (2012), Juda, Vetter, & Roenneberg
(2013), and The Worldwide Experimental Platform (n.d.) guidelines for gu()
() computation are as follows.
This computation must be applied to each section of the questionnaire.
MCTQ uses
(time to get up) instead of
(sleep inertia). For the purpose of this computation, both represent
the same thing.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Local time of getting out of bed on work or work-free
days.
= Local time of sleep end on work or work-free
days.
= Sleep inertia on work or work-free days
("after ___ min, I get up").
* = Workdays;
= Work-free days.
Where:
= Local time of getting out of bed between two days
in a particular shift or between two free days after a particular shift.
= Local time of sleep end between two days in a
particular shift or between two free days after a particular shift.
= Time to get up after sleep end between two days
in a particular shift or between two free days after a particular shift
("after ___ min, I get up").
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example gu(hms::parse_hm("08:00"), lubridate::dminutes(10)) #> 08:10:00 # Expected gu(hms::parse_hm("11:45"), lubridate::dminutes(90)) #> 13:15:00 # Expected gu(hms::as_hms(NA), lubridate::dminutes(90)) #> NA # Expected ## Vector example se <- c(hms::parse_hm("12:30"), hms::parse_hm("23:45")) si <- c(lubridate::dminutes(10), lubridate::dminutes(70)) gu(se, si) #> 12:40:00 # Expected #> 00:55:00 # Expected
## Scalar example gu(hms::parse_hm("08:00"), lubridate::dminutes(10)) #> 08:10:00 # Expected gu(hms::parse_hm("11:45"), lubridate::dminutes(90)) #> 13:15:00 # Expected gu(hms::as_hms(NA), lubridate::dminutes(90)) #> NA # Expected ## Vector example se <- c(hms::parse_hm("12:30"), hms::parse_hm("23:45")) si <- c(lubridate::dminutes(10), lubridate::dminutes(70)) gu(se, si) #> 12:40:00 # Expected #> 00:55:00 # Expected
le_week()
computes the average weekly light exposure for the standard
version of the Munich ChronoType Questionnaire (MCTQ).
le_week(le_w, le_f, wd)
le_week(le_w, le_f, wd)
le_w |
A |
le_f |
A |
wd |
An integerish
|
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
A Duration
object corresponding to the
vectorized weighted mean of le_w
and le_f
with wd
and fd(wd)
as
weights.
Roenneberg, Allebrandt, Merrow, & Vetter (2012) and The Worldwide
Experimental Platform (n.d.) guidelines for le_week()
() computation are as follows.
The average weekly light exposure () is the
weighted average of the light exposure on work and work-free days in a week.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Average weekly light exposure.
= Light exposure on workdays.
= Light exposure on work-free days.
= Number of workdays per week ("I have a regular work schedule and
work ___ days per week").
= Number of work-free days per week.
* = Workdays;
= Work-free days.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example le_w <- lubridate::dhours(1.5) le_f <- lubridate::dhours(3.7) wd <- 5 le_week(le_w, le_f, wd) #> [1] "7662.85714285714s (~2.13 hours)" # Expected le_w <- lubridate::dhours(3) le_f <- lubridate::dhours(1.5) wd <- 6 le_week(le_w, le_f, wd) #> [1] "10028.5714285714s (~2.79 hours)" # Expected le_w <- lubridate::dhours(5.6) le_f <- lubridate::as.duration(NA) wd <- 3 le_week(le_w, le_f, wd) #> [1] NA # Expected ## Vector example le_w <- c(lubridate::dhours(3), lubridate::dhours(2.45)) le_f <- c(lubridate::dhours(3), lubridate::dhours(3.75)) wd <- c(4, 5) le_week(le_w, le_f, wd) #> [1] "10800s (~3 hours)" # Expected #> [2] "10157.1428571429s (~2.82 hours)" # Expected ## Checking second output from vector example if (requireNamespace("stats", quietly = TRUE)) { i <- 2 x <- c(le_w[i], le_f[i]) w <- c(wd[i], fd(wd[i])) lubridate::as.duration(stats::weighted.mean(x, w)) } #> [1] "10157.1428571429s (~2.82 hours)" # Expected ## Converting the output to `hms` le_w <- lubridate::dhours(1.25) le_f <- lubridate::dhours(6.23) wd <- 3 le_week(le_w, le_f, wd) #> [1] "14744.5714285714s (~4.1 hours)" # Expected hms::hms(as.numeric(le_week(le_w, le_f, wd))) #> 04:05:44.571429 # Expected ## Rounding the output at the seconds level le_w <- lubridate::dhours(3.4094) le_f <- lubridate::dhours(6.2345) wd <- 2 le_week(le_w, le_f, wd) #> [1] "19538.3828571429s (~5.43 hours)" # Expected mctq:::round_time(le_week(le_w, le_f, wd)) #> [1] "19538s (~5.43 hours)" # Expected
## Scalar example le_w <- lubridate::dhours(1.5) le_f <- lubridate::dhours(3.7) wd <- 5 le_week(le_w, le_f, wd) #> [1] "7662.85714285714s (~2.13 hours)" # Expected le_w <- lubridate::dhours(3) le_f <- lubridate::dhours(1.5) wd <- 6 le_week(le_w, le_f, wd) #> [1] "10028.5714285714s (~2.79 hours)" # Expected le_w <- lubridate::dhours(5.6) le_f <- lubridate::as.duration(NA) wd <- 3 le_week(le_w, le_f, wd) #> [1] NA # Expected ## Vector example le_w <- c(lubridate::dhours(3), lubridate::dhours(2.45)) le_f <- c(lubridate::dhours(3), lubridate::dhours(3.75)) wd <- c(4, 5) le_week(le_w, le_f, wd) #> [1] "10800s (~3 hours)" # Expected #> [2] "10157.1428571429s (~2.82 hours)" # Expected ## Checking second output from vector example if (requireNamespace("stats", quietly = TRUE)) { i <- 2 x <- c(le_w[i], le_f[i]) w <- c(wd[i], fd(wd[i])) lubridate::as.duration(stats::weighted.mean(x, w)) } #> [1] "10157.1428571429s (~2.82 hours)" # Expected ## Converting the output to `hms` le_w <- lubridate::dhours(1.25) le_f <- lubridate::dhours(6.23) wd <- 3 le_week(le_w, le_f, wd) #> [1] "14744.5714285714s (~4.1 hours)" # Expected hms::hms(as.numeric(le_week(le_w, le_f, wd))) #> 04:05:44.571429 # Expected ## Rounding the output at the seconds level le_w <- lubridate::dhours(3.4094) le_f <- lubridate::dhours(6.2345) wd <- 2 le_week(le_w, le_f, wd) #> [1] "19538.3828571429s (~5.43 hours)" # Expected mctq:::round_time(le_week(le_w, le_f, wd)) #> [1] "19538s (~5.43 hours)" # Expected
MCTQ datasetA fictional dataset, for testing and learning purposes, composed of
basic/measurable and computed variables of the Munich ChronoType
Questionnaire (MCTQ) micro () version.
This data was created following the guidelines in Ghotbi et al. (2020), in addition to the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), Jankowski (2017), and The Worldwide Experimental Platform (n.d.). See the References and Details sections to learn more.
micro_mctq
micro_mctq
A tibble
with 19 columns and 50 rows:
A unique integer
value to identify each respondent in
the dataset.
Type: Control.
R class: integer
.
A logical
value indicating if the respondent has been a shift- or night-worker in the past three months. \cr \cr Statement (
EN): "I have been a shift- or night-worker in the past three months: Yes ( ___ ) No ( ___ )". \cr \cr Type: Basic. \cr \cr R class: [
logical']base::logical()
.
Number of workdays per week.
Statement (EN
): "Normally, I work ___ days/week".
Type: Basic.
R class: integer
.
Number of work-free days per week.
Type: Computed.
R class: integer
.
Local time of sleep onset on workdays.
Statement (EN
): "On WORKDAYS ... I normally fall asleep at ___ : ___
AM/PM (this is NOT when you get into bed, but rather when you fall
asleep)".
Type: Basic.
R class: hms
.
Local time of sleep end on workdays.
Statement (EN
): "On WORKDAYS ... I normally wake up at ___ : ___ AM/PM
(this is NOT when you get out of bed, but rather when you wake up)".
Type: Basic.
R class: hms
.
Sleep duration on workdays.
Type: Computed.
R class: Duration
.
Local time of mid-sleep on workdays.
Type: Computed.
R class: hms
.
Local time of sleep onset on work-free days when the respondent
doesn't use an alarm clock to wake up.
Statement (EN
): "On WORK-FREE DAYS when I DON'T use an alarm clock ... I
normally fall asleep at ___ : ___ AM/PM (this is NOT when you get into bed,
but rather when you fall asleep)".
Type: Basic.
R class: hms
.
Local time of sleep end on work-free days when the respondent
doesn't use an alarm clock to wake up.
Statement (EN
): "On WORK-FREE DAYS when I DON'T use an alarm clock ... I
normally wake up at ___ : ___ AM/PM (this is NOT when you get out of bed,
but rather when you wake up)".
Type: Basic.
R class: hms
.
Sleep duration on work-free days when the respondent doesn't use an
alarm clock to wake up.
Type: Computed.
R class: Duration
.
Local time of mid-sleep on work-free days when the respondent
doesn't use an alarm clock to wake up.
Type: Computed.
R class: hms
.
Average weekly sleep duration.
Type: Computed.
R class: Duration
.
Weekly sleep loss.
Type: Computed.
R class: Duration
.
Sleep-corrected local time of mid-sleep on work-free days.
Type: Computed.
R class: hms
.
Relative social jetlag.
Type: Computed.
R class: Duration
.
Absolute social jetlag.
Type: Computed.
R class: Duration
.
Jankowski's relative sleep-corrected social jetlag.
Type: Computed.
R class: Duration
.
Jankowski's sleep-corrected social jetlag.
Type: Computed.
R class: Duration
.
micro_mctq
is a tidied, validated, and transformed version of
raw_data("micro_mctq.csv")
.
To learn more about the Munich ChronoType Questionnaire (MCTQ), see Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), Roenneberg et al. (2015), and Roenneberg, Pilz, Zerbini, & Winnebeck (2019).
To know about different MCTQ versions, see Juda, Vetter, & Roenneberg (2013) and Ghotbi et.al (2020).
To learn about the sleep-corrected social jetlag, see Jankowski (2017).
If you're curious about the variable computations and want to have access to the full questionnaire, see The Worldwide Experimental Platform (n.d.).
This dataset was created by randomized sampling (see
random_mctq()
) and by manual insertions of special
cases. Its purpose is to demonstrate common cases and data issues that
researchers may find in their MCTQ data, in addition to be a suggested data
structure for MCTQ data.
You can see the micro_mctq
build and data wrangling processes
here.
The naming of the variables took into account the naming scheme used in MCTQ publications, in addition to the guidelines of the tidyverse style guide.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the hms
and lubridate package.
Duration
objectsIf you prefer to view Duration
objects as
hms
objects, run
pretty_mctq(micro_mctq)
.
Created by Daniel Vartanian (package author).
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Jankowski K. S. (2017). Social jet lag: sleep-corrected formula. Chronobiology International, 34(4), 531-535. doi:10.1080/07420528.2017.1299162
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Keller, L. K., Fischer, D., Matera, J. L., Vetter, C., & Winnebeck, E. C. (2015). Human activity and rest in situ. In A. Sehgal (Ed.), Methods in Enzymology (Vol. 552, pp. 257-283). Academic Press. doi:10.1016/bs.mie.2014.11.028
Roenneberg, T., Pilz, L. K., Zerbini, G., & Winnebeck, E. C. (2019). Chronotype and social jetlag: a (self-) critical review. Biology, 8(3), 54. doi:10.3390/biology8030054
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other datasets:
shift_mctq
,
std_mctq
msf_sc()
computes the sleep-corrected local time of mid-sleep on
work-free days for standard, micro, and shift versions of the Munich
ChronoType Questionnaire (MCTQ).
When using the shift version of the MCTQ, replace the value of sd_week
to
sd_overall
, as instructed in the Arguments section.
msf_sc(msf, sd_w, sd_f, sd_week, alarm_f)
msf_sc(msf, sd_w, sd_f, sd_week, alarm_f)
msf |
An |
sd_w |
A |
sd_f |
A |
sd_week |
A |
alarm_f |
A |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
An hms
object corresponding to the MCTQ chronotype or
sleep-corrected local time of mid-sleep on work-free days.
Roenneberg, Allebrandt, Merrow, & Vetter (2012), Ghotbi et al. (2020), Juda,
Vetter, & Roenneberg (2013), and The Worldwide Experimental Platform (n.d.)
guidelines for msf_sc()
() computation are as
follows.
For all cases, cannot be computed if the participant
wakes up with an alarm clock on work-free days (
).
For MCTQ, the computation below must be applied to
each shift section of the questionnaire.
is a proxy for the subject chronotype in
standard and micro versions of the MCTQ.
The basis for estimating chronotype in shift-workers is the mid-sleep on
work-free days after evening shifts (). In case work
schedules do not comprise evening shifts, Juda, Vetter, & Roenneberg (2013)
propose to derive it from the
of other shifts (e.g.,
by using a linear model). Unfortunately, the
mctq
package can't help you
with that, as it requires a closer look at your data.
depends on developmental and environmental
conditions (e.g., age, light exposure). For epidemiological and genetic
studies,
must be normalized for age and sex to make
populations of different age and sex compositions comparable (Roenneberg,
Allebrandt, Merrow, & Vetter, 2012).
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Sleep-corrected local time of mid-sleep on work-free days.
= A
logical
value indicating if the
respondent uses an alarm clock to wake up on work-free days.
= Local time of mid-sleep on work-free days.
= Sleep duration on workdays.
= Sleep duration on work-free days.
= Average weekly sleep duration.
* = Workdays;
= Work-free days.
Note that, since:
Where:
= Local time of mid-sleep on work-free days.
= Local time of sleep onset on work-free days.
= Sleep duration on work-free days.
The last condition of the computation can be
simplified to:
Where:
= Sleep-corrected local time of mid-sleep between
two free days after a particular shift.
= A
logical
value indicating
if the respondent uses an alarm clock to wake up between two free days after
a particular shift.
= Local time of mid-sleep between two free
days after a particular shift.
= Sleep duration between two days in a
particular shift.
= Sleep duration between two free days
after a particular shift.
= Overall sleep duration of a
particular shift.
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Note that, since:
Where:
= Local time of mid-sleep between two free
days after a particular shift.
= Local time of sleep onset between two free days
after a particular shift.
= Sleep duration between two free days after a
particular shift.
The last condition of the computation
can be simplified to:
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example msf <- hms::parse_hms("04:00:00") sd_w <- lubridate::dhours(6) sd_f <- lubridate::dhours(7) sd_week <- lubridate::dhours(6.29) alarm_f <- FALSE msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> 03:38:42 # Expected msf <- hms::parse_hm("01:00:00") sd_w <- lubridate::dhours(5.5) sd_f <- lubridate::dhours(9) sd_week <- lubridate::dhours(6.75) alarm_f <- FALSE msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> 23:52:30 # Expected msf <- hms::parse_hms("05:40:00") sd_w <- lubridate::dhours(7.5) sd_f <- lubridate::dhours(10) sd_week <- lubridate::dhours(8.5) alarm_f <- TRUE msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> NA # Expected (`msf_sc` cannot be computed if `alarm_f == TRUE`) ## Vector example msf <- c(hms::parse_hms("03:45:00"), hms::parse_hm("04:45:00")) sd_w <- c(lubridate::dhours(9), lubridate::dhours(6.45)) sd_f <- c(lubridate::dhours(5), lubridate::dhours(10)) sd_week <- c(lubridate::dhours(8.5), lubridate::dhours(9.2)) alarm_f <- c(FALSE, FALSE) msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> 03:45:00 # Expected #> 04:21:00 # Expected ## Rounding the output at the seconds level msf <- hms::parse_hms("05:40:00") sd_w <- lubridate::dhours(5.43678) sd_f <- lubridate::dhours(9.345111) sd_week <- lubridate::dhours(7.5453) alarm_f <- FALSE msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> 04:46:00.3402 # Expected mctq:::round_time(msf_sc(msf, sd_w, sd_f, sd_week, alarm_f)) #> 04:46:00 # Expected
## Scalar example msf <- hms::parse_hms("04:00:00") sd_w <- lubridate::dhours(6) sd_f <- lubridate::dhours(7) sd_week <- lubridate::dhours(6.29) alarm_f <- FALSE msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> 03:38:42 # Expected msf <- hms::parse_hm("01:00:00") sd_w <- lubridate::dhours(5.5) sd_f <- lubridate::dhours(9) sd_week <- lubridate::dhours(6.75) alarm_f <- FALSE msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> 23:52:30 # Expected msf <- hms::parse_hms("05:40:00") sd_w <- lubridate::dhours(7.5) sd_f <- lubridate::dhours(10) sd_week <- lubridate::dhours(8.5) alarm_f <- TRUE msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> NA # Expected (`msf_sc` cannot be computed if `alarm_f == TRUE`) ## Vector example msf <- c(hms::parse_hms("03:45:00"), hms::parse_hm("04:45:00")) sd_w <- c(lubridate::dhours(9), lubridate::dhours(6.45)) sd_f <- c(lubridate::dhours(5), lubridate::dhours(10)) sd_week <- c(lubridate::dhours(8.5), lubridate::dhours(9.2)) alarm_f <- c(FALSE, FALSE) msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> 03:45:00 # Expected #> 04:21:00 # Expected ## Rounding the output at the seconds level msf <- hms::parse_hms("05:40:00") sd_w <- lubridate::dhours(5.43678) sd_f <- lubridate::dhours(9.345111) sd_week <- lubridate::dhours(7.5453) alarm_f <- FALSE msf_sc(msf, sd_w, sd_f, sd_week, alarm_f) #> 04:46:00.3402 # Expected mctq:::round_time(msf_sc(msf, sd_w, sd_f, sd_week, alarm_f)) #> 04:46:00 # Expected
msl()
computes the local time of mid-sleep for standard, micro, and
shift versions of the Munich ChronoType Questionnaire (MCTQ).
Please note that, although we tried to preserve the original authors' naming
pattern for the MCTQ functions, the name ms
provokes a dangerous name
collision with the ms()
function (a function for parsing
minutes and seconds components). That's why we named it msl
. msl()
and
sdu()
are the only exceptions, all the other mctq
functions maintain a strong naming resemblance with the original authors'
naming pattern.
msl(so, sd)
msl(so, sd)
so |
An |
sd |
A |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
An hms
object corresponding to the vectorized sum of
so
and (sd / 2)
in a circular time frame of 24 hours.
Roenneberg, Allebrandt, Merrow, & Vetter (2012), Ghotbi et al. (2020), Juda,
Vetter, & Roenneberg (2013), and The Worldwide Experimental Platform (n.d.)
guidelines for msl()
( or
) computation are as follows.
This computation must be applied to each section of the questionnaire.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Local time of mid-sleep on work or work-free days.
= Local time of sleep onset on work or work-free
days.
= Sleep duration on work or work-free days.
* = Workdays;
= Work-free days.
Where:
= Local time of mid-sleep between
two days in a particular shift or between two free days after a
particular shift.
= Local time of sleep onset between
two days in a particular shift or between two free days after a
particular shift.
= Sleep duration between two days in a
particular shift or between two free days after a particular shift.
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example so <- hms::parse_hm("23:30") sd <- lubridate::dhours(8) msl(so, sd) #> 03:30:00 # Expected so <- hms::parse_hm("01:00") sd <- lubridate::dhours(10) msl(so, sd) #> 06:00:00 # Expected so <- hms::as_hms(NA) sd <- lubridate::dhours(7.5) msl(so, sd) #> NA # Expected ## Vector example so <- c(hms::parse_hm("00:10"), hms::parse_hm("01:15")) sd <- c(lubridate::dhours(9.25), lubridate::dhours(5.45)) msl(so, sd) #> [1] 04:47:30 # Expected #> [1] 03:58:30 # Expected
## Scalar example so <- hms::parse_hm("23:30") sd <- lubridate::dhours(8) msl(so, sd) #> 03:30:00 # Expected so <- hms::parse_hm("01:00") sd <- lubridate::dhours(10) msl(so, sd) #> 06:00:00 # Expected so <- hms::as_hms(NA) sd <- lubridate::dhours(7.5) msl(so, sd) #> NA # Expected ## Vector example so <- c(hms::parse_hm("00:10"), hms::parse_hm("01:15")) sd <- c(lubridate::dhours(9.25), lubridate::dhours(5.45)) msl(so, sd) #> [1] 04:47:30 # Expected #> [1] 03:58:30 # Expected
)napd()
computes the nap duration for the shift version of the Munich
ChronoType Questionnaire (MCTQ).
napd(napo, nape)
napd(napo, nape)
napo |
An |
nape |
An |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
A Duration
object corresponding to the
vectorized difference between nape
and napo
in a circular time frame of
24 hours.
Juda, Vetter & Roenneberg (2013) and The Worldwide Experimental Platform
(n.d.) guidelines for napd()
() computation are as follows.
This computation must be applied to each section of the questionnaire.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Nap duration between two days in a particular
shift or between two free days after a particular shift ("I take a nap
from ___ o'clock [...]").
= Local time of nap onset between two days in a
particular shift or between two free days after a particular shift ("I
take a nap from ___ o'clock [...]").
= Local time of nap end between two days in a
particular shift or between two free days after a particular shift
("[...] to ___ o'clock").
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example napo <- hms::parse_hm("12:30") nape <- hms::parse_hm("14:20") napd(napo, nape) #> [1] "6600s (~1.83 hours)"" # Expected napo <- hms::parse_hm("23:45") nape <- hms::parse_hm("00:30") napd(napo, nape) #> [1] "2700s (~45 minutes)" # Expected napo <- hms::parse_hm("10:20") nape <- hms::as_hms(NA) napd(napo, nape) #> [1] NA # Expected ## Vector example napo <- c(hms::parse_hm("01:25"), hms::parse_hm("23:50")) nape <- c(hms::parse_hm("03:10"), hms::parse_hm("01:10")) napd(napo, nape) #> [1] "6300s (~1.75 hours)" "4800s (~1.33 hours)" # Expected
## Scalar example napo <- hms::parse_hm("12:30") nape <- hms::parse_hm("14:20") napd(napo, nape) #> [1] "6600s (~1.83 hours)"" # Expected napo <- hms::parse_hm("23:45") nape <- hms::parse_hm("00:30") napd(napo, nape) #> [1] "2700s (~45 minutes)" # Expected napo <- hms::parse_hm("10:20") nape <- hms::as_hms(NA) napd(napo, nape) #> [1] NA # Expected ## Vector example napo <- c(hms::parse_hm("01:25"), hms::parse_hm("23:50")) nape <- c(hms::parse_hm("03:10"), hms::parse_hm("01:10")) napd(napo, nape) #> [1] "6300s (~1.75 hours)" "4800s (~1.33 hours)" # Expected
pretty_mctq()
helps you to transform your Munich ChronoType Questionnaire
(MCTQ) data in many ways. See the Arguments and Details section to learn
more.
pretty_mctq(data, round = TRUE, hms = TRUE)
pretty_mctq(data, round = TRUE, hms = TRUE)
data |
A |
round |
(optional) a |
hms |
(optional) a |
Please note that by rounding MCTQ values you discard data. That is to say that if you need to redo a computation, or do new ones, your values can be off by a couple of seconds (see round-off error).
Round your values only if and when you want to present them more clearly,
like in graphical representations. You can also round values to facilitate
data exporting to text formats (like .csv
), but note that this will come
with a precision cost.
Note also that pretty_mctq()
uses round()
for rounding,
which uses uses the IEC 60559 standard ("go to the even digit") for
rounding off a 5. Therefore, round(0.5)
is equal to 0 and round(-1.5)
is
equal to -2. See ?round
to learn more.
A transformed data.frame
object, as indicated
in the arguments.
Other utility functions:
random_mctq()
,
raw_data()
data <- data.frame( a = 1, b = lubridate::duration(1.12345), c = hms::hms(1.12345) ) ## Rounding time objects from `data` pretty_mctq(data, round = TRUE, hms = FALSE) ## Converting non-'hms' time objects from 'data' to 'hms' pretty_mctq(data, round = FALSE, hms = TRUE)
data <- data.frame( a = 1, b = lubridate::duration(1.12345), c = hms::hms(1.12345) ) ## Rounding time objects from `data` pretty_mctq(data, round = TRUE, hms = FALSE) ## Converting non-'hms' time objects from 'data' to 'hms' pretty_mctq(data, round = FALSE, hms = TRUE)
random_mctq
builds a fictional Munich ChronoType Questionnaire (MCTQ) case
composed of MCTQ basic/measurable variables.
This function is for testing and learning purposes only. Please don't misuse it.
random_mctq(model = "standard")
random_mctq(model = "standard")
model |
A string indicating the data model to return. Valid values are:
|
The case structure (variable names and classes) are the same as the datasets
provided by the mctq
package. See ?std_mctq
,
?micro_mctq
and ?shift_mctq
to
learn more.
This function requires the stats
package. This
won't be an issue for most people since the package comes with a standard R
installation.
If you don't have the stats
package, you can
install it with install.packages("stats")
.
Random standard and micro MCTQ cases were created with the general population in mind. The data was set to resemble the distribution parameters shown in Roenneberg, Wirz-Justice, & Merrow (2003).
MCTQ random cases were created based on the shift
configuration from "Study Site 1" shown in Vetter, Juda, & Roenneberg (2012).
The data was set to resemble the distribution parameters shown in Juda,
Vetter, & Roenneberg (2013).
You can see more about the distribution parameters used here.
A named list
with elements representing each MCTQ
basic/measurable variable of the model indicated in the model
argument.
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
Vetter, C., Juda, M., & Roenneberg, T. (2012). The influence of internal time, time awake, and sleep duration on cognitive performance in shiftworkers. Chronobiology International, 29(8), 1127-1138. doi:10.3109/07420528.2012.707999
Other utility functions:
pretty_mctq()
,
raw_data()
## Not run: random_mctq("standard") random_mctq("micro") random_mctq("shift") ## End(Not run)
## Not run: random_mctq("standard") random_mctq("micro") random_mctq("shift") ## End(Not run)
mctq
raw datasetsmctq
comes bundled with raw fictional datasets for testing and learning
purposes. raw_data()
makes it easy to access their paths.
raw_data(file = NULL)
raw_data(file = NULL)
file |
(optional) a |
If file == NULL
, a character
object with all file
names available. Else, a string with the file name path.
Other utility functions:
pretty_mctq()
,
random_mctq()
## Not run: ## To list all raw data file names available raw_data() ## To get the file path from a specific raw data raw_data("std_mctq.csv") ## End(Not run)
## Not run: ## To list all raw data file names available raw_data() ## To get the file path from a specific raw data raw_data("std_mctq.csv") ## End(Not run)
)sd_overall()
computes the overall sleep duration in a particular shift
for the shift version of the Munich ChronoType Questionnaire (MCTQ).
See sd_week()
to compute the average weekly sleep
duration for the standard and micro versions of the MCTQ.
sd_overall(sd_w, sd_f, n_w, n_f)
sd_overall(sd_w, sd_f, n_w, n_f)
sd_w |
A |
sd_f |
A |
n_w |
An integerish
|
n_f |
An integerish
|
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
A Duration
object corresponding to the
vectorized weighted mean of sd_w
and sd_f
with n_w
and n_f
as
weights.
Juda, Vetter, & Roenneberg (2013) and The Worldwide Experimental Platform
(n.d.) guidelines for sd_overall()
() computation
are as follows.
This computation must be applied to each section of the questionnaire. If
you're using the three-shift design proposed by the MCTQ authors, you need to
compute three overall sleep duration (e.g., ;
;
).
The overall sleep duration is the weighted average of the shift-specific mean sleep durations.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Overall sleep duration in a particular shift.
= Sleep duration between two days in a particular shift.
= Sleep duration between two free days after a
particular shift.
= Number of days worked in a particular shift within a
shift cycle.
= Number of free days after a particular shift within a
shift cycle.
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example sd_w <- lubridate::dhours(5) sd_f <- lubridate::dhours(9) n_w <- 2 n_f <- 2 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "25200s (~7 hours)" # Expected sd_w <- lubridate::dhours(3.45) sd_f <- lubridate::dhours(10) n_w <- 3 n_f <- 1 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "18315s (~5.09 hours)" # Expected sd_w <- lubridate::as.duration(NA) sd_f <- lubridate::dhours(12) n_w <- 4 n_f <- 4 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] NA # Expected ## Vector example sd_w <- c(lubridate::dhours(4), lubridate::dhours(7)) sd_f <- c(lubridate::dhours(12), lubridate::dhours(9)) n_w <- c(3, 4) n_f <- c(2, 4) sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "25920s (~7.2 hours)" "28800s (~8 hours)" # Expected ## Checking second output from vector example if (requireNamespace("stats", quietly = TRUE)) { i <- 2 x <- c(sd_w[i], sd_f[i]) w <- c(n_w[i], n_f[i]) lubridate::as.duration(stats::weighted.mean(x, w)) } #> [1] "28800s (~8 hours)" # Expected ## Converting the output to 'hms' sd_w <- lubridate::dhours(4.75) sd_f <- lubridate::dhours(10) n_w <- 5 n_f <- 2 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "22500s (~6.25 hours)" # Expected hms::as_hms(as.numeric(sd_overall(sd_w, sd_f, n_w, n_f))) #> 06:15:00 # Expected ## Rounding the output at the seconds level sd_w <- lubridate::dhours(5.9874) sd_f <- lubridate::dhours(9.3) n_w <- 3 n_f <- 2 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "26324.784s (~7.31 hours)" # Expected mctq:::round_time(sd_overall(sd_w, sd_f, n_w, n_f)) #> [1] "26325s (~7.31 hours)" # Expected
## Scalar example sd_w <- lubridate::dhours(5) sd_f <- lubridate::dhours(9) n_w <- 2 n_f <- 2 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "25200s (~7 hours)" # Expected sd_w <- lubridate::dhours(3.45) sd_f <- lubridate::dhours(10) n_w <- 3 n_f <- 1 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "18315s (~5.09 hours)" # Expected sd_w <- lubridate::as.duration(NA) sd_f <- lubridate::dhours(12) n_w <- 4 n_f <- 4 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] NA # Expected ## Vector example sd_w <- c(lubridate::dhours(4), lubridate::dhours(7)) sd_f <- c(lubridate::dhours(12), lubridate::dhours(9)) n_w <- c(3, 4) n_f <- c(2, 4) sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "25920s (~7.2 hours)" "28800s (~8 hours)" # Expected ## Checking second output from vector example if (requireNamespace("stats", quietly = TRUE)) { i <- 2 x <- c(sd_w[i], sd_f[i]) w <- c(n_w[i], n_f[i]) lubridate::as.duration(stats::weighted.mean(x, w)) } #> [1] "28800s (~8 hours)" # Expected ## Converting the output to 'hms' sd_w <- lubridate::dhours(4.75) sd_f <- lubridate::dhours(10) n_w <- 5 n_f <- 2 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "22500s (~6.25 hours)" # Expected hms::as_hms(as.numeric(sd_overall(sd_w, sd_f, n_w, n_f))) #> 06:15:00 # Expected ## Rounding the output at the seconds level sd_w <- lubridate::dhours(5.9874) sd_f <- lubridate::dhours(9.3) n_w <- 3 n_f <- 2 sd_overall(sd_w, sd_f, n_w, n_f) #> [1] "26324.784s (~7.31 hours)" # Expected mctq:::round_time(sd_overall(sd_w, sd_f, n_w, n_f)) #> [1] "26325s (~7.31 hours)" # Expected
sd_week()
computes the average weekly sleep duration for the standard
and micro versions of the Munich ChronoType Questionnaire (MCTQ).
See sd_overall()
to compute the overall sleep
duration of a particular shift for the shift version of the MCTQ.
sd_week(sd_w, sd_f, wd)
sd_week(sd_w, sd_f, wd)
sd_w |
A |
sd_f |
A |
wd |
An integerish
|
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
A Duration
object corresponding to the
vectorized weighted mean of sd_w
and sd_f
with wd
and fd(wd)
as
weights.
Roenneberg, Allebrandt, Merrow, & Vetter (2012), Ghotbi et al. (2020), and
The Worldwide Experimental Platform (n.d.) guidelines for sd_week()
() computation are as follows.
The average weekly sleep duration is the weighted average of the sleep durations on work and work-free days in a week.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Average weekly sleep duration.
= Sleep duration on workdays.
= Sleep duration on work-free days.
= Number of workdays per week ("I have a regular work schedule and
work ___ days per week").
= Number of work-free days per week.
* = Workdays;
= Work-free days.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example sd_w <- lubridate::dhours(4) sd_f <- lubridate::dhours(8) wd <- 5 sd_week(sd_w, sd_f, wd) #> [1] "18514.2857142857s (~5.14 hours)" # Expected sd_w <- lubridate::dhours(7) sd_f <- lubridate::dhours(7) wd <- 4 sd_week(sd_w, sd_f, wd) #> [1] "25200s (~7 hours)" # Expected sd_w <- lubridate::as.duration(NA) sd_f <- lubridate::dhours(10) wd <- 6 sd_week(sd_w, sd_f, wd) #> [1] NA # Expected ## Vector example sd_w <- c(lubridate::dhours(4.5), lubridate::dhours(5.45)) sd_f <- c(lubridate::dhours(8), lubridate::dhours(7.3)) wd <- c(3, 7) sd_week(sd_w, sd_f, wd) #> [1] "23400s (~6.5 hours)" "19620s (~5.45 hours)" # Expected ## Checking second output from vector example if (requireNamespace("stats", quietly = TRUE)) { i <- 2 x <- c(sd_w[i], sd_f[i]) w <- c(wd[i], fd(wd[i])) lubridate::as.duration(stats::weighted.mean(x, w)) } #> [1] "19620s (~5.45 hours)" # Expected ## Converting the output to 'hms' sd_w <- lubridate::dhours(5.45) sd_f <- lubridate::dhours(9.5) wd <- 5 x <- sd_week(sd_w, sd_f, wd) x #> [1] "23785.7142857143s (~6.61 hours)" # Expected hms::as_hms(as.numeric(x)) #> 06:36:25.714286 # Expected ## Rounding the output at the seconds level sd_w <- lubridate::dhours(4.5) sd_f <- lubridate::dhours(7.8) wd <- 3 sd_week(sd_w, sd_f, wd) #> [1] "22988.5714285714s (~6.39 hours)" # Expected mctq:::round_time(sd_week(sd_w, sd_f, wd)) #> [1] "22989s (~6.39 hours)" # Expected
## Scalar example sd_w <- lubridate::dhours(4) sd_f <- lubridate::dhours(8) wd <- 5 sd_week(sd_w, sd_f, wd) #> [1] "18514.2857142857s (~5.14 hours)" # Expected sd_w <- lubridate::dhours(7) sd_f <- lubridate::dhours(7) wd <- 4 sd_week(sd_w, sd_f, wd) #> [1] "25200s (~7 hours)" # Expected sd_w <- lubridate::as.duration(NA) sd_f <- lubridate::dhours(10) wd <- 6 sd_week(sd_w, sd_f, wd) #> [1] NA # Expected ## Vector example sd_w <- c(lubridate::dhours(4.5), lubridate::dhours(5.45)) sd_f <- c(lubridate::dhours(8), lubridate::dhours(7.3)) wd <- c(3, 7) sd_week(sd_w, sd_f, wd) #> [1] "23400s (~6.5 hours)" "19620s (~5.45 hours)" # Expected ## Checking second output from vector example if (requireNamespace("stats", quietly = TRUE)) { i <- 2 x <- c(sd_w[i], sd_f[i]) w <- c(wd[i], fd(wd[i])) lubridate::as.duration(stats::weighted.mean(x, w)) } #> [1] "19620s (~5.45 hours)" # Expected ## Converting the output to 'hms' sd_w <- lubridate::dhours(5.45) sd_f <- lubridate::dhours(9.5) wd <- 5 x <- sd_week(sd_w, sd_f, wd) x #> [1] "23785.7142857143s (~6.61 hours)" # Expected hms::as_hms(as.numeric(x)) #> 06:36:25.714286 # Expected ## Rounding the output at the seconds level sd_w <- lubridate::dhours(4.5) sd_f <- lubridate::dhours(7.8) wd <- 3 sd_week(sd_w, sd_f, wd) #> [1] "22988.5714285714s (~6.39 hours)" # Expected mctq:::round_time(sd_week(sd_w, sd_f, wd)) #> [1] "22989s (~6.39 hours)" # Expected
)sd24()
computes the 24 hours sleep duration for the shift version of
the Munich ChronoType Questionnaire (MCTQ).
sd24(sd, napd, nap)
sd24(sd, napd, nap)
sd |
A |
napd |
A |
nap |
A |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
If nap == TRUE
, a Duration
object
corresponding to the vectorized sum of sd
and napd
in a circular time
frame of 24 hours.
If nap == FALSE
, a Duration
object equal to
sd
.
Juda, Vetter & Roenneberg (2013) and The Worldwide Experimental Platform
(n.d.) guidelines for sd24()
() computation are as follows.
This computation must be applied to each section of the questionnaire.
If the respondent don't usually take a nap in a particular shift or
between two free days after a particular shift, sd24()
will return only
.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= 24 hours sleep duration between two days in a
particular shift or between two free days after a particular shift.
= Sleep duration between two days in a particular
shift or between two free days after a particular shift.
= Nap duration between two days in a particular
shift or between two free days after a particular shift.
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example sd <- lubridate::dhours(6) napd <- lubridate::dhours(0.5) nap <- TRUE sd24(sd, napd, nap) #> [1] "23400s (~6.5 hours)" # Expected sd <- lubridate::dhours(9) napd <- lubridate::dhours(1.5) nap <- TRUE sd24(sd, napd, nap) #> [1] "37800s (~10.5 hours)" # Expected sd <- lubridate::dhours(6.5) napd <- lubridate::as.duration(NA) nap <- FALSE sd24(sd, napd, nap) #> [1] "23400s (~6.5 hours)" # Expected sd <- lubridate::as.duration(NA) napd <- lubridate::dhours(2.3) nap <- TRUE sd24(sd, napd, nap) #> [1] NA # Expected ## Vector example sd <- c(lubridate::dhours(7.5), lubridate::dhours(8)) napd <- c(lubridate::dhours(0.75), lubridate::dhours(1)) nap <- c(TRUE, TRUE) sd24(sd, napd, nap) #> [1] "29700s (~8.25 hours)" "32400s (~9 hours)" # Expected
## Scalar example sd <- lubridate::dhours(6) napd <- lubridate::dhours(0.5) nap <- TRUE sd24(sd, napd, nap) #> [1] "23400s (~6.5 hours)" # Expected sd <- lubridate::dhours(9) napd <- lubridate::dhours(1.5) nap <- TRUE sd24(sd, napd, nap) #> [1] "37800s (~10.5 hours)" # Expected sd <- lubridate::dhours(6.5) napd <- lubridate::as.duration(NA) nap <- FALSE sd24(sd, napd, nap) #> [1] "23400s (~6.5 hours)" # Expected sd <- lubridate::as.duration(NA) napd <- lubridate::dhours(2.3) nap <- TRUE sd24(sd, napd, nap) #> [1] NA # Expected ## Vector example sd <- c(lubridate::dhours(7.5), lubridate::dhours(8)) napd <- c(lubridate::dhours(0.75), lubridate::dhours(1)) nap <- c(TRUE, TRUE) sd24(sd, napd, nap) #> [1] "29700s (~8.25 hours)" "32400s (~9 hours)" # Expected
sdu()
computes the sleep duration for standard, micro, and shift
versions of the Munich ChronoType Questionnaire (MCTQ).
Please note that, although we tried to preserve the original authors' naming
pattern for the MCTQ functions, the name sd
provokes a dangerous name
collision with the widely used sd()
function (standard
deviation). That's why we named it sdu
. sdu()
and msl()
are the only exceptions, all the other mctq
functions maintain a strong
naming resemblance with the original authors' naming pattern.
sdu(so, se)
sdu(so, se)
so |
An |
se |
An |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
A Duration
object corresponding to the
vectorized difference between se
and so
in a circular time frame of 24
hours.
Roenneberg, Allebrandt, Merrow, & Vetter (2012), Ghotbi et al. (2020), Juda,
Vetter, & Roenneberg (2013), and The Worldwide Experimental Platform (n.d.)
guidelines for sdu()
() computation are as follows.
This computation must be applied to each section of the questionnaire.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Sleep duration on work or work-free days.
= Local time of sleep end on work or work-free days.
= Local time of sleep onset on work or work-free days.
* = Workdays;
= Work-free days.
Where:
= Sleep duration between two days in a particular
shift or between two free days after a particular shift.
= Local time of sleep end between two days in a
particular shift or between two free days after a particular shift.
= Local time of sleep onset between two days in a
particular shift or between two free days after a particular shift.
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example so <- hms::parse_hm("23:00") se <- hms::parse_hm("08:00") sdu(so, se) #> [1] "32400s (~9 hours)" # Expected so <- hms::parse_hm("02:00") se <- hms::parse_hm("12:30") sdu(so, se) #> [1] "37800s (~10.5 hours)" # Expected so <- hms::parse_hm("03:15") se <- hms::as_hms(NA) sdu(so, se) #> [1] NA # Expected ## Vector example so <- c(hms::parse_hm("04:12"), hms::parse_hm("21:20")) se <- c(hms::parse_hm("14:30"), hms::parse_hm("03:45")) sdu(so, se) #> [1] "37080s (~10.3 hours)" "23100s (~6.42 hours)" # Expected
## Scalar example so <- hms::parse_hm("23:00") se <- hms::parse_hm("08:00") sdu(so, se) #> [1] "32400s (~9 hours)" # Expected so <- hms::parse_hm("02:00") se <- hms::parse_hm("12:30") sdu(so, se) #> [1] "37800s (~10.5 hours)" # Expected so <- hms::parse_hm("03:15") se <- hms::as_hms(NA) sdu(so, se) #> [1] NA # Expected ## Vector example so <- c(hms::parse_hm("04:12"), hms::parse_hm("21:20")) se <- c(hms::parse_hm("14:30"), hms::parse_hm("03:45")) sdu(so, se) #> [1] "37080s (~10.3 hours)" "23100s (~6.42 hours)" # Expected
datasetA fictional dataset, for testing and learning purposes, composed of basic/measurable and computed variables of the Munich ChronoType Questionnaire (MCTQ) shift version.
This data was created following the guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the guidelines found in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), Jankowski (2017), and The Worldwide Experimental Platform (n.d.). See the References and Details sections to learn more.
shift_mctq
shift_mctq
A tibble
with 135 columns and 50 rows:
A unique integer
value to identify each respondent in
the dataset.
Type: Control.
R class: integer
.
Number of days worked in morning shifts within a shift cycle.
Type: Basic.
R class: integer
.
Local time of going to bed on workdays between two morning shifts.
Statement (EN
): "I go to bed at ___ o'clock'".
Type: Basic.
R class: hms
.
Local time of preparing to sleep on workdays between two morning
shifts.
Statement (EN
): "I actually get ready to fall asleep at ___ o'clock".
Type: Basic.
R class: hms
.
Sleep latency or time to fall asleep after preparing to sleep on workdays
between two morning shifts.
Statement (EN
): "I need ___ minutes to fall asleep".
Type: Basic.
R class: Duration
.
Local time of sleep onset on workdays between two morning shifts.
Type: Computed.
R class: hms
.
Local time of sleep end on workdays between two morning shifts.
Statement (EN
): "I wake up at ___ o'clock".
Type: Basic.
R class: hms
.
Time to get up on workdays between two morning shifts.
Statement (EN
): "I get up after ___ minutes".
Type: Basic.
R class: Duration
.
Local time of getting out of bed on workdays between two morning
shifts.
Type: Computed.
R class: hms
.
A logical
value indicating if the respondent uses an
alarm clock to wake up on workdays between two morning shifts.
Statement (EN
): "I wake up at ___ o'clock: ( ___ ) with alarm ( ___ )
without alarm".
Type: Basic.
R class: logical
.
A logical
value indicating if the respondent has any
particular reasons for why they cannot freely choose their sleep times
on workdays between two morning shifts.
Statement (EN
): "There are particular reasons why I cannot freely
choose my sleep times on morning shifts: Yes ( ___ ) No ( ___ )".
Type: Basic.
R class: logical
.
Particular reasons for why the respondent cannot freely choose their sleep
times on workdays between two morning shifts.
Statement (EN
): "If "Yes": Child(ren)/pet(s) ( ___ ) Hobbies ( ___ )
Others, for example: ___".
Type: Basic.
R class: character
.
Sleep duration on workdays between two morning shifts.
Type: Computed.
R class: Duration
.
Total time in bed on workdays between two morning shifts.
Type: Computed.
R class: Duration
.
Local time of mid-sleep on workdays between two morning shifts.
Type: Computed.
R class: hms
.
A logical
value indicating if the respondent usually
takes a nap on workdays between two morning shifts.
Statement (EN
): "I usually take a nap: Yes ( ___ ) No ( ___ )".
Type: Basic.
R class: logical
.
Local time of nap onset on workdays between two morning shifts.
Statement (EN
): "If "Yes": I take a nap from ___ o'clock to ___ o'clock".
Type: Basic.
R class: hms
.
Local time of nap end on workdays between two morning shifts.
Statement (EN
): "If "Yes": I take a nap from ___ o'clock to ___ o'clock".
Type: Basic.
R class: hms
.
Nap duration on workdays between two morning shifts.
Type: Computed.
R class: Duration
.
24 hours sleep duration (sleep duration + nap duration) on workdays
between two morning shifts.
Type: Computed.
R class: Duration
.
Number of free days after working in morning shifts within a shift
cycle.
Type: Basic.
R class: integer
.
Local time of going to bed on work-free days between two free days after
morning shifts.
Statement (EN
): "I go to bed at ___ o'clock'".
Type: Basic.
R class: hms
.
Local time of preparing to sleep on work-free days between two free days
after morning shifts.
Statement (EN
): "I actually get ready to fall asleep at ___ o'clock".
Type: Basic.
R class: hms
.
Sleep latency or time to fall asleep after preparing to sleep on work-free
days between two free days after morning shifts.
Statement (EN
): "I need ___ minutes to fall asleep".
Type: Basic.
R class: Duration
.
Local time of sleep onset on work-free days between two free days after
morning shifts.
Type: Computed.
R class: hms
.
Local time of sleep end on work-free days between two free days after
morning shifts.
Statement (EN
): "I wake up at ___ o'clock".
Type: Basic.
R class: hms
.
Time to get up on work-free days between two free days after morning
shifts.
Statement (EN
): "I get up after ___ minutes".
Type: Basic.
R class: Duration
.
Local time of getting out of bed on work-free days between two free days
after morning shifts.
Type: Computed.
R class: hms
.
A logical
value indicating if the respondent uses an
alarm clock to wake up on work-free days between two free days after
morning shifts.
Statement (EN
): "I wake up at ___ o'clock: ( ___ ) with alarm ( ___ )
without alarm".
Type: Basic.
R class: logical
.
A logical
value indicating if the respondent has any
particular reasons for why they cannot freely choose their sleep times
on work-free days between two free days after morning shifts.
Statement (EN
): "There are particular reasons why I cannot freely
choose my sleep times on morning shifts: Yes ( ___ ) No ( ___ )".
Type: Basic.
R class: logical
.
Particular reasons for why the respondent cannot freely choose their sleep
times on work-free days between two free days after morning shifts.
Statement (EN
): "If "Yes": Child(ren)/pet(s) ( ___ ) Hobbies ( ___ )
Others, for example: ___".
Type: Basic.
R class: character
.
Sleep duration on work-free days between two free days after morning
shifts.
Type: Computed.
R class: Duration
.
Total time in bed on work-free days between two free days after morning
shifts.
Type: Computed.
R class: Duration
.
Local time of mid-sleep on work-free days between two free days after
morning shifts.
Type: Computed.
R class: hms
.
A logical
value indicating if the respondent usually
takes a nap on work-free days between two free days after morning
shifts.
Statement (EN
): "I usually take a nap: Yes ( ___ ) No ( ___ )".
Type: Basic.
R class: logical
.
Local time of nap onset on work-free days between two free days after
morning shifts.
Statement (EN
): "If "Yes": I take a nap from ___ o'clock to ___ o'clock".
Type: Basic.
R class: hms
.
Local time of nap end on work-free days between two free days after
morning shifts.
Statement (EN
): "If "Yes": I take a nap from ___ o'clock to ___ o'clock".
Type: Basic.
R class: hms
.
Nap duration on work-free days between two free days after morning
shifts.
Type: Computed.
R class: Duration
.
24 hours sleep duration (sleep duration + nap duration) on work-free days
between two free days after morning shifts.
Type: Computed.
R class: Duration
.
Overall sleep duration considering workdays between two morning shifts
and work-free days between two free days after morning shifts.
Type: Computed.
R class: Duration
.
Corrected local time of mid-sleep on work-free days between two free days
after morning shifts.
Type: Computed.
R class: hms
.
Relative social jetlag considering workdays between two morning shifts
and work-free days between two free days after morning shifts.
Type: Computed.
R class: Duration
.
Absolute social jetlag considering workdays between two morning shifts
and work-free days between two free days after morning shifts.
Type: Computed.
R class: Duration
.
Jankowski's relative sleep-corrected social jetlag considering workdays
between two morning shifts and work-free days between two free days
after morning shifts.
Type: Computed.
R class: Duration
.
Jankowski's sleep-corrected social jetlag considering workdays between
two morning shifts and work-free days between two free days after
morning shifts.
Type: Computed.
R class: Duration
.
For brevity, the subsequent variables, except for sjl_weighted and
sjl_sc_weighted (described below), are not shown here. That's because
they have the same configurations of the variables shown above, differing
only by shift (evening shift (_e
) and night shift (_n
)).
Absolute social jetlag across all shifts.
Type: Computed.
R class: Duration
.
#'
Jankowski's sleep-corrected social jetlag across all shifts.
Type: Computed.
R class: Duration
.
shift_mctq
is a tidied, validated, and transformed version of
raw_data("shift_mctq.csv")
.
To learn more about the Munich ChronoType Questionnaire (MCTQ), see Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), Roenneberg et al. (2015), and Roenneberg, Pilz, Zerbini, & Winnebeck (2019).
To know about different MCTQ versions, see Juda, Vetter, & Roenneberg (2013) and Ghotbi et al. (2020).
To learn about the sleep-corrected social jetlag, see Jankowski (2017).
If you're curious about the variable computations and want to have access to the full questionnaire, see The Worldwide Experimental Platform (n.d.).
This dataset was created by randomized sampling (see
random_mctq()
) and by manual insertions of special
cases. Its purpose is to demonstrate common cases and data issues that
researchers may find in their MCTQ data, in addition to be a suggested data
structure for MCTQ data.
You can see the shift_mctq
build and data wrangling processes
here.
The naming of the variables took into account the naming scheme used in MCTQ publications, in addition to the guidelines of the tidyverse style guide.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the hms
and lubridate package.
Duration
objectsIf you prefer to view Duration
objects as
hms
objects, run
pretty_mctq(shift_mctq)
.
Created by Daniel Vartanian (package author).
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Jankowski K. S. (2017). Social jet lag: sleep-corrected formula. Chronobiology International, 34(4), 531-535. doi:10.1080/07420528.2017.1299162
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Keller, L. K., Fischer, D., Matera, J. L., Vetter, C., & Winnebeck, E. C. (2015). Human activity and rest in situ. In A. Sehgal (Ed.), Methods in Enzymology (Vol. 552, pp. 257-283). Academic Press. doi:10.1016/bs.mie.2014.11.028
Roenneberg, T., Pilz, L. K., Zerbini, G., & Winnebeck, E. C. (2019). Chronotype and social jetlag: a (self-) critical review. Biology, 8(3), 54. doi:10.3390/biology8030054
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other datasets:
micro_mctq
,
std_mctq
sjl()
computes the relative or absolute social jetlag for standard,
micro, and shift versions of the Munich ChronoType Questionnaire (MCTQ).
sjl_rel()
is just a wrapper for sjl()
with abs = FALSE
.
sjl(msw, msf, abs = TRUE, method = "shorter") sjl_rel(msw, msf, method = "shorter")
sjl(msw, msf, abs = TRUE, method = "shorter") sjl_rel(msw, msf, method = "shorter")
msw |
An |
msf |
An |
abs |
(optional) a |
method |
(optional) a string indicating which method the function must
use to compute the social jetlag. See the Methods section to learn
more (default: |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
If abs = TRUE
, a Duration
object corresponding
to the absolute social jetlag.
If abs = FALSE
, a Duration
object
corresponding to the relative social jetlag.
The output may also vary depending on the method
used.
Roenneberg, Allebrandt, Merrow, & Vetter (2012), Juda, Vetter, & Roenneberg
(2013), and The Worldwide Experimental Platform (n.d.) guidelines for sjl()
( and
) computation are as follows.
For MCTQ, the computation below must be applied to
each shift section of the questionnaire.
Due to time arithmetic issues, sjl()
does a slightly different
computation by default than those proposed by the authors mentioned above.
See vignette("sjl-computation", package = "mctq")
for more details.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Relative social jetlag.
= Absolute social jetlag.
= Local time of mid-sleep on workdays.
= Local time of mid-sleep on work-free days.
* = Workdays;
= Work-free days.
Where:
= Relative social jetlag in a particular shift.
= Absolute social jetlag in a particular shift.
= Local time of mid-sleep between two days in a
particular shift.
= Local time of mid-sleep between two free days after a
particular shift.
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
There are different approaches to compute the social jetlag (). By
default,
sjl()
uses an approach that we call "the shorter interval
approach" ("shorter"
).
The topics below provide a simple explanation of each method supported by
sjl()
. To get a detail understating of this methods, see
vignette("sjl-computation", package = "mctq")
.
"difference"
By using method = "difference"
, sjl()
will do the exact computation
proposed by the MCTQ authors, i.e., will be computed as the linear
difference between
and
(see the Guidelines section).
We do not recommend using this method, as it has many limitations.
"shorter"
This is the default method for sjl()
. It's based on the shorter
interval between and
, solving most of the issues
relating to
computation.
"longer"
The "longer"
method uses the same logic of the "shorter"
method, but,
instead of using the shorter interval between and
, it
uses the longer interval between the two, considering a two-day window.
This method may help in special contexts, like when dealing with shift-workers that have a greater than 12 hours distance between their mid-sleep hours.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Jankowski K. S. (2017). Social jet lag: sleep-corrected formula. Chronobiology International, 34(4), 531-535. doi:10.1080/07420528.2017.1299162
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Pilz, L. K., Zerbini, G., & Winnebeck, E. C. (2019). Chronotype and social jetlag: a (self-) critical review. Biology, 8(3), 54. doi:10.3390/biology8030054
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl_sc()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example msw <- hms::parse_hm("03:30") msf <- hms::parse_hm("05:00") sjl(msw, msf) #> [1] "5400s (~1.5 hours)" # Expected sjl(msw, msf, abs = FALSE) #> [1] "5400s (~1.5 hours)" # Expected sjl_rel(msw, msf) # Wrapper function #> [1] "5400s (~1.5 hours)" # Expected msw <- hms::parse_hm("04:30") msf <- hms::parse_hm("23:30") sjl(msw, msf) #> [1] "18000s (~5 hours)" # Expected sjl(msw, msf, abs = FALSE) #> [1] "18000s (~-5 hours)" # Expected sjl_rel(msw, msf) # Wrapper function #> [1] "18000s (~-5 hours)" # Expected msw <- hms::as_hms(NA) msf <- hms::parse_hm("05:15") sjl(msw, msf) #> [1] NA # Expected ## Vector example msw <- c(hms::parse_hm("02:05"), hms::parse_hm("04:05")) msf <- c(hms::parse_hm("23:05"), hms::parse_hm("04:05")) sjl(msw, msf) #> [1] "10800s (~3 hours)" "0s" # Expected sjl(msw, msf, abs = FALSE) #> [1] "-10800s (~-3 hours)" "0s" # Expected sjl_rel(msw, msf) # Wrapper function #> [1] "-10800s (~-3 hours)" "0s" # Expected ## Using different methods msw <- hms::parse_hm("19:15") msf <- hms::parse_hm("02:30") sjl(msw, msf, abs = FALSE, method = "difference") #> [1] "-60300s (~-16.75 hours)" # Expected sjl(msw, msf, abs = FALSE, method = "shorter") # Default method #> [1] "26100s (~7.25 hours)" # Expected sjl(msw, msf, abs = FALSE, method = "longer") #> [1] "-60300s (~-16.75 hours)" # Expected msw <- hms::parse_hm("02:45") msf <- hms::parse_hm("04:15") sjl(msw, msf, abs = FALSE, method = "difference") #> [1] "5400s (~1.5 hours)" # Expected sjl(msw, msf, abs = FALSE, method = "shorter") # Default method #> [1] "5400s (~1.5 hours)" # Expected sjl(msw, msf, abs = FALSE, method = "longer") #> [1] "-81000s (~-22.5 hours)" # Expected ## Converting the output to 'hms' msw <- hms::parse_hm("01:15") msf <- hms::parse_hm("03:25") sjl(msw, msf) #> [1] "7800s (~2.17 hours)" # Expected hms::as_hms(as.numeric(sjl(msw, msf))) #> 02:10:00 # Expected ## Rounding the output at the seconds level msw <- hms::parse_hms("04:19:33.1234") msf <- hms::parse_hms("02:55:05") sjl(msw, msf) #> [1] "5068.12339997292s (~1.41 hours)" # Expected mctq:::round_time(sjl(msw, msf)) #> [1] "5068s (~1.41 hours)" # Expected
## Scalar example msw <- hms::parse_hm("03:30") msf <- hms::parse_hm("05:00") sjl(msw, msf) #> [1] "5400s (~1.5 hours)" # Expected sjl(msw, msf, abs = FALSE) #> [1] "5400s (~1.5 hours)" # Expected sjl_rel(msw, msf) # Wrapper function #> [1] "5400s (~1.5 hours)" # Expected msw <- hms::parse_hm("04:30") msf <- hms::parse_hm("23:30") sjl(msw, msf) #> [1] "18000s (~5 hours)" # Expected sjl(msw, msf, abs = FALSE) #> [1] "18000s (~-5 hours)" # Expected sjl_rel(msw, msf) # Wrapper function #> [1] "18000s (~-5 hours)" # Expected msw <- hms::as_hms(NA) msf <- hms::parse_hm("05:15") sjl(msw, msf) #> [1] NA # Expected ## Vector example msw <- c(hms::parse_hm("02:05"), hms::parse_hm("04:05")) msf <- c(hms::parse_hm("23:05"), hms::parse_hm("04:05")) sjl(msw, msf) #> [1] "10800s (~3 hours)" "0s" # Expected sjl(msw, msf, abs = FALSE) #> [1] "-10800s (~-3 hours)" "0s" # Expected sjl_rel(msw, msf) # Wrapper function #> [1] "-10800s (~-3 hours)" "0s" # Expected ## Using different methods msw <- hms::parse_hm("19:15") msf <- hms::parse_hm("02:30") sjl(msw, msf, abs = FALSE, method = "difference") #> [1] "-60300s (~-16.75 hours)" # Expected sjl(msw, msf, abs = FALSE, method = "shorter") # Default method #> [1] "26100s (~7.25 hours)" # Expected sjl(msw, msf, abs = FALSE, method = "longer") #> [1] "-60300s (~-16.75 hours)" # Expected msw <- hms::parse_hm("02:45") msf <- hms::parse_hm("04:15") sjl(msw, msf, abs = FALSE, method = "difference") #> [1] "5400s (~1.5 hours)" # Expected sjl(msw, msf, abs = FALSE, method = "shorter") # Default method #> [1] "5400s (~1.5 hours)" # Expected sjl(msw, msf, abs = FALSE, method = "longer") #> [1] "-81000s (~-22.5 hours)" # Expected ## Converting the output to 'hms' msw <- hms::parse_hm("01:15") msf <- hms::parse_hm("03:25") sjl(msw, msf) #> [1] "7800s (~2.17 hours)" # Expected hms::as_hms(as.numeric(sjl(msw, msf))) #> 02:10:00 # Expected ## Rounding the output at the seconds level msw <- hms::parse_hms("04:19:33.1234") msf <- hms::parse_hms("02:55:05") sjl(msw, msf) #> [1] "5068.12339997292s (~1.41 hours)" # Expected mctq:::round_time(sjl(msw, msf)) #> [1] "5068s (~1.41 hours)" # Expected
sjl_sc()
computes the Jankowski's (2017) sleep-corrected social jetlag
for standard, micro, and shift versions of the Munich ChronoType
Questionnaire (MCTQ).
sjl_sc_rel()
is just a wrapper for sjl_sc()
with abs = FALSE
.
Please note that the Jankowski (2017) did not proposed a "relative" sleep-corrected social jetlag, but the user may consider using it.
sjl_sc(so_w, se_w, so_f, se_f, abs = TRUE, method = "shorter") sjl_sc_rel(so_w, se_w, so_f, se_f, method = "shorter")
sjl_sc(so_w, se_w, so_f, se_f, abs = TRUE, method = "shorter") sjl_sc_rel(so_w, se_w, so_f, se_f, method = "shorter")
so_w |
An |
se_w |
An |
so_f |
An |
se_f |
An |
abs |
(optional) a |
method |
(optional) a string indicating which method the function must
use to compute the social jetlag. See the Methods section to learn
more (default: |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
If abs = TRUE
, a Duration
object corresponding
to the absolute sleep-corrected social jetlag.
If abs = FALSE
, a Duration
object
corresponding to the relative sleep-corrected social jetlag.
The output may also vary depending on the method
used.
In an article published in 2017, Konrad S. Jankowski argued that the original
formula for computing the social jetlag () captures not only the
misalignment between social and biological time, but also the sleep debt
resulting from sleep deprivation during workdays. Jankowski then proposed the
following guideline for a sleep-corrected social jetlag
(
) computation.
The Jankowski's alternative is disputed. We recommend seeing Roenneberg, Pilz, Zerbini, & Winnebeck (2019) discussion about it (see item 3.4.2).
For MCTQ, the computation below must be applied to
each shift section of the questionnaire.
Due to time arithmetic issues, sjl_sc()
does a slightly different
computation by default than those proposed by the author mentioned above.
See vignette("sjl-computation", package = "mctq")
for more details.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Jankowski's sleep-corrected social jetlag.
= Local time of sleep onset on workdays.
= Local time of sleep end on workdays.
= Local time of sleep onset on work-free days.
= Local time of sleep end on work-free days.
* = Workdays;
= Work-free days.
Where:
= Jankowski's sleep-corrected social jetlag in a
particular shift.
= Local time of sleep onset between two days in a
particular shift.
= Local time of sleep end between two days in a
particular shift.
= Local time of sleep onset between two free days after
a particular shift.
= Local time of sleep end between two free days after a
particular shift.
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
There are different approaches to compute the sleep-corrected social jetlag
(). By default,
sjl_sc()
uses an approach that we
call "the shorter interval approach" ("shorter"
).
The topics below provide a simple explanation of each method supported by
sjl_sc()
. To get a detail understating of this methods, see
vignette("sjl-computation", package = "mctq")
.
"difference"
By using method = "difference"
, sjl_sc()
will do the exact computation
proposed by Jankowski, i.e., will be computed as the
linear difference between
/
and
/
(see the
Guidelines section).
We do not recommend using this method, as it has many limitations.
"shorter"
This is the default method for sjl_sc()
. It's based on the shorter interval
between /
and
/
, solving most of the
issues relating to
computation.
"longer"
The "longer"
method uses the same logic of the "shorter"
method, but,
instead of using the shorter interval between /
and
/
, it uses the longer interval between the two,
considering a two-day window.
This method may help in special contexts, like when dealing with shift-workers that have a greater than 12 hours distance between their sleep hours.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Jankowski K. S. (2017). Social jet lag: sleep-corrected formula. Chronobiology International, 34(4), 531-535. doi:10.1080/07420528.2017.1299162
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Pilz, L. K., Zerbini, G., & Winnebeck, E. C. (2019). Chronotype and social jetlag: a (self-) critical review. Biology, 8(3), 54. doi:10.3390/biology8030054
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_weighted()
,
so()
,
tbt()
## Scalar example so_w <- hms::parse_hm("02:00") se_w <- hms::parse_hm("10:00") so_f <- hms::parse_hm("01:00") se_f <- hms::parse_hm("08:00") sjl_sc(so_w, se_w, so_f, se_f) #> [1] "3600s (~1 hours)" # Expected sjl_sc(so_w, se_w, so_f, se_f, abs = FALSE) #> [1] "-3600s (~-1 hours)" # Expected (negative sjl_sc) sjl_sc_rel(so_w, se_w, so_f, se_f) # Wrapper function #> [1] "-3600s (~-1 hours)" # Expected (negative sjl_sc) sjl(msl(so_w, sdu(so_w, se_w)), msl(so_f, sdu(so_f, se_f))) #> [1] "5400s (~1.5 hours)" # Expected so_w <- hms::parse_hm("22:00") se_w <- hms::parse_hm("06:00") so_f <- hms::parse_hm("01:00") se_f <- hms::parse_hm("06:00") # sd_w > sd_f & se_w <= se_f sjl_sc(so_w, se_w, so_f, se_f) # sjl_sc = | se_f - se_w | #> [1] "0s" # Expected sjl_sc(so_w, se_w, so_f, se_f, abs = FALSE) #> [1] "0s" # Expected sjl_sc_rel(so_w, se_w, so_f, se_f) # Wrapper function #> [1] "0s" # Expected sjl(msl(so_w, sdu(so_w, se_w)), msl(so_f, sdu(so_f, se_f))) #> [1] "5400s (~1.5 hours)" # Expected so_f <- hms::as_hms(NA) sjl_sc(so_w, se_w, so_f, se_f) #> [1] NA # Expected ## Vector example so_w <- c(hms::parse_hm("00:00"), hms::parse_hm("01:00")) se_w <- c(hms::parse_hm("08:00"), hms::parse_hm("07:00")) so_f <- c(hms::parse_hm("01:00"), hms::parse_hm("01:00")) se_f <- c(hms::parse_hm("09:00"), hms::parse_hm("09:00")) sjl_sc(so_w, se_w, so_f, se_f) #> [1] "3600s (~1 hours)" "0s" # Expected sjl_sc(so_w, se_w, so_f, se_f, abs = FALSE) #> [1] "3600s (~1 hours)" "0s" # Expected sjl_sc_rel(so_w, se_w, so_f, se_f) # Wrapper function #> [1] "3600s (~1 hours)" "0s" # Expected sjl(msl(so_w, sdu(so_w, se_w)), msl(so_f, sdu(so_f, se_f))) #> [1] "3600s (~1 hours)" "3600s (~1 hours)" # Expected ## See other examples in '?sjl()'
## Scalar example so_w <- hms::parse_hm("02:00") se_w <- hms::parse_hm("10:00") so_f <- hms::parse_hm("01:00") se_f <- hms::parse_hm("08:00") sjl_sc(so_w, se_w, so_f, se_f) #> [1] "3600s (~1 hours)" # Expected sjl_sc(so_w, se_w, so_f, se_f, abs = FALSE) #> [1] "-3600s (~-1 hours)" # Expected (negative sjl_sc) sjl_sc_rel(so_w, se_w, so_f, se_f) # Wrapper function #> [1] "-3600s (~-1 hours)" # Expected (negative sjl_sc) sjl(msl(so_w, sdu(so_w, se_w)), msl(so_f, sdu(so_f, se_f))) #> [1] "5400s (~1.5 hours)" # Expected so_w <- hms::parse_hm("22:00") se_w <- hms::parse_hm("06:00") so_f <- hms::parse_hm("01:00") se_f <- hms::parse_hm("06:00") # sd_w > sd_f & se_w <= se_f sjl_sc(so_w, se_w, so_f, se_f) # sjl_sc = | se_f - se_w | #> [1] "0s" # Expected sjl_sc(so_w, se_w, so_f, se_f, abs = FALSE) #> [1] "0s" # Expected sjl_sc_rel(so_w, se_w, so_f, se_f) # Wrapper function #> [1] "0s" # Expected sjl(msl(so_w, sdu(so_w, se_w)), msl(so_f, sdu(so_f, se_f))) #> [1] "5400s (~1.5 hours)" # Expected so_f <- hms::as_hms(NA) sjl_sc(so_w, se_w, so_f, se_f) #> [1] NA # Expected ## Vector example so_w <- c(hms::parse_hm("00:00"), hms::parse_hm("01:00")) se_w <- c(hms::parse_hm("08:00"), hms::parse_hm("07:00")) so_f <- c(hms::parse_hm("01:00"), hms::parse_hm("01:00")) se_f <- c(hms::parse_hm("09:00"), hms::parse_hm("09:00")) sjl_sc(so_w, se_w, so_f, se_f) #> [1] "3600s (~1 hours)" "0s" # Expected sjl_sc(so_w, se_w, so_f, se_f, abs = FALSE) #> [1] "3600s (~1 hours)" "0s" # Expected sjl_sc_rel(so_w, se_w, so_f, se_f) # Wrapper function #> [1] "3600s (~1 hours)" "0s" # Expected sjl(msl(so_w, sdu(so_w, se_w)), msl(so_f, sdu(so_f, se_f))) #> [1] "3600s (~1 hours)" "3600s (~1 hours)" # Expected ## See other examples in '?sjl()'
sjl_weighted()
computes the absolute social jetlag across all shifts
for the shift version of the Munich ChronoType Questionnaire (MCTQ).
sjl_weighted(sjl, n_w)
sjl_weighted(sjl, n_w)
sjl |
A |
n_w |
A |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
A Duration
object corresponding to the
vectorized weighted mean of sjl
with n_w
as weights.
The shift version of the MCTQ was developed for shift-workers rotating
through morning-, evening-, and night-shifts, but it also allows adaptations
to other shift schedules (Juda, Vetter, & Roenneberg, 2013). For this reason,
sjl_weighted()
must operate with any shift combination.
Considering the requirement above, sjl_weighted()
was developed to only
accept list
objects as arguments. For this approach to
work, both sjl
and n_w
arguments must be lists with paired elements and
values, i.e., the first element of sjl
(e.g., sjl_m
) must be paired with
the first element of n_w
(e.g., n_w_m
). The function will do the work of
combining them and output a weighted mean.
Juda, Vetter, & Roenneberg (2013) and The Worldwide Experimental Platform
(n.d.) guidelines for sjl_weighted()
() computation are as follows.
The absolute social jetlag across all shifts () is the weighted average of all absolute
social jetlags.
The authors describe an equation for a three-shift schedule, but this may not be your case. That's why this function works a little bit differently (see the Operation section), allowing you to compute a weighted average with any shift combination.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Absolute social jetlag across all shifts.
= Absolute social jetlag in each shift.
= Number of days worked in each shift within a shift
cycle.
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
so()
,
tbt()
## Scalar example sjl <- list(sjl_m = lubridate::dhours(1.25), sjl_e = lubridate::dhours(0.5), sjl_n = lubridate::dhours(3)) n_w <- list(n_w_m = 3, n_w_e = 1, n_w_n = 4) sjl_weighted(sjl, n_w) #> [1] "7312.5s (~2.03 hours)" # Expected sjl <- list(sjl_m = lubridate::dhours(1.25), sjl_e = lubridate::as.duration(NA), sjl_n = lubridate::dhours(3)) n_w <- list(n_w_m = 3, n_w_e = 1, n_w_n = 4) sjl_weighted(sjl, n_w) #> [1] NA # Expected ## Vector example sjl <- list(sjl_m = c(lubridate::dhours(2), lubridate::dhours(2.45)), sjl_e = c(lubridate::dhours(3.21), lubridate::as.duration(NA)), sjl_n = c(lubridate::dhours(1.2), lubridate::dhours(5.32))) n_w <- list(n_w_m = c(1, 3), n_w_e = c(4, 1), n_w_n = c(3, 3)) sjl_weighted(sjl, n_w) #> [1] "8298s (~2.31 hours)" NA # Expected ## Checking the first output from vector example if (requireNamespace("stats", quietly = TRUE)) { i <- 1 x <- c(sjl[["sjl_m"]][i], sjl[["sjl_e"]][i], sjl[["sjl_n"]][i]) w <- c(n_w[["n_w_m"]][i], n_w[["n_w_e"]][i], n_w[["n_w_n"]][i]) lubridate::as.duration(stats::weighted.mean(x, w)) } #> [1] "8298s (~2.31 hours)" # Expected ## Converting the output to hms sjl <- list(sjl_m = lubridate::dhours(0.25), sjl_e = lubridate::dhours(1.2), sjl_n = lubridate::dhours(4.32)) n_w <- list(n_w_m = 4, n_w_e = 2, n_w_n = 1) sjl_weighted(sjl, n_w) #> [1] "3970.28571428571s (~1.1 hours)" # Expected hms::as_hms(as.numeric(sjl_weighted(sjl, n_w))) #> 01:06:10.285714 # Expected ## Rounding the output at the seconds level mctq:::round_time(sjl_weighted(sjl, n_w)) #> [1] "3970s (~1.1 hours)" # Expected mctq:::round_time(hms::as_hms(as.numeric(sjl_weighted(sjl, n_w)))) #> 01:06:10 # Expected
## Scalar example sjl <- list(sjl_m = lubridate::dhours(1.25), sjl_e = lubridate::dhours(0.5), sjl_n = lubridate::dhours(3)) n_w <- list(n_w_m = 3, n_w_e = 1, n_w_n = 4) sjl_weighted(sjl, n_w) #> [1] "7312.5s (~2.03 hours)" # Expected sjl <- list(sjl_m = lubridate::dhours(1.25), sjl_e = lubridate::as.duration(NA), sjl_n = lubridate::dhours(3)) n_w <- list(n_w_m = 3, n_w_e = 1, n_w_n = 4) sjl_weighted(sjl, n_w) #> [1] NA # Expected ## Vector example sjl <- list(sjl_m = c(lubridate::dhours(2), lubridate::dhours(2.45)), sjl_e = c(lubridate::dhours(3.21), lubridate::as.duration(NA)), sjl_n = c(lubridate::dhours(1.2), lubridate::dhours(5.32))) n_w <- list(n_w_m = c(1, 3), n_w_e = c(4, 1), n_w_n = c(3, 3)) sjl_weighted(sjl, n_w) #> [1] "8298s (~2.31 hours)" NA # Expected ## Checking the first output from vector example if (requireNamespace("stats", quietly = TRUE)) { i <- 1 x <- c(sjl[["sjl_m"]][i], sjl[["sjl_e"]][i], sjl[["sjl_n"]][i]) w <- c(n_w[["n_w_m"]][i], n_w[["n_w_e"]][i], n_w[["n_w_n"]][i]) lubridate::as.duration(stats::weighted.mean(x, w)) } #> [1] "8298s (~2.31 hours)" # Expected ## Converting the output to hms sjl <- list(sjl_m = lubridate::dhours(0.25), sjl_e = lubridate::dhours(1.2), sjl_n = lubridate::dhours(4.32)) n_w <- list(n_w_m = 4, n_w_e = 2, n_w_n = 1) sjl_weighted(sjl, n_w) #> [1] "3970.28571428571s (~1.1 hours)" # Expected hms::as_hms(as.numeric(sjl_weighted(sjl, n_w))) #> 01:06:10.285714 # Expected ## Rounding the output at the seconds level mctq:::round_time(sjl_weighted(sjl, n_w)) #> [1] "3970s (~1.1 hours)" # Expected mctq:::round_time(hms::as_hms(as.numeric(sjl_weighted(sjl, n_w)))) #> 01:06:10 # Expected
sloss_week()
computes the weekly sleep loss for the standard and micro
versions of the Munich ChronoType Questionnaire (MCTQ).
sloss_week(sd_w, sd_f, wd)
sloss_week(sd_w, sd_f, wd)
sd_w |
A |
sd_f |
A |
wd |
An integerish
|
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
A Duration
object corresponding to the
weekly sleep loss.
Roenneberg, Allebrandt, Merrow, & Vetter (2012) and The Worldwide
Experimental Platform (n.d.) guidelines for sloss_week()
() computation are as follows.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
: Weekly sleep loss.
= Sleep duration on workdays.
= Sleep duration on work-free days.
= Average weekly sleep duration.
= Number of workdays per week ("I have a regular work schedule and
work ___ days per week").
= Number of work-free days per week.
* = Workdays;
= Work-free days.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
## Scalar example sd_w <- lubridate::dhours(6.5) sd_f <- lubridate::dhours(7) wd <- 4 sloss_week(sd_w, sd_f, wd) #> [1] "3085.71428571429s (~51.43 minutes)" # Expected sd_w <- lubridate::dhours(7) sd_f <- lubridate::dhours(8) wd <- 5 sloss_week(sd_w, sd_f, wd) #> [1] "5142.85714285714s (~1.43 hours)" # Expected sd_w <- lubridate::dhours(NA) sd_f <- lubridate::dhours(9.45) wd <- 7 sloss_week(sd_w, sd_f, wd) #> [1] NA # Expected ## Vector example sd_w <- c(lubridate::dhours(7), lubridate::dhours(8)) sd_f <- c(lubridate::dhours(6.5), lubridate::dhours(8)) wd <- c(2, 0) sloss_week(sd_w, sd_f, wd) #> [1] "2571.42857142857s (~42.86 minutes)" "0s" # Expected ## Converting the output to 'hms' sd_w <- lubridate::dhours(4) sd_f <- lubridate::dhours(5) wd <- 3 sloss_week(sd_w, sd_f, wd) #> [1] "6171.42857142858s (~1.71 hours)" # Expected hms::as_hms(as.numeric(sloss_week(sd_w, sd_f, wd))) #> 01:42:51.428571 # Expected ## Rounding the output at the seconds level sd_w <- lubridate::dhours(5.8743) sd_f <- lubridate::dhours(7.4324) wd <- 6 sloss_week(sd_w, sd_f, wd) #> [1] "4807.85142857144s (~1.34 hours)" # Expected mctq:::round_time(sloss_week(sd_w, sd_f, wd)) #> [1] "4808s (~1.34 hours)" # Expected
## Scalar example sd_w <- lubridate::dhours(6.5) sd_f <- lubridate::dhours(7) wd <- 4 sloss_week(sd_w, sd_f, wd) #> [1] "3085.71428571429s (~51.43 minutes)" # Expected sd_w <- lubridate::dhours(7) sd_f <- lubridate::dhours(8) wd <- 5 sloss_week(sd_w, sd_f, wd) #> [1] "5142.85714285714s (~1.43 hours)" # Expected sd_w <- lubridate::dhours(NA) sd_f <- lubridate::dhours(9.45) wd <- 7 sloss_week(sd_w, sd_f, wd) #> [1] NA # Expected ## Vector example sd_w <- c(lubridate::dhours(7), lubridate::dhours(8)) sd_f <- c(lubridate::dhours(6.5), lubridate::dhours(8)) wd <- c(2, 0) sloss_week(sd_w, sd_f, wd) #> [1] "2571.42857142857s (~42.86 minutes)" "0s" # Expected ## Converting the output to 'hms' sd_w <- lubridate::dhours(4) sd_f <- lubridate::dhours(5) wd <- 3 sloss_week(sd_w, sd_f, wd) #> [1] "6171.42857142858s (~1.71 hours)" # Expected hms::as_hms(as.numeric(sloss_week(sd_w, sd_f, wd))) #> 01:42:51.428571 # Expected ## Rounding the output at the seconds level sd_w <- lubridate::dhours(5.8743) sd_f <- lubridate::dhours(7.4324) wd <- 6 sloss_week(sd_w, sd_f, wd) #> [1] "4807.85142857144s (~1.34 hours)" # Expected mctq:::round_time(sloss_week(sd_w, sd_f, wd)) #> [1] "4808s (~1.34 hours)" # Expected
so()
computes the local time of sleep onset for standard and shift
versions of the Munich ChronoType Questionnaire (MCTQ).
Note that this value is collected directly from the questionnaire if you're
using the MCTQ.
so(sprep, slat)
so(sprep, slat)
sprep |
An |
slat |
A |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
An hms
object corresponding to the vectorized sum of
sprep
and slat
in a circular time frame of 24 hours.
Roenneberg, Allebrandt, Merrow, & Vetter (2012), Juda, Vetter, & Roenneberg
(2013), and The Worldwide Experimental Platform (n.d.) guidelines for so()
() computation are as follows.
This computation must be applied to each section of the questionnaire.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Local time of sleep onset on work or work-free days.
= Local time of preparing to sleep on work or
work-free days ("I actually get ready to fall asleep at ___ o'clock").
= Sleep latency or time to fall asleep after preparing to
sleep on work or work-free days ("I need ___ min to fall asleep").
* = Workdays;
= Work-free days.
Where:
= Local time of sleep onset between two days in a
particular shift or between two free days after a particular shift.
= Local time of preparing to sleep between two
days in a particular shift or between two free days after a particular
shift ("I actually get ready to fall asleep at ___ o'clock").
= Sleep latency or time to fall asleep after
preparing to sleep between two days in a particular shift or between two
free days after a particular shift ("I need ___ min to fall asleep").
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
tbt()
## Scalar example sprep <- hms::parse_hm("22:00") slat <- lubridate::dminutes(15) so(sprep, slat) #> 22:15:00 # Expected sprep <- hms::parse_hm("23:30") slat <- lubridate::dminutes(45) so(sprep, slat) #> 00:15:00 # Expected sprep <- hms::parse_hm("20:45") slat <- lubridate::as.duration(NA) so(sprep, slat) #> NA # Expected ## Vector example sprep <- c(hms::parse_hm("21:30"), hms::parse_hm("22:15")) slat <- c(lubridate::dminutes(45), lubridate::dminutes(5)) so(sprep, slat) #> 22:15:00 # Expected #> 22:20:00 # Expected
## Scalar example sprep <- hms::parse_hm("22:00") slat <- lubridate::dminutes(15) so(sprep, slat) #> 22:15:00 # Expected sprep <- hms::parse_hm("23:30") slat <- lubridate::dminutes(45) so(sprep, slat) #> 00:15:00 # Expected sprep <- hms::parse_hm("20:45") slat <- lubridate::as.duration(NA) so(sprep, slat) #> NA # Expected ## Vector example sprep <- c(hms::parse_hm("21:30"), hms::parse_hm("22:15")) slat <- c(lubridate::dminutes(45), lubridate::dminutes(5)) so(sprep, slat) #> 22:15:00 # Expected #> 22:20:00 # Expected
A fictional dataset, for testing and learning purposes, composed of basic/measurable and computed variables of the Munich ChronoType Questionnaire (MCTQ) standard version.
This data was created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), Jankowski (2017), and The Worldwide Experimental Platform (n.d.). See the References and Details sections to learn more.
std_mctq
std_mctq
A tibble
with 39 columns and 50 rows:
A unique integer
value to identify each respondent in
the dataset.
Type: Control.
R class: integer
.
A logical
value indicating if the respondent has a
regular work schedule.
Statement (EN
): "I have a regular work schedule (this includes being, for
example, a housewife or househusband): Yes ( ___ ) No ( ___ )".
Type: Basic.
R class: logical
.
Number of workdays per week.
Statement (EN
): "I have a regular work schedule and work ___ days per
week".
Type: Basic.
R class: integer
.
Number of work-free days per week.
Type: Computed.
R class: integer
.
Local time of going to bed on workdays.
Statement (EN
): "I go to bed at ___ o'clock'".
Type: Basic.
R class: hms
.
Local time of preparing to sleep on workdays.
Statement (EN
): "I actually get ready to fall asleep at ___ o'clock".
Type: Basic.
R class: hms
.
Sleep latency or time to fall asleep after preparing to sleep on
workdays.
Statement (EN
): "I need ___ minutes to fall asleep".
Type: Basic.
R class: Duration
.
Local time of sleep onset on workdays.
Type: Computed.
R class: hms
.
Local time of sleep end on workdays.
Statement (EN
): "I wake up at ___ o'clock".
Type: Basic.
R class: hms
.
"Sleep inertia" on workdays.
Despite the name, this variable represents the time the respondent takes to
get up after sleep end.
Statement (EN
): "After ___ minutes, I get up".
Type: Basic.
R class: Duration
.
Local time of getting out of bed on workdays.
Type: Computed.
R class: hms
.
A logical
value indicating if the respondent uses an
alarm clock to wake up on workdays.
Statement (EN
): "I use an alarm clock on workdays: Yes ( ___ ) No ( ___
)".
Type: Basic.
R class: logical
.
A logical
value indicating if the respondent regularly
wakes up before the alarm rings on workdays.
Statement (EN
): "If "Yes": I regularly wake up BEFORE the alarm rings:
Yes ( ___ ) No ( ___ )".
Type: Basic.
R class: logical
.
Sleep duration on workdays.
Type: Computed.
R class: Duration
.
Total time in bed on workdays.
Type: Computed.
R class: Duration
.
Light exposure on workdays.
Statement (EN
): "On average, I spend the following amount of time
outdoors in daylight (without a roof above my head)".
Type: Extra.
R class: Duration
.
Local time of mid-sleep on workdays.
Type: Computed.
R class: hms
.
Local time of going to bed on work-free days.
Statement (EN
): "I go to bed at ___ o'clock'".
Type: Basic.
R class: hms
.
Local time of preparing to sleep on work-free days.
Statement (EN
): "I actually get ready to fall asleep at ___ o'clock".
Type: Basic.
R class: hms
.
Sleep latency or time to fall asleep after preparing to sleep on
work-free days.
Statement (EN
): "I need ___ minutes to fall asleep".
Type: Basic.
R class: Duration
.
Local time of sleep onset on work-free days.
Type: Computed.
R class: hms
.
Local time of sleep end on work-free days.
Statement (EN
): "I wake up at ___ o'clock".
Type: Basic.
R class: hms
.
"Sleep inertia" on work-free days.
Despite the name, this variable represents the time the respondent takes to
get up after sleep end.
Statement (EN
): "After ___ minutes, I get up".
Type: Basic.
R class: Duration
.
Local time of getting out of bed on work-free days.
Type: Computed.
R class: hms
.
A logical
value indicating if the respondent uses an
alarm clock to wake up on work-free days.
Statement (EN
): "My wake-up time is due to the use of an alarm
clock: Yes ( ___ ) No ( ___ )".
Type: Basic.
R class: logical
.
A logical
value indicating if the respondent has any
particular reasons for why they cannot freely choose their sleep times
on work-free days.
Statement (EN
): "There are particular reasons why I cannot freely
choose my sleep times on free days: Yes ( ___ ) No ( ___ )".
Type: Basic.
R class: logical
.
Particular reasons for why the respondent cannot freely choose their sleep
times on work-free days.
Statement (EN
): "If "Yes": Child(ren)/pet(s) ( ___ ) Hobbies ( ___ )
Others ( ___ ), for example: ___".
Type: Basic.
R class: character
.
Sleep duration on work-free days.
Type: Computed.
R class: Duration
.
Total time in bed on work-free days.
Type: Computed.
R class: Duration
.
Light exposure on work-free days.
Statement (EN
): "On average, I spend the following amount of time
outdoors in daylight (without a roof above my head)".
Type: Extra.
R class: Duration
.
Local time of mid-sleep on work-free days.
Type: Computed.
R class: hms
.
Average weekly sleep duration.
Type: Computed.
R class: Duration
.
Weekly sleep loss.
Type: Computed.
R class: Duration
.
Average weekly light exposure.
Type: Computed.
R class: Duration
.
Sleep-corrected local time of mid-sleep on work-free days.
Type: Computed.
R class: hms
.
Relative social jetlag.
Type: Computed.
R class: Duration
.
Absolute social jetlag.
Type: Computed.
R class: Duration
.
Jankowski's relative sleep-corrected social jetlag.
Type: Computed.
R class: Duration
.
Jankowski's sleep-corrected social jetlag.
Type: Computed.
R class: Duration
.
std_mctq
is a tidied, validated, and transformed version of
raw_data("std_mctq.csv")
.
To learn more about the Munich ChronoType Questionnaire (MCTQ), see Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), Roenneberg et al. (2015), and Roenneberg, Pilz, Zerbini, & Winnebeck (2019).
To know about different MCTQ versions, see Juda, Vetter, & Roenneberg (2013) and Ghotbi et al. (2020).
To learn about the sleep-corrected social jetlag, see Jankowski (2017).
If you're curious about the variable computations and want to have access to the full questionnaire, see The Worldwide Experimental Platform (n.d.).
This dataset was created by randomized sampling (see
random_mctq()
) and by manual insertions of special
cases. Its purpose is to demonstrate common cases and data issues that
researchers may find in their MCTQ data, in addition to be a suggested data
structure for MCTQ data.
You can see the std_mctq
build and data wrangling processes
here.
The naming of the variables took into account the naming scheme used in MCTQ publications, in addition to the guidelines of the tidyverse style guide.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the hms
and lubridate package.
Duration
objectsIf you prefer to view Duration
objects as
hms
objects, run
pretty_mctq(std_mctq)
.
Created by Daniel Vartanian (package author).
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Jankowski K. S. (2017). Social jet lag: sleep-corrected formula. Chronobiology International, 34(4), 531-535. doi:10.1080/07420528.2017.1299162
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Keller, L. K., Fischer, D., Matera, J. L., Vetter, C., & Winnebeck, E. C. (2015). Human activity and rest in situ. In A. Sehgal (Ed.), Methods in Enzymology (Vol. 552, pp. 257-283). Academic Press. doi:10.1016/bs.mie.2014.11.028
Roenneberg, T., Pilz, L. K., Zerbini, G., & Winnebeck, E. C. (2019). Chronotype and social jetlag: a (self-) critical review. Biology, 8(3), 54. doi:10.3390/biology8030054
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other datasets:
micro_mctq
,
shift_mctq
tbt()
computes the total time in bed for standard and shift versions of
the Munich ChronoType Questionnaire (MCTQ).
tbt(bt, gu)
tbt(bt, gu)
bt |
An |
gu |
An |
Standard MCTQ functions were created following the guidelines in Roenneberg, Wirz-Justice, & Merrow (2003), Roenneberg, Allebrandt, Merrow, & Vetter (2012), and from The Worldwide Experimental Platform (theWeP, n.d.).
MCTQ functions were created following the guidelines in Ghotbi
et al. (2020), in addition to the guidelines used for the standard MCTQ.
MCTQ functions were created following the
guidelines in Juda, Vetter, & Roenneberg (2013), in addition to the
guidelines used for the standard MCTQ.
See the References section to learn more.
The mctq
package works with a set of object classes specially created to
hold time values. These classes can be found in the
lubridate and hms
packages. Please refer to those package documentations to learn more about
them.
Some operations may produce an output with fractional time (e.g.,
"19538.3828571429s (~5.43 hours)"
, 01:15:44.505
). If you want, you
can round it with mctq:::round_time()
.
Our recommendation is to avoid rounding, but, if you do, make sure that you only round your values after all computations are done. That way you avoid round-off errors.
A Duration
object corresponding to the
vectorized difference between gu
and bt
in a circular time frame of 24
hours.
Roenneberg, Allebrandt, Merrow, & Vetter (2012), Juda, Vetter, & Roenneberg
(2013), and The Worldwide Experimental Platform (n.d.) guidelines for tbt()
() computation are as follows.
This computation must be applied to each section of the questionnaire.
If you are visualizing this documentation in plain text, you may have some trouble understanding the equations. You can see this documentation on the package website.
Where:
= Total time in bed on work or work-free days.
= Local time of getting out of bed on work or work-free
days.
= Local time of going to bed on work or work-free days
("I go to bed at ___ o'clock").
* = Workdays;
= Work-free days.
Where:
= Total time in bed between two days in a
particular shift or between two free days after a particular shift.
= Local time of getting out of bed between two days
in a particular shift or between two free days after a particular shift.
= Local time of going to bed between two days in a
particular shift or between two free days after a particular shift ("I
go to bed at ___ o'clock").
* = Workdays;
= Work-free days,
=
Morning shift;
= Evening shift;
= Night shift.
Ghotbi, N., Pilz, L. K., Winnebeck, E. C., Vetter, C., Zerbini, G., Lenssen,
D., Frighetto, G., Salamanca, M., Costa, R., Montagnese, S., & Roenneberg, T.
(2020). The MCTQ: an ultra-short version of the Munich ChronoType
Questionnaire. Journal of Biological Rhythms, 35(1), 98-110.
doi:10.1177/0748730419886986
Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType
Questionnaire for shift-workers (MCTQ). Journal of
Biological Rhythms, 28(2), 130-140. doi:10.1177/0748730412475041
Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. doi:10.1016/j.cub.2012.03.038
Roenneberg, T., Wirz-Justice, A., & Merrow, M. (2003). Life between clocks: daily temporal patterns of human chronotypes. Journal of Biological Rhythms, 18(1), 80-90. doi:10.1177/0748730402239679
The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/
Other MCTQ functions:
fd()
,
gu()
,
le_week()
,
msf_sc()
,
msl()
,
napd()
,
sd24()
,
sd_overall()
,
sd_week()
,
sdu()
,
sjl()
,
sjl_sc()
,
sjl_weighted()
,
so()
## Scalar example bt <- hms::parse_hm("22:10") gu <- hms::parse_hm("06:15") tbt(bt, gu) #> [1] "29100s (~8.08 hours)" # Expected bt <- hms::parse_hm("01:20") gu <- hms::parse_hm("14:00") tbt(bt, gu) #> [1] "45600s (~12.67 hours)" # Expected bt <- hms::as_hms(NA) gu <- hms::parse_hm("07:20") tbt(bt, gu) #> [1] NA # Expected ## Vector example bt <- c(hms::parse_hm("23:50"), hms::parse_hm("02:30")) gu <- c(hms::parse_hm("09:30"), hms::parse_hm("11:25")) tbt(bt, gu) #> [1] "34800s (~9.67 hours)" "32100s (~8.92 hours)" # Expected
## Scalar example bt <- hms::parse_hm("22:10") gu <- hms::parse_hm("06:15") tbt(bt, gu) #> [1] "29100s (~8.08 hours)" # Expected bt <- hms::parse_hm("01:20") gu <- hms::parse_hm("14:00") tbt(bt, gu) #> [1] "45600s (~12.67 hours)" # Expected bt <- hms::as_hms(NA) gu <- hms::parse_hm("07:20") tbt(bt, gu) #> [1] NA # Expected ## Vector example bt <- c(hms::parse_hm("23:50"), hms::parse_hm("02:30")) gu <- c(hms::parse_hm("09:30"), hms::parse_hm("11:25")) tbt(bt, gu) #> [1] "34800s (~9.67 hours)" "32100s (~8.92 hours)" # Expected