Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New categorical age, depression, and influenza variables #64

Merged
merged 25 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1c7fddf
10 yrs age categories added to variable_details and variables.
esucha Feb 25, 2020
be6ac61
[Feature] remove cran-release file
wyusuf068 Mar 30, 2020
e78fc69
[Refactor] add cat labels for DHHGAGE_C
wyusuf068 Jun 10, 2020
029ede8
[Bug] fix incorrect recFrom range
wyusuf068 Jul 23, 2020
868f4d6
[feature] new variable DHHGAGE_5
DougManuel Aug 27, 2020
6fe42ea
Merge branch 'dev' into Ewa
DougManuel Aug 27, 2020
7d12759
[Refactor] minor corrections to specification of age variables
wyusuf068 Aug 28, 2020
e9e4788
[Refactor] minor corrections to catStartLabel
wyusuf068 Aug 28, 2020
87bf797
Merge pull request #61 from Big-Life-Lab/Ewa
wyusuf068 Aug 28, 2020
9375a71
[Feature] add depression variables: DPSDPP, DPSDSF
wyusuf068 Sep 1, 2020
c477970
[Feature] add DIS_10G, DIS_10H, DPSDMT, DPSDWK
wyusuf068 Sep 3, 2020
2d00495
[Feature] add depression variables DPS_02-DPS_14
wyusuf068 Sep 5, 2020
213b517
[Feature] add influenza variables
wyusuf068 Sep 8, 2020
0f75698
[Feature] add role column to variables.csv
wyusuf068 Sep 8, 2020
0ff6e74
[Refactor] change recFrom to interval notation
wyusuf068 Sep 9, 2020
74d326b
[Refactor] Updated to latest rec_with_table version
rvyuha Sep 9, 2020
e0c9fd3
[Refactor] remove interval brackets from single values
wyusuf068 Sep 9, 2020
551f69f
[Feature] Modified rec_with_table to support intervals in recFrom column
rvyuha Sep 9, 2020
36e1729
[Refactor] update recFrom documentation to reflect changes in interva…
wyusuf068 Sep 10, 2020
5ccf3bc
[Feature] add documentation for DPSDSF and DPSDPP
wyusuf068 Sep 10, 2020
659e521
[Feature] update changelog
wyusuf068 Sep 10, 2020
13a2544
[Feature] update .RData & .Rd files
wyusuf068 Sep 10, 2020
d49f111
[Bug] Fixed range being ignored
rvyuha Sep 10, 2020
739fff2
[Feature] update rda's, testdata, description
wyusuf068 Sep 11, 2020
c403e6f
[Feature] build site for release
wyusuf068 Sep 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CRAN-RELEASE

This file was deleted.

4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: cchsflow
Type: Package
Title: Transforming and Harmonizing CCHS Variables
Version: 1.6.0
Date: 2020-03-30
Version: 1.7.0
Date: 2020-09-11
Authors@R: c(
person(given = "Doug",
family = "Manuel",
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export(ALCDTTM)
export(ALCDTYP)
export(ALWDDLY)
export(ALWDWKY)
export(DPSDPP)
export(DPSDSF)
export(GEN_02A2)
export(RACDPAL_fun)
export(adl_fun)
Expand Down
62 changes: 61 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,64 @@
# cchsflow 1.6.0 (Latest build)
# cchsflow 1.7.0 (Latest build)
2020-09-11

## Breaking changes
- Notation in **recFrom** column of `variable_details.csv` is now changed to
interval notation (e.g. 7:9 is now denoted as [7,9]).

## Features
- New `description` column added to `variables.csv` to allow a description of
variables.
- New `role` column added to `variables.csv` to allow users to set roles for
variable manipulation.

## New variables
Age:
1. DHHGAGE_5: age variable categorized into 5 20-year age groups. Used in all
CCHS cycles.
2. DHHGAGE_D: age variable categorized into 8 10-year age groups. Used in all
CCHS cycles.

Depression:
1. DPSDPP: Depression Scale - Predicted Probability. Used in all CCHS cycles.
2. DPSDSF: Depression Scale - Short Form Score. Used in all CCHS cycles
3. DIS_10G: Frequency - distress: felt sad / depressed - past month. Used in
CCHS cycles 2005-2014.
4. DIS_10H: Frequency - distress: depressed/nothing cheers - past month. Used in
CCHS cycles 2005-2014.
5. DPSDMT: Specific month when felt depressed. Used in all CCHS cycles.
6. DPSDWK: Number of weeks felt depressed - (D). Used in all CCHS cycles.
7. DPS_02: Felt sad/blue/depressed - 2 weeks or more - 12 mo. Used in CCHS
cycles 2007-2012.
8. DPS_03: Sad/depressed - length feelings lasted - 2 wk. Used in CCHS cycles
2007-2012.
9. DPS_04: Sad/depressed - frequency - 2 wk. Used in CCHS cycles 2007-2012.
10. DPS_05: Sad/depressed - lose interest in things - 2 wk. Used in CCHS cycles
2007-2012.
11. DPS_06: Sad/depressed - felt tired out / low on energy - 2 wk. Used in CCHS
cycles 2007-2012.
12. DPS_07: Sad/depressed - weight change - 2 wk. Used in CCHS cycles 2007-2012.
13. DPS_08A: Sad/depressed - weight change (amount) - 2 wk. Used in CCHS cycles
2007-2012.
14. DPS_08B: Sad/depressed - weight change (lb/kg) - 2 wk. Used in CCHS cycles
2007-2012.
15. DPS_09: Sad/depressed - trouble falling asleep - 2 wk. Used in CCHS cycles
2007-2012.
16. DPS_10: Sad/depressed trouble falling asleep - frequency - 2 wk. Used in
CCHS cycles 2007-2012.
17. DPS_11: Sad/depressed - trouble concentrating - 2 wk. Used in CCHS cycles
2007-2012.
18. DPS_12: Sad/depressed - felt down on self - 2 wk. Used in CCHS cycles
2007-2012.
19. DPS_13: Sad/depressed - thought a lot about death - 2 wk. Used in CCHS
cycles 2007-2012.
20. DPS_14: Sad/depressed - number of weeks - 12 mo. Used in CCHS cycles
2007-2012.

Influenza:
1. FLU_160: Ever had a flu shot. Used in all CCHS cycles.
2. FLU_162: Last time had flu shot. Used in all CCHS cycles.

# cchsflow 1.6.0
2020-03-30

## Breaking changes
Expand Down
65 changes: 65 additions & 0 deletions R/depression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#' @title Derived Depression Scale - Short Form Score
#'
#' @description \strong{NOTE:} this is not a function.
#'
#' This is a continuous variable derived by Statistics Canada that assesses the
#' level of depression of respondents who have identified that they have felt
#' depressed or loss of interest within the last two weeks. This variable is
#' scaled from 0 to 8, with 0 indicating a respondent has not felt depressed or
#' loss of interest, and 8 representing the highest level of depression.
#'
#' @details The derivation of this variable is based on the work of Kessler &
#' Mroczek from the University of Michigan. For more details on the items used
#' and how the variable was derived click \href{https://osf.io/auqwh/}{here}.
#'
#' This variable is present in every CCHS cycle used in cchsflow, and
#' how it was derived remains consistent.
#'
#' @param DPSDSF cchsflow variable name for derived depression scale.
#'
#' @seealso \code{\link{DPSDPP}}
#'
#' @examples
#' library(cchsflow)
#' ?DPSDSF
#'
#' @export
DPSDSF <- function(DPSDSF) {
# this is for documentation purposes only
}

#' @title Depression Scale - Predicted Probability
#'
#' @description \strong{NOTE:} this is not a function.
#'
#' This is categorical variable derived by Statistics Canada that predicts
#' the probability that a respondent would be diagnosed as having a major
#' depressive episode if a diagnostic interview was completed. This variable
#' is derived from \code{\link{DPSDSF}} in which probabilities are assigned
#' to respondents based on their depression scale score. For more details on
#' how the variable was derived click \href{https://osf.io/auqwh/}{here}.
#'
#' @details While this variable was considered to be categorical in CCHS
#' documentation, the values range from 0 to 0.90 with no distinct names or
#' metadata for each category. As such, this variable was specified as a
#' continuous variable in cchsflow. This has no bearing on the final output
#' of the variable as there are no recode changes. This means that a respondent
#' who was coded with a probability of 0.50 will still have a probability value
#' of 0.50 when the variable goes through harmonization.
#'
#' This variable is present in every CCHS cycle used in cchsflow, and
#' how it was derived remains consistent.
#'
#' @param DPSDPP cchsflow variable name for derived depression scale predicted
#' probability.
#'
#' @seealso \code{\link{DPSDSF}}
#'
#' @examples
#' library(cchsflow)
#' ?DPSDPP
#'
#' @export
DPSDPP <- function(DPSDPP) {
# this is for documentation purposes only
}
Loading