Skip to content

Commit

Permalink
Merge pull request #1 from jonkeane/review
Browse files Browse the repository at this point in the history
Some minor documentation suggestions
  • Loading branch information
danielvartan committed May 22, 2021
2 parents 015d500 + 5054146 commit f4f9f57
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions R/shift_mctq.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
#'
#' \item{reasons_w_m}{
#' A `logical` value indicating if the subject has any particular reasons for
#' why he/she __cannot__ freely choose his/her sleep times on workdays
#' why they __cannot__ freely choose their sleep times on workdays
#' __between two morning shifts__.
#' \cr \cr
#' Statement (`EN`): "There are particular reasons why I __cannot__ freely
Expand All @@ -164,7 +164,7 @@
#' R class: `logical`.}
#'
#' \item{reasons_why_w_m}{
#' Particular reasons for why the subject cannot freely choose his/her sleep
#' Particular reasons for why the subject cannot freely choose their sleep
#' times on workdays __between two morning shifts__.
#' \cr \cr
#' Statement (`EN`): "If "Yes": Child(ren)/pet(s) ( ___ ) Hobbies ( ___ )
Expand Down Expand Up @@ -326,7 +326,7 @@
#'
#' \item{reasons_f_m}{
#' A `logical` value indicating if the subject has any particular reasons for
#' why he/she __cannot__ freely choose his/her sleep times on work-free days
#' why they __cannot__ freely choose their sleep times on work-free days
#' __between two free days after morning shifts__.
#' \cr \cr
#' Statement (`EN`): "There are particular reasons why I __cannot__ freely
Expand All @@ -337,7 +337,7 @@
#' R class: `logical`.}
#'
#' \item{reasons_why_f_m}{
#' Particular reasons for why the subject cannot freely choose his/her sleep
#' Particular reasons for why the subject cannot freely choose their sleep
#' times on work-free days __between two free days after morning shifts__.
#' \cr \cr
#' Statement (`EN`): "If "Yes": Child(ren)/pet(s) ( ___ ) Hobbies ( ___ )
Expand Down
2 changes: 1 addition & 1 deletion R/sjl.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
#' uses the longer interval between the two, considering a two-day window.
#'
#' This method may help with special contexts, like when dealing with
#' shift-workers that have a greater than 12 hours distance between his/her
#' shift-workers that have a greater than 12 hours distance between their
#' mid-sleep hours.
#'
#' @param msw A `hms` object corresponding to the __local time of mid-sleep on
Expand Down
4 changes: 2 additions & 2 deletions R/std_mctq.R
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
#'
#' \item{reasons_f}{
#' A `logical` value indicating if the subject has any particular reasons for
#' why he/she __cannot__ freely choose his/her sleep times on __work-free
#' why they __cannot__ freely choose their sleep times on __work-free
#' days__.
#' \cr \cr
#' Statement (`EN`): "There are particular reasons why I __cannot__ freely
Expand All @@ -301,7 +301,7 @@
#' R class: `logical`.}
#'
#' \item{reasons_why_f}{
#' Particular reasons for why the subject cannot freely choose his/her sleep
#' Particular reasons for why the subject cannot freely choose their sleep
#' times on __work-free days__.
#' \cr \cr
#' Statement (`EN`): "If "Yes": Child(ren)/pet(s) ( ___ ) Hobbies ( ___ )
Expand Down
2 changes: 1 addition & 1 deletion man-roxygen/section_a.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' @section Missing sections in standard and micro MCTQ versions:
#'
#' Although the standard and micro versions of the MCTQ asks for subjects to
#' complete the workdays and work-free days sections, even when he/she do not
#' complete the workdays and work-free days sections, even when they do not
#' have a regular work schedule (`wd = 0`) or have a 7 day/week work schedule
#' (`wd = 7`), some of them may still end skipping one of this parts of the
#' questionnaire. In those cases, `sd_week()`, `sloss_week()`, `le_week()`,
Expand Down
2 changes: 1 addition & 1 deletion man/le_week.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/msf_sc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/sd_week.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/shift_mctq.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/sjl.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/sloss_week.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/std_mctq.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vignettes/missing-sections.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ It's a good idea to have the standard MCTQ questionnaire and the guidelines for

## Working around missing sections

Although the standard and micro versions of the MCTQ asks for subjects to complete the workdays and work-free days sections, even when he/she do not have a regular work schedule (`wd = 0`) or have a 7 day/week work schedule (`wd = 7`), some of them may still end skipping one of this parts of the questionnaire. In those cases, `sd_week()`, `sloss_week()`, `le_week()`, `msf_sc()`, `sjl_rel()`, and `sjl()` will produce `NA` (Not Available) as output. That's because those computations combine workdays and work-free days variables.
Although the standard and micro versions of the MCTQ asks for subjects to complete the workdays and work-free days sections, even when they do not have a regular work schedule (`wd = 0`) or have a 7 day/week work schedule (`wd = 7`), some of them may still end skipping one of this parts of the questionnaire. In those cases, `sd_week()`, `sloss_week()`, `le_week()`, `msf_sc()`, `sjl_rel()`, and `sjl()` will produce `NA` (Not Available) as output. That's because those computations combine workdays and work-free days variables.

For those special standard and micro MCTQ cases, where one section is missing, a `NA` value is the correct output for the functions mentioned above when `wd` (number of workdays per week) are `wd > 0 & wd < 7`, but it may not be when `wd == 0` or `wd == 7`. While some researches may just invalid these latter cases, we propose a different approach.
For those special standard and micro MCTQ cases, where one section is missing, a `NA` value is the correct output for the functions mentioned above when `wd` (number of workdays per week) are `wd > 0 & wd < 7`, but it may not be when `wd == 0` or `wd == 7`. While some researchers may just invalidate these latter cases, we propose a different approach.

To illustrate this approach, consider the following.

If a subject __do not have a regular work schedule__ (`wd == 0`), __only answered the work-free days section__, and __do not use an alarm clock on his/her free days__ (_i.e_, `alarm_f == FALSE`), it would be fair to assume that there's no sleep correction (`sc`) to be made, therefore, his/her chronotype (`msf_sc`) must be equal to his/her midsleep on work-free days (`msf`).
If a subject __does not have a regular work schedule__ (`wd == 0`), __only answered the work-free days section__, and __does not use an alarm clock on their free days__ (_i.e_, `alarm_f == FALSE`), it would be fair to assume that there's no sleep correction (`sc`) to be made, therefore, their chronotype (`msf_sc`) must be equal to their midsleep on work-free days (`msf`).

Following this same line of thought, we can also say that:

Expand All @@ -40,7 +40,7 @@ Following this same line of thought, we can also say that:

Note that the [chronotype computation](https://www.thewep.org/documentations/mctq/item/mctq-variables) follows a similar line of thought.

The opposite scenario, _i.e._, when the subject __works 7 days per week__ (`wd == 7`) and __only answered the workdays section__, can also have different outputs. `sloss_week()`, `msf_sc()`, `sjl_rel()`, and `sjl()` should still produce a `NA` as output since there's no way to know the real behavior of the subject sleep-wake cycle. But, according to this reasoning, `sd_week` and `le_week` can have different outputs.
The opposite scenario, _i.e._, when the subject __works 7 days per week__ (`wd == 7`) and __only answered the workdays section__, can also have different outputs. `sloss_week()`, `msf_sc()`, `sjl_rel()`, and `sjl()` should still produce a `NA` as output since there's no way to know the real behavior of the subject's sleep-wake cycle. But, according to this reasoning, `sd_week` and `le_week` can have different outputs.

* `sd_week` (average weekly sleep duration) must be equal to `sd_w` (sleep duration on workdays) since the subject does not have work-free days.
* `le_week` (average weekly light exposure) must be equal to `le_w` (light exposure on work-free days) since the subject does not have work-free days.
Expand Down

0 comments on commit f4f9f57

Please sign in to comment.