sd24: Compute MCTQ 24 hours sleep duration (only for MCTQ Shift)

View source: R/sdu.R

sd24R Documentation

Compute MCTQ 24 hours sleep duration (only for MCTQ^{Shift})

Description

[Maturing]

sd24() computes the 24 hours sleep duration for the shift version of the Munich ChronoType Questionnaire (MCTQ).

Usage

sd24(sd, napd, nap)

Arguments

sd

A Duration object corresponding to the sleep duration from the shift version of the MCTQ questionnaire. You can use sdu() to compute it.

napd

A Duration object corresponding to the nap duration from the shift version of the MCTQ questionnaire. You can use napd() to compute it.

nap

A logical value corresponding to the "I usually take a nap" response from the shift version of the MCTQ questionnaire.

Details

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.).

\muMCTQ functions were created following the guidelines in Ghotbi et al. (2020), in addition to the guidelines used for the standard MCTQ.

MCTQ^{Shift} 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.

Class requirements

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.

Rounding and fractional time

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.

Value

  • 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.

Guidelines

Juda, Vetter & Roenneberg (2013) and The Worldwide Experimental Platform (n.d.) guidelines for sd24() (SD24) computation are as follows.

Notes

  • 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 SD_{W/F}^{M/E/N}.

  • 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.

Computation

SD24_{W/F}^{M/E/N} = SD_{W/F}^{M/E/N} + NapD_{W/F}^{M/E/N}

Where:

  • SD24_{W/F}^{M/E/N} = 24 hours sleep duration between two days in a particular shift or between two free days after a particular shift.

  • SD_{W/F}^{M/E/N} = Sleep duration between two days in a particular shift or between two free days after a particular shift.

  • NapD_{W/F}^{M/E/N} = Nap duration between two days in a particular shift or between two free days after a particular shift.

* W = Workdays; F = Work-free days, M = Morning shift; E = Evening shift; N = Night shift.

References

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 \muMCTQ: an ultra-short version of the Munich ChronoType Questionnaire. Journal of Biological Rhythms, 35(1), 98-110. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/0748730419886986")}

Juda, M., Vetter, C., & Roenneberg, T. (2013). The Munich ChronoType Questionnaire for shift-workers (MCTQ^{Shift}). Journal of Biological Rhythms, 28(2), 130-140. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/0748730412475041")}

Roenneberg T., Allebrandt K. V., Merrow M., & Vetter C. (2012). Social jetlag and obesity. Current Biology, 22(10), 939-43. \Sexpr[results=rd]{tools:::Rd_expr_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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/0748730402239679")}

The Worldwide Experimental Platform (n.d.). MCTQ. https://www.thewep.org/documentations/mctq/

See Also

Other MCTQ functions: fd(), gu(), le_week(), msf_sc(), msl(), napd(), sd_overall(), sd_week(), sdu(), sjl(), sjl_sc(), sjl_weighted(), so(), tbt()

Examples

## 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

ropensci/mctq documentation built on Oct. 15, 2024, 2:14 p.m.