diff --git a/.DS_Store b/.DS_Store index 9bab5e58..dea71d61 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/DESCRIPTION b/DESCRIPTION index 149d4631..552c90c4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: cchsflow Type: Package Title: Transforming and harmonizing CCHS variables -Version: 0.2.2 +Version: 0.2.3 Authors@R: c( person(given = "Doug", family = "Manuel", diff --git a/NAMESPACE b/NAMESPACE index a27b30b4..2d5c6956 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,6 +5,7 @@ export(ALCDTYP) export(ALWDDLY) export(ALWDWKY) export(BMI_fun) +export(DHHGAGE_cat_fun) export(Pack_years_fun) export(Pct_time_fun) export(Resp_condition_fun1) diff --git a/NEWS.md b/NEWS.md index 9eeb3376..0f1e4b96 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ ## Features - Updated example in the introduction (README.MD) to reflect data that is now included in the cchsflow package. +- Updates to vignettes to reflect latest version of package ### Variables diff --git a/_pkgdown.yml b/_pkgdown.yml index 90553303..d029f877 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -55,6 +55,7 @@ reference: - Resp_condition_fun1 - Resp_condition_fun2 - Resp_condition_fun3 + - DHHGAGE_cat_fun - title: "CCHS datasets" desc: Datasets for each CCHS cycle contents: diff --git a/docs/.DS_Store b/docs/.DS_Store index fcefad82..b9ffaac2 100644 Binary files a/docs/.DS_Store and b/docs/.DS_Store differ diff --git a/docs/404.html b/docs/404.html index afee4143..7df74d78 100644 --- a/docs/404.html +++ b/docs/404.html @@ -73,7 +73,7 @@ cchsflow - 0.2.2 + 0.2.3 diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index 93cea9e3..aa343c32 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -73,7 +73,7 @@ cchsflow - 0.2.2 + 0.2.3 diff --git a/docs/articles/derivedVariables.html b/docs/articles/derivedVariables.html index 1b7ace95..a2c50abf 100644 --- a/docs/articles/derivedVariables.html +++ b/docs/articles/derivedVariables.html @@ -38,7 +38,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -156,64 +156,47 @@

data(cchs2003)
 data(cchs2010)
 
-variables <- read.csv(file.path(getwd(), '../inst/extdata/variables.csv'))
-variableDetails <- read.csv(file.path(getwd(), '../inst/extdata/variableDetails.csv'))
-
 BMI2003 <- RecWTable(dataSource = cchs2003, variableDetails = variableDetails, datasetName = "cchs2003", log = TRUE, variables = c("HWTGHTM", "HWTGWTK", "HWTGBMI_der"))
## [1] "NOTE: 2001 and 2003 CCHS use inches, values converted to meters to 3 decimal points"
 ## [1] "NOTE: 74+ inches converted to 76 inches"
 ## [1] "The variable HWTCGHT was recoded into HWTGHTM for the database cchs2003 the following recodes were made:"
-##    valueTo From rowsRecoded
-## 1    1.118    1           0
-## 2    1.143    2           0
-## 3    1.168    3           0
-## 4    1.194    4           0
-## 5    1.219    5           0
-## 6    1.245    6           0
-## 7    1.270    7           0
-## 8    1.295    8           0
-## 9    1.321    9           0
-## 10   1.346   10           0
-## 11   1.372   11           0
-## 12   1.397   12           0
-## 13   1.422   13           0
-## 14   1.448   14           1
-## 15   1.473   15           0
-## 16   1.499   16           2
-## 17   1.524   17           5
-## 18   1.549   18           8
-## 19   1.575   19          14
-## 20   1.600   20          16
-## 21   1.626   21          17
-## 22   1.651   22          19
-## 23   1.676   23          17
-## 24   1.702   24          25
-## 25   1.727   25          16
-## 26   1.753   26          10
-## 27   1.778   27          13
-## 28   1.803   28          14
-## 29   1.829   29          10
-## 30   1.854   30           6
-## 31   1.930   31           6
-## 32   NA::a   96           0
-## 33   NA::b   99           1
+## # A tibble: 33 x 3
+##    valueTo From  rowsRecoded
+##    <chr>   <chr>       <int>
+##  1 1.118   1               0
+##  2 1.143   2               0
+##  3 1.168   3               0
+##  4 1.194   4               0
+##  5 1.219   5               0
+##  6 1.245   6               0
+##  7 1.270   7               0
+##  8 1.295   8               0
+##  9 1.321   9               0
+## 10 1.346   10              0
+## # … with 23 more rows
 ## [1] "The variable HWTCGWTK was recoded into HWTGWTK for the database cchs2003 the following recodes were made:"
-##   valueTo       From rowsRecoded
-## 1    copy 27.0:135.0         192
-## 2   NA::a        996           0
-## 3   NA::b    997:999           0
+## # A tibble: 3 x 3 +## valueTo From rowsRecoded +## <chr> <chr> <int> +## 1 copy 27.0:135.0 192 +## 2 NA::a 996 0 +## 3 NA::b 997:999 0
BMI2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, datasetName = "cchs2010", log = TRUE, variables = c("HWTGHTM", "HWTGWTK", "HWTGBMI_der"))
## [1] "NOTE: Height is a reported in meters from 2005 CCHS onwards"
 ## [1] "The variable HWTGHTM was recoded into HWTGHTM for the database cchs2010 the following recodes were made:"
-##   valueTo        From rowsRecoded
-## 1    copy 0.914:2.134         190
-## 2   NA::a       9.996           2
-## 3   NA::b 9.997:9.999           0
+## # A tibble: 3 x 3
+##   valueTo From        rowsRecoded
+##   <chr>   <chr>             <int>
+## 1 copy    0.914:2.134         190
+## 2 NA::a   9.996                 2
+## 3 NA::b   9.997:9.999           0
 ## [1] "The variable HWTGWTK was recoded into HWTGWTK for the database cchs2010 the following recodes were made:"
-##   valueTo          From rowsRecoded
-## 1    copy    27.0:135.0         185
-## 2   NA::a        999.96           0
-## 3   NA::b 999.97:999.99           0
+## # A tibble: 3 x 3 +## valueTo From rowsRecoded +## <chr> <chr> <int> +## 1 copy 27.0:135.0 185 +## 2 NA::a 999.96 0 +## 3 NA::b 999.97:999.99 0

Since derived variables are based on previously transformed variables, if you want to only transform your derived variable, you must also specify its base CCHS variables in RecWTable() as shown above. So for the derived BMI variable, you will have to also specify the height (HWTGHTM) and weight (HWTGWTK) variables.

Using bind_rows(), you can then combine your transformed datasets.

@@ -345,7 +328,7 @@

Creating a derived variable

-

Creating a derived requires the harmonization of existing CCHS variables, and a custom function that uses those harmonized variables. For more information on how to create a derived variable see here

+

Creating a derived requires the harmonization of existing CCHS variables, and a custom function that uses those harmonized variables. For more information on how to create a derived variable see here

diff --git a/docs/articles/howtoaddvariables.html b/docs/articles/howtoaddvariables.html index 0b835137..01bac757 100644 --- a/docs/articles/howtoaddvariables.html +++ b/docs/articles/howtoaddvariables.html @@ -38,7 +38,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -3872,7 +3872,7 @@

# Non-smoker ifelse2(SMKDSTY==6, 0, NA))))))) } -

More information on what each smoking variable means can be found in the Reference section.

+

More information on what each smoking variable means can be found in the Reference section.

diff --git a/docs/articles/index.html b/docs/articles/index.html index 01ba1c16..5b108b2b 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -73,7 +73,7 @@ cchsflow - 0.2.2 + 0.2.3

diff --git a/docs/articles/usingcchsflow.html b/docs/articles/usingcchsflow.html index 8608e26c..17e288aa 100644 --- a/docs/articles/usingcchsflow.html +++ b/docs/articles/usingcchsflow.html @@ -38,7 +38,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -122,10 +122,13 @@

Loading the necessary packages

The RecWTable and SetDataLabels functions are part of the bllflow package. RecWTable is used to transform CCHS variables to a common name. SetDataLabels reapplies labels that are lost during the combination process after transforming each CCHS dataset. Install & load the package onto your environment. Since bllflow is still under development and is not on CRAN, you must install the package from Github using the devtools package.

+

variables.csv & variableDetails.csv are saved in the cchsflow package as variables & variableDetails. This means you will need to install & load the page onto your environment. Similar to bllflow, you must install the package from Github.

install.packages("devtools")
 library(devtools)
-install_github("Big-Life-Lab/bllflow", ref = "dev")
-
library(bllflow)
+install_github("Big-Life-Lab/bllflow", ref ="dev") +install_github("Big-Life-Lab/cchsflow") +
library(bllflow)
+library(cchsflow)

We use the bind_rows function in the dplyr package to combine datasets.

library(dplyr)

We use the kable function in the knitr package to illustrate transformation.

@@ -136,18 +139,16 @@

Steps

-
+

-Step 1. Load the CCHS datasets, variables.csv, and variableDetails.csv

+Step 1. Load the CCHS datasets

Load the CCHS datasets as well as the two variable worksheets. For illustration, we will create mock CCHS datasets for the years 2001 and 2013.

-
varSheet <- read.csv(file.path(getwd(), '../inst/extdata/variables.csv'))
-varDetails <- read.csv(file.path(getwd(), '../inst/extdata/variableDetails.csv'))
-cchsMock2001 <- data.frame(DHHA_SEX = c(2, 1, 1, 6), DHHAGAGE = c(3, 4, 6, 6), FVCADTOT = c(12, 4, 20, 9))
+
cchsMock2001 <- data.frame(DHHA_SEX = c(2, 1, 1, 6), DHHAGAGE = c(3, 4, 6, 6), FVCADTOT = c(12, 4, 20, 9))
 cchsMock2013 <- data.frame(DHH_SEX = c(1, 2, 1), DHHGAGE = c(2, 1, 1), FVCDTOT = c(25, 15, 6))

Did you notice that the names for the variables are slightly different in the two mock databases? That isn’t a mistake: in the 2001 CCHS the variable for sex is DHHA_SEX and in 2013 CCHS the variable is DHH_SEX.

Don’t worry, cchsflow is here to help! variableDetails.csv contains the rules to harmonize those two variables into a common variable name. In the CCHS, the categories for sex are consistient: 1 = males, 2 = females. variableDetails.csv provides instructions for how to harmonizecategory values or labels, if they change across survey cycles. Variable labes are discussed in later vignettes.

-
-
## `variables.csv` includes 135 variables that can be transformed. The variables are divided into 6 sections, and 38 subjects.
+
+
## `variables.csv` includes 135 variables that can be transformed. The variables are divided into 6 sections, and 38 subjects.

@@ -160,7 +161,7 @@

  • Indicate the name of the CCHS dataset (this can be found in the databaseStart section of variableDetails.csv).
  • Your R command when calling the function should look like this:

    -

    cchsTransformedYear1 <- RecWTable(dataSource = cchsYear, variableDetails = varDetails, datasetName = "cchsYear1")

    +

    cchsTransformedYear1 <- RecWTable(dataSource = cchsYear, variableDetails = variableDetails, datasetName = "cchsYear1")

    @@ -186,13 +187,15 @@

    Example 1. Transform a single variable from a single database

    In this example, the sex variable in the 2001 CCHS cycle is transformed a harmonized sex variable for all CCHS cycles.

    -
    sex2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = varDetails, datasetName = "cchs2001", log = TRUE, variables = c("DHH_SEX"))
    +
    sex2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = variableDetails, datasetName = "cchs2001", log = TRUE, variables = c("DHH_SEX"))
    ## [1] "The variable DHHA_SEX was recoded into DHH_SEX for the database cchs2001 the following recodes were made:"
    -##   valueTo From rowsRecoded
    -## 1       1    1           2
    -## 2       2    2           1
    -## 3   NA::a    6           1
    -## 4   NA::b  7:9           0
    +## # A tibble: 4 x 3 +## valueTo From rowsRecoded +## <chr> <chr> <int> +## 1 1 1 2 +## 2 2 2 1 +## 3 NA::a 6 1 +## 4 NA::b 7:9 0
    @@ -232,22 +235,26 @@

    Example 2. Transform a single variable from multiple CCHS datasets

    -

    This example shows how you can transform and combine a variable across multiple CCHS cycles. The sex variable in CCHS 2001 (DHHA_SEX) and CCHS 2013 (DHH_SEX) is transformed a common variable (DHH_SEX) and combined into a single dataset. In cchsflow the CCHS 2007 variable name is used as the common variable name. See the variableDetails vignette for more information.

    -
    sex2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = varDetails, datasetName = "cchs2001", appendToData = FALSE, log = TRUE, variables = c("DHH_SEX"))
    +

    This example shows how you can transform and combine a variable across multiple CCHS cycles. The sex variable in CCHS 2001 (DHHA_SEX) and CCHS 2013 (DHH_SEX) is transformed a common variable (DHH_SEX) and combined into a single dataset. In cchsflow the CCHS 2007 variable name is used as the common variable name. See the variableDetails vignette for more information.

    +
    sex2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = variableDetails, datasetName = "cchs2001", appendToData = FALSE, log = TRUE, variables = c("DHH_SEX"))
    ## [1] "The variable DHHA_SEX was recoded into DHH_SEX for the database cchs2001 the following recodes were made:"
    -##   valueTo From rowsRecoded
    -## 1       1    1           2
    -## 2       2    2           1
    -## 3   NA::a    6           1
    -## 4   NA::b  7:9           0
    -
    sex2013 <- RecWTable(dataSource = cchsMock2013, variableDetails = varDetails, datasetName = "cchs2013", appendToData = FALSE, log = TRUE, variables = c("DHH_SEX"))
    +## # A tibble: 4 x 3 +## valueTo From rowsRecoded +## <chr> <chr> <int> +## 1 1 1 2 +## 2 2 2 1 +## 3 NA::a 6 1 +## 4 NA::b 7:9 0 +
    sex2013 <- RecWTable(dataSource = cchsMock2013, variableDetails = variableDetails, datasetName = "cchs2013", appendToData = FALSE, log = TRUE, variables = c("DHH_SEX"))
    ## [1] "The variable DHH_SEX was recoded into DHH_SEX for the database cchs2013 the following recodes were made:"
    -##   valueTo From rowsRecoded
    -## 1       1    1           2
    -## 2       2    2           1
    -## 3   NA::a    6           0
    -## 4   NA::b  7:9           0
    -
    combinedSex <- bind_rows(sex2001, sex2013)
    +## # A tibble: 4 x 3 +## valueTo From rowsRecoded +## <chr> <chr> <int> +## 1 1 1 2 +## 2 2 2 1 +## 3 NA::a 6 0 +## 4 NA::b 7:9 0 +
    combinedSex <- bind_rows(sex2001, sex2013)
    @@ -302,10 +309,10 @@

    Option 1: transform category age variable into a common variable for only cycles with the same category responses

    Transform the age variable into variables that cannoot be combined across cycles. The categories in age variable in the CCHS changed in 2005 and therefore it is not possible to have the same age categories across all CCHS cycles.

    DHHGAGE_A is the age variable for CCHS cycles 2001-2003, and DHHGAGE_B is the age variable for CCHS cycles 2005-2014.

    -
    age2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = varDetails, datasetName = "cchs2001", variables = c("DHHGAGE_A"))
    +
    age2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = variableDetails, datasetName = "cchs2001", variables = c("DHHGAGE_A"))
    ## [1] "NOTE: Not applicable, don't know, refusal, not stated (96-99) were options only in CCHS 2003, but had zero responses"
    -
    age2013 <- RecWTable(dataSource = cchsMock2013, variableDetails = varDetails, datasetName = "cchs2013", variables = c("DHHGAGE_B"))
    -
    combinedAge_cat <- bind_rows(age2001, age2013)
    +
    age2013 <- RecWTable(dataSource = cchsMock2013, variableDetails = variableDetails, datasetName = "cchs2013", variables = c("DHHGAGE_B"))
    +
    combinedAge_cat <- bind_rows(age2001, age2013)
    @@ -379,10 +386,10 @@

    Option 2: transform the categorical age variable into a continuous age_cont variable

    Transform categorical variables such as age into a single harmonized age_cont variable. This variable takes the midpoint age of each category for all CCHS cycles. With this option, the age category variable from all CCHS cycles can be combined into a single dataset.

    -
    age2001_cont <- RecWTable(dataSource = cchsMock2001, variableDetails = varDetails, datasetName = "cchs2001", variables = c("DHHGAGE_cont"))
    +
    age2001_cont <- RecWTable(dataSource = cchsMock2001, variableDetails = variableDetails, datasetName = "cchs2001", variables = c("DHHGAGE_cont"))
    ## [1] "NOTE: Not applicable, don't know, refusal, not stated (96-99) were options in CCHS 2003, but had zero responses"
    -
    age2013_cont <- RecWTable(dataSource = cchsMock2013, variableDetails = varDetails, datasetName = "cchs2013", variables = c("DHHGAGE_cont"))
    -
    combinedAge_cont <- bind_rows(age2001_cont, age2013_cont)
    +
    age2013_cont <- RecWTable(dataSource = cchsMock2013, variableDetails = variableDetails, datasetName = "cchs2013", variables = c("DHHGAGE_cont"))
    +
    combinedAge_cont <- bind_rows(age2001_cont, age2013_cont)
    + + + +
    @@ -438,19 +445,19 @@

    Example 4. Transform multiple variables from multiple datasets

    The variables argument in RecWTable() allows multiple variables to be transformed from a CCHS dataset. In this example, the age and sex variables from the 2001 and 2013 CCHS datasets will be transformed and labelled using RecWTable(). They will then be combined into a single dataset and labelled using SetDataLabels().

    -
    agesex_2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = varDetails, datasetName = "cchs2001", variables = c("DHHGAGE_cont", "DHH_SEX"), varLabels = c(DHHGAGE_cont = "Age", DHH_SEX = "Sex"))
    +
    agesex_2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = variableDetails, datasetName = "cchs2001", variables = c("DHHGAGE_cont", "DHH_SEX"), varLabels = c(DHHGAGE_cont = "Age", DHH_SEX = "Sex"))
    ## [1] "NOTE: Not applicable, don't know, refusal, not stated (96-99) were options in CCHS 2003, but had zero responses"
    get_label(agesex_2001)
    ## DHHGAGE_cont      DHH_SEX 
     ##        "Age"        "Sex"
    -
    agesex_2013 <- RecWTable(dataSource = cchsMock2013, variableDetails = varDetails, datasetName = "cchs2013", variables = c("DHHGAGE_cont", "DHH_SEX"), varLabels = c(DHHGAGE_cont = "Age", DHH_SEX = "Sex"))
    +
    agesex_2013 <- RecWTable(dataSource = cchsMock2013, variableDetails = variableDetails, datasetName = "cchs2013", variables = c("DHHGAGE_cont", "DHH_SEX"), varLabels = c(DHHGAGE_cont = "Age", DHH_SEX = "Sex"))
     
     get_label(agesex_2013)
    ## DHHGAGE_cont      DHH_SEX 
     ##        "Age"        "Sex"

    In the above example, varLabels is called in RecWTable() to label the age and sex variables in the 2001 and 2013 datasets. Use get_label() to view the variable labels in your transformed dataset. As mentioned previously, varLabels can be used all the variables in variablesSheet.csv or a subset of variables.

    -
    combinedAgeSex <- bind_rows(agesex_2001, agesex_2013)
    -labelledCombinedAgeSex <- SetDataLabels(dataToLabel = combinedAgeSex, variableDetails = varDetails, variablesSheet = varSheet)
    +
    combinedAgeSex <- bind_rows(agesex_2001, agesex_2013)
    +labelledCombinedAgeSex <- SetDataLabels(dataToLabel = combinedAgeSex, variableDetails = variableDetails, variablesSheet = variables)
    @@ -529,7 +536,7 @@

    Example 5. Transform all variables in the variableDetails sheet

    All the variables listed in varDetails.csv will be transformed if the variables argument in RecWTable() is not specified. In this example, all of the variables in our mock 2001 and 2013 datasets will be transformed, combined, and labelled.

    -
    transformed2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = varDetails, datasetName = "cchs2001")
    +
    transformed2001 <- RecWTable(dataSource = cchsMock2001, variableDetails = variableDetails, datasetName = "cchs2001")
    ## [1] "NOTE: Not applicable, don't know, refusal, not stated (96-99) were options only in CCHS 2003, but had zero responses"
     ## [1] "NOTE: Not applicable, don't know, refusal, not stated (96-99) were options in CCHS 2003, but had zero responses"
     ## [1] "NOTE: Don't know (999.7) and refusal (999.8) not included in 2001 CCHS"
    @@ -607,7 +614,7 @@

    -
    transformed2013 <- RecWTable(dataSource = cchsMock2013, variableDetails = varDetails, datasetName = "cchs2013")
    +
    transformed2013 <- RecWTable(dataSource = cchsMock2013, variableDetails = variableDetails, datasetName = "cchs2013")
    ## [1] "NOTE: Don't know (999.7) and refusal (999.8) not included in 2001 CCHS"
    @@ -669,8 +676,8 @@

    -
    combinedCCHS <- bind_rows(transformed2001, transformed2013)
    -labelledCombinedCCHS <- SetDataLabels(dataToLabel = combinedCCHS, variableDetails = varDetails, variablesSheet = varSheet)
    +
    combinedCCHS <- bind_rows(transformed2001, transformed2013)
    +labelledCombinedCCHS <- SetDataLabels(dataToLabel = combinedCCHS, variableDetails = variableDetails, variablesSheet = variables)
    - + - + @@ -226,24 +230,31 @@

    Value

    Details

    -

    pack-years is calculated by multiplying the number of cigarette packs per day (20 cigarettes per pack) by the number of years. - Example 1: a respondent who is a current smoker who smokes 1 package of cigarettes for the last 10 years has smoked 10 pack-years. - Pack-years is also calculated for former smokers. Example 2: a respondent who started smoking at age 20 years and smoked half - a pack of cigarettes until age 40 years smoked for 10 pack-years.

    +

    pack-years is calculated by multiplying the number of cigarette packs per day + (20 cigarettes per pack) by the number of years. Example 1: a respondent who is a current smoker + who smokes 1 package of cigarettes for the last 10 years has smoked 10 pack-years. + Pack-years is also calculated for former smokers. Example 2: a respondent who started smoking + at age 20 years and smoked half a pack of cigarettes until age 40 years smoked for + 10 pack-years.

    Examples

    # Using Pack_years_fun() to create pack-years values across CCHS cycles -# Pack_years_fun() is specified in variableDetails.csv along with the CCHS variables and cycles included. +# Pack_years_fun() is specified in variableDetails.csv along with the CCHS variables and cycles +# included. -# To transform Pack_years_der across cycles, use RecWTable() for each CCHS cycle and specify Pack_years_der, along with -# each smoking variable. Then by using bind_rows(), you can combine Pack_years_der across cycles +# To transform Pack_years_der across cycles, use RecWTable() for each CCHS cycle and specify +# Pack_years_der, along with each smoking variable. Then by using bind_rows(), you can combine +# Pack_years_der across cycles suppressMessages(library(bllflow)) library(cchsflow) -pack_years2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, datasetName = "cchs2010", -variables = c("SMKDSTY", "DHHGAGE_cont", "SMK_09A_B", "SMKG09C", "SMKG203_cont", "SMKG207_cont", "SMK_204", "SMK_05B", -"SMK_208", "SMK_05C", "SMK_01A", "SMKG01C_cont", "Pack_years_der")) + +pack_years2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, +datasetName = "cchs2010", variables = c("SMKDSTY", "DHHGAGE_cont", "SMK_09A_B", "SMKG09C", +"SMKG203_cont", "SMKG207_cont", "SMK_204", "SMK_05B", "SMK_208", "SMK_05C", "SMK_01A", +"SMKG01C_cont", "Pack_years_der")) + head(pack_years2010)
    #> DHHGAGE_cont SMKDSTY SMKG01C_cont SMK_01A SMKG203_cont SMKG207_cont SMK_204 #> 1 22 6 NA 2 NA NA NA #> 2 42 6 NA 2 NA NA NA @@ -258,9 +269,11 @@

    Examp #> 4 NA NA NA NA(a) NA(a) 0.00 #> 5 NA NA NA NA(a) NA(a) 0.00 #> 6 NA NA 12 1 NA(a) 9.30

    -pack_years2012 <- RecWTable(dataSource = cchs2012, variableDetails = variableDetails, datasetName = "cchs2012", -variables = c("SMKDSTY", "DHHGAGE_cont", "SMK_09A_B", "SMKG09C", "SMKG203_cont", "SMKG207_cont", "SMK_204", "SMK_05B", -"SMK_208", "SMK_05C", "SMK_01A", "SMKG01C_cont", "Pack_years_der")) +pack_years2012 <- RecWTable(dataSource = cchs2012, variableDetails = variableDetails, +datasetName = "cchs2012", variables = c("SMKDSTY", "DHHGAGE_cont", "SMK_09A_B", "SMKG09C", +"SMKG203_cont", "SMKG207_cont", "SMK_204", "SMK_05B", "SMK_208", "SMK_05C", "SMK_01A", +"SMKG01C_cont", "Pack_years_der")) + tail(pack_years2012)
    #> DHHGAGE_cont SMKDSTY SMKG01C_cont SMK_01A SMKG203_cont SMKG207_cont SMK_204 #> 195 42 6 NA 2 NA NA NA #> 196 57 6 NA 2 NA NA NA @@ -275,7 +288,8 @@

    Examp #> 198 NA NA NA NA(a) NA(a) 0.007 #> 199 NA NA NA NA(a) NA(a) 7.750 #> 200 NA NA NA NA(a) NA(a) 0.007

    -combined_pack_years <- bind_rows(pack_years2010, pack_years2012)
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    head(combined_pack_years)
    #> DHHGAGE_cont SMKDSTY SMKG01C_cont SMK_01A SMKG203_cont SMKG207_cont SMK_204 +combined_pack_years <- bind_rows(pack_years2010, pack_years2012)
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    +head(combined_pack_years)
    #> DHHGAGE_cont SMKDSTY SMKG01C_cont SMK_01A SMKG203_cont SMKG207_cont SMK_204 #> 1 22 6 NA 2 NA NA NA #> 2 42 6 NA 2 NA NA NA #> 3 37 1 18.5 1 18.5 NA 10 diff --git a/docs/reference/Pct_time_fun.html b/docs/reference/Pct_time_fun.html index cac734a1..c546ba30 100644 --- a/docs/reference/Pct_time_fun.html +++ b/docs/reference/Pct_time_fun.html @@ -41,8 +41,8 @@ - + @@ -76,7 +76,7 @@ cchsflow - 0.2.2 + 0.2.3
    @@ -147,8 +147,8 @@

    Percent time in Canada

    -

    This function creates a derived variable (Pct_time_der) that provides an estimated percentage of the time - a person's life was spent in Canada.

    +

    This function creates a derived variable (Pct_time_der) that provides an estimated + percentage of the time a person's life was spent in Canada.

    @@ -163,38 +163,42 @@

    Arg

    - + - +
    @@ -825,13 +832,13 @@

    CCHS derived variables are recoded (harmonized) using the same method as other CCHS cchsflow variables, with one additional considerations.

    Derived variables in CCHS are created from existing, original variables that are transformed into a new variable. An example is body mass index (BMI). Respondents are asked to report their height and weight. BMI is then dereived (calculated) using variables for height and weight.

    Recoding BMI into a harmonized variable requires their underlying initial variables (height and weight). This first step of harmonizing underlying variables is completed for you, but you must have the underlying variables in your dataset.

    -

    Using the BMI example illustrated in the derivedVariables article, RecWTable() is able to transform BMI across multiple cycles provided that height (HWTGHTM) and weight (HWTGWTK) are specified.

    +

    Using the BMI example illustrated in the derivedVariables article, RecWTable() is able to transform BMI across multiple cycles provided that height (HWTGHTM) and weight (HWTGWTK) are specified.

    For this example, we will use a subset of CCHS 2003 and 2010 data.

    BMI2003 <- RecWTable(dataSource = cchs2003, variableDetails = variableDetails, datasetName = "cchs2003", log = TRUE, variables = c("HWTGHTM", "HWTGWTK", "HWTGBMI_derived"))
     
     BMI2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, datasetName = "cchs2010", log = TRUE, variables = c("HWTGHTM", "HWTGWTK", "HWTGBMI_derived"))
     
    -combinedBMI <- bind_rows(BMI2003, BMI2010)
    +combinedBMI <- bind_rows(BMI2003, BMI2010)
     
     head(combinedBMI)
    @@ -840,7 +847,7 @@

    Notes

    notes provide context for the decisions that informed harmonization that may affect your decision to use a harmonized variable.

    -
    cat("`cchsflow` includes", length(unique(varDetails$notes)), "variables with notes.")
    +
    cat("`cchsflow` includes", length(unique(variableDetails$notes)), "variables with notes.")
    ## `cchsflow` includes 33 variables with notes.

    For example, for DHHGAGE_A the category NA::b has the following note:

    Not applicable, don't know, refusal, not stated (96-99) were options only in CCHS 2003, but had zero responses.

    diff --git a/docs/articles/variableDetails.html b/docs/articles/variableDetails.html index 418ea61b..309be579 100644 --- a/docs/articles/variableDetails.html +++ b/docs/articles/variableDetails.html @@ -38,7 +38,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -119,8 +119,8 @@

    variableDetails.csv

    Introduction

    The variableDetails.csv worksheet contain details for the variables in variables.csv. Information from variableDetails.csv worksheet is used by the RecWTable() function of the bllflow package to transform variables identifed in variableDetails$variableStart to the newly transformed variable in variableDetails$variable.

    -
    -
    #> In the `variableDetails.csv` worksheet there are 1069 rows and 16 columns
    +
    +
    #> In the `variableDetails.csv` worksheet there are 1069 rows and 16 columns

    diff --git a/docs/articles/variablesSheet.html b/docs/articles/variablesSheet.html index 8af61ba8..36558c87 100644 --- a/docs/articles/variablesSheet.html +++ b/docs/articles/variablesSheet.html @@ -38,7 +38,7 @@ cchsflow - 0.2.2 + 0.2.3

    @@ -125,8 +125,8 @@

    #> There are 135 variables, grouped in 38 subjects and 6 sections that are available for transformation in CCHS cycles from 2001 to 2014.
    #> You can search for variables in the table below. Try searching for the 3 age variables that are used in the Transform CCHS variables vignette. All 3 variables are in the age subject. Try sorting the subject column by clicking the up beside the `subject` heading: the top 3 rows of the table should show the age variables:
     #> [1] "DHHGAGE_A"    "DHHGAGE_B"    "DHHGAGE_cont"
    -
    - +
    +

    diff --git a/docs/authors.html b/docs/authors.html index eb3eeca6..5ccb3ec2 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -73,7 +73,7 @@ cchsflow - 0.2.2 + 0.2.3

    diff --git a/docs/index.html b/docs/index.html index 3dd95dc4..0fced6b1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -39,7 +39,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -119,13 +119,23 @@

    Usage

    -

    cchsflow creates harmonized variables (where possible) between CCHS cycles. Searching BMI in variables.csv shows HWTGBMI calculates BMI with two decimal places for all cycles for all respondents using the respondents’ untruncated height and weight.

    -
    # calculate BMI for each CCHS cycle
    -cchs2001_BMI <- RecWTable(dataSource = cchs2001, 
    -            variableDetails = varDetails, 
    -            datasetName = "cchs-82M0013-E-2001-c1-1-general-file", 
    -            appendToData = TRUE,  
    -            variables = "HWTGBMI")
    +

    cchsflow creates harmonized variables (where possible) between CCHS cycles. Searching BMI in variables (described in the variableDetails.csv vignette Introduction)) shows HWTGBMI calculates BMI with two decimal places for all cycles for all respondents using the respondents’ untruncated height and weight.

    +

    Calculate a harmonized BMI variable for CCHS 2001 cycle

    +
        # load test cchs data - included in cchsflow
    +    cchs2001test <- cchs2001
    +    
    +    # `variableDetails` is a database in cchsflow that contain the instructions how to transform variables.
    +    varDetails <- variableDetails
    +    
    +    cchs2001_BMI <- RecWTable(dataSource = cchs2001test, 
    +                variableDetails = varDetails, 
    +                datasetName = "cchs2001", 
    +                appendToData = TRUE,  
    +                variables = "HWTGBMI")
    +

    Notes printed to console indicate issues that may affect BMI classification for your study.

    +
    [1] "NOTE: CCHS 2001 restricts BMI to ages 20-64"
    +[1] "NOTE: CCHS 2001 and 2003 codes not applicable and missing variables as 999.6 and 999.7-999.9 respectively, while CCHS 2005 onwards codes not applicable and missing variables as 999.96 and 999.7-999.99 respectively"
    +[1] "NOTE: Don't know (999.7) and refusal (999.8) not included in 2001 CCHS"

    diff --git a/docs/news/index.html b/docs/news/index.html index 38be7843..891168ef 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -73,7 +73,7 @@ cchsflow - 0.2.2 + 0.2.3

    @@ -141,12 +141,34 @@

    Changelog

    Source: NEWS.md -
    +

    -cchsflow 0.2.2 (Latest build)

    +cchsflow 0.2.3 (Latest build) +

    2019-11-28

    -Features:

    +Features +
      +
    • Updated example in the introduction (README.MD) to reflect data that is now included in the cchsflow package.
    • +
    • Updates to vignettes to reflect latest version of package
    • +
    +
    +

    +Variables

    +
      +
    • +New DHHGAGE_C - categorical age variable that groups various age categories across all CCHS cycles. Based on the continuous age variable (DHHGAGE_cont) that is also harmonious across all CCHS cycles.
    • +
    +
    +
    +
    +
    +

    +cchsflow 0.2.2

    +

    2019-11-26

    +
    +

    +Features

    • Updated ref branch of bllflow to match latest version of RecWTable()
    • @@ -158,9 +180,10 @@

      cchsflow 0.2.1

      -
      +

      2019-11-19

      +

      -Features:

      +Features

      • Documentation for derived variable functions now available
      • Documentation for derived alcohol variables now available
      • @@ -170,9 +193,9 @@

        cchsflow 0.2.0

        -
        +

        -Features:

        +Features

        • Added Support for derived variables alongside vignettes explaining how to add new variables
        • Added R file with custom functions for derived variables
        • @@ -184,9 +207,9 @@

          cchsflow 0.1.0 (First Version)

          -
          +

          -Features:

          +Features

          • Added variables.csv that contains list of CCHS variables in cchsflow.
          • Added variableDetails.csv that maps variables across CCHS cycles from 2001-2014
          • @@ -200,7 +223,8 @@

            Contents

            @@ -152,8 +152,8 @@

            Type of drinker (12 months)

            NOTE: this is not a function.

            -

            This is a categorical variable derived by Statistics Canada that uses various intermediate alcohol variables to - categorize individuals into 3 distinct groups:

            +

            This is a categorical variable derived by Statistics Canada that uses various intermediate + alcohol variables to categorize individuals into 3 distinct groups:

            1. Regular Drinker 2. Occasional Drinker 3. No drink in the last 12 months.

            @@ -173,9 +173,9 @@

            Arg

            Details

            -

            This variable was introuced in the 2007-2008 cycle of the CCHS, and became the sole derived variable that categorized - people into various drinker types from 2009 onwards. Unlike `ALCDTYP`, this variable does not distinguish between - former and never drinkers.

            +

            This variable was introuced in the 2007-2008 cycle of the CCHS, and became the sole + derived variable that categorized people into various drinker types from 2009 onwards. + Unlike ALCDTYP, this variable does not distinguish between former and never drinkers.

            diff --git a/docs/reference/ALCDTYP.html b/docs/reference/ALCDTYP.html index e807d9b4..e403ea71 100644 --- a/docs/reference/ALCDTYP.html +++ b/docs/reference/ALCDTYP.html @@ -42,8 +42,8 @@ cchsflow - 0.2.2 + 0.2.3
    @@ -153,8 +153,8 @@

    Type of drinker

    NOTE: this is not a function.

    -

    This is a categorical variable derived by Statistics Canada that uses various intermediate alcohol variables to - categorize individuals into 4 distinct groups:

    +

    This is a categorical variable derived by Statistics Canada that uses various intermediate + alcohol variables to categorize individuals into 4 distinct groups:

    1. Regular Drinker 2. Occasional Drinker 3. Former Drinker @@ -175,10 +175,12 @@

    Arg

    Details

    -

    This variable is used in CCHS cycles from 2001 to 2007. How it was derived remained consistent during these years.

    -

    Starting in 2007, Statistics Canada created a derived variable that looked at drinking type in the last 12 months. - This new derived variable did not distinguish between former and never drinkers. If your research requires you - to differentiate between former and never drinkers, we recommend using earlier cycles fo the CCHS.

    +

    This variable is used in CCHS cycles from 2001 to 2007. How it was derived remained + consistent during these years.

    +

    Starting in 2007, Statistics Canada created a derived variable that looked at drinking type in + the last 12 months. This new derived variable did not distinguish between former and never + drinkers. If your research requires you to differentiate between former and never drinkers, + we recommend using earlier cycles of the CCHS.

    diff --git a/docs/reference/ALWDDLY.html b/docs/reference/ALWDDLY.html index e353f73e..48439de1 100644 --- a/docs/reference/ALWDDLY.html +++ b/docs/reference/ALWDDLY.html @@ -42,8 +42,8 @@ +This is a continuous variable derived by Statistics Canada that quantifies the mean daily + consumption of alcohol. This takes the value of ALWDWKY and divides it by 7." /> @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3
    @@ -149,8 +149,8 @@

    Average daily alcohol consumption

    NOTE: this is not a function.

    -

    This is a continuous variable derived by Statistics Canada that quantifies the mean daily consumption of alcohol. - This takes the value of ALWDWKY and divides it by 7.

    +

    This is a continuous variable derived by Statistics Canada that quantifies the mean daily + consumption of alcohol. This takes the value of ALWDWKY and divides it by 7.

    @@ -167,7 +167,8 @@

    Arg

    Details

    -

    This variable is used in all CCHS cycles in cchsflow and how it was derived remains consistent from 2001 to 2014.

    +

    This variable is used in all CCHS cycles in cchsflow and how it was derived remains +consistent from 2001 to 2014.

    diff --git a/docs/reference/ALWDWKY.html b/docs/reference/ALWDWKY.html index 0b2ee2ed..2ebc7b46 100644 --- a/docs/reference/ALWDWKY.html +++ b/docs/reference/ALWDWKY.html @@ -42,10 +42,12 @@ +This is a continuous variable derived by Statistics Canada that quantifies the amount of alcohol + that is consumed in a week. This is calculated by adding the number of drinks consumed during + each day in the past week. Respondents of each CCHS cycle are asked how much alcohol they have + consumed each day in the past week (ie. how much alcohol did you consume on Sunday, + how much did you consume on Monday etc.). Each day in considered an individual variable and + ALWDWKY takes the sum of all daily variables." /> @@ -79,7 +81,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -151,10 +153,12 @@

    Number of drinks consumed in the past week

    NOTE: this is not a function.

    -

    This is a continuous variable derived by Statistics Canada that quantifies the amount of alcohol that is consumed in a week. - This is calculated by adding the number of drinks consumed during each day in the past week. - Respondents of each CCHS cycle are asked how much alcohol they have consumed each day in the past week (ie. how much alcohol did you consume on Sunday, - how much did you consume on Monday etc.). Each day in considered an individual variable and ALWDWKY takes the sum of all daily variables.

    +

    This is a continuous variable derived by Statistics Canada that quantifies the amount of alcohol + that is consumed in a week. This is calculated by adding the number of drinks consumed during + each day in the past week. Respondents of each CCHS cycle are asked how much alcohol they have + consumed each day in the past week (ie. how much alcohol did you consume on Sunday, + how much did you consume on Monday etc.). Each day in considered an individual variable and + ALWDWKY takes the sum of all daily variables.

    @@ -171,7 +175,8 @@

    Arg

    Details

    -

    This variable is used in all CCHS cycles in cchsflow and how it was derived remains consistent from 2001 to 2014.

    +

    This variable is used in all CCHS cycles in cchsflow and how it was derived remains + consistent from 2001 to 2014.

    diff --git a/docs/reference/BMI_fun.html b/docs/reference/BMI_fun.html index 6e86bd74..a437dace 100644 --- a/docs/reference/BMI_fun.html +++ b/docs/reference/BMI_fun.html @@ -41,14 +41,17 @@ - + @@ -82,7 +85,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -153,14 +156,17 @@

    Body Mass Index (BMI) derived variable

    -

    This function creates a harmonized BMI variable. The BMI variable provided by the CCHS calculates BMI using methods - that vary across cycles, leading to measurement error when using multiple CCHS cycles. In certain CCHS cycles (2001-2003, 2007+), - there are age restrictions in which respondents under the age of 20 and over the age of 64 were not included. Across all CCHS cycles, - female respondents who identifed as being pregnant were excluded; and in certain CCHS cycles (2003-2007, 2013-2014), females who did not - answer the pregnancy question were coded as NS (not stated) for HWTGBMI. As well, in certain CCHS cycles (2001-2003, 2009-2014), - respondents outside certain height and weight ranges (0.914-2.108m for height, 0-260kg for weight) were excluded from HWTGBMI.

    -

    BMI_fun() creates a derived variable (HWTGBMI_der) that is harmonized across all CCHS cycles. This function divides weight by the - square of height.

    +

    This function creates a harmonized BMI variable. The BMI variable provided by the + CCHS calculates BMI using methods that vary across cycles, leading to measurement error when + using multiple CCHS cycles. In certain CCHS cycles (2001-2003, 2007+), there are age + restrictions in which respondents under the age of 20 and over the age of 64 were not included. + Across all CCHS cycles, female respondents who identifed as being pregnant were excluded; and + in certain CCHS cycles (2003-2007, 2013-2014), females who did not answer the pregnancy + question were coded as NS (not stated) for HWTGBMI. As well, in certain CCHS cycles (2001-2003, + 2009-2014), respondents outside certain height and weight ranges (0.914-2.108m for height, + 0-260kg for weight) were excluded from HWTGBMI.

    +

    BMI_fun() creates a derived variable (HWTGBMI_der) that is harmonized across all CCHS cycles. + This function divides weight by the square of height.

    @@ -185,40 +191,43 @@

    Value

    Details

    -

    For HWTGBMI_der, there are no restrictions to age, height, weight, or pregnancy status. While pregnancy was consistent across - all CCHS cycles, its variable (MAM_037) was not available in the PUMF CCHS datasets so it could not be harmonized and included into - the function.

    -

    For any single CCHS survey year, it is appropriate to use the CCHS BMI variable (HWTGBMI) that is also available on cchsflow. - HWTGBMI_der is recommended when using multiple survey cycles.

    -

    HWTGBMI_der uses the CCHS variables for height and weight that have been transformed by cchsflow. In order to - generate a value for BMI across CCHS cycles, height and weight must be transformed and harmonized.

    +

    For HWTGBMI_der, there are no restrictions to age, height, weight, or pregnancy status. + While pregnancy was consistent across all CCHS cycles, its variable (MAM_037) was not available + in the PUMF CCHS datasets so it could not be harmonized and included into the function.

    +

    For any single CCHS survey year, it is appropriate to use the CCHS BMI variable (HWTGBMI) that + is also available on cchsflow. HWTGBMI_der is recommended when using multiple survey cycles.

    +

    HWTGBMI_der uses the CCHS variables for height and weight that have been transformed by + cchsflow. In order to generate a value for BMI across CCHS cycles, height and weight must be + transformed and harmonized.

    Note

    -

    In earlier CCHS cycles (2001 and 2003), height was collected in inches; while in later CCHS cycles (2005+) - it was collected in meters. To harmonize values across cycles, height was converted to meters (to 3 decimal points). - Weight was collected in kilograms across all CCHS cycles, so no transformations were required in the harmonization process.

    +

    In earlier CCHS cycles (2001 and 2003), height was collected in inches; while in later CCHS + cycles (2005+) it was collected in meters. To harmonize values across cycles, height was + converted to meters (to 3 decimal points). Weight was collected in kilograms across all CCHS + cycles, so no transformations were required in the harmonization process.

    Examples

    # Using BMI_fun() to create BMI values across cycles -# BMI_fun() is specified in variableDetails.csv along with the CCHS variables and cycles included. +# BMI_fun() is specified in variableDetails.csv along with the CCHS variables and cycles +# included. -# To transform the derived BMI variable, use RecWTable() for each CCHS cycle and specify HWTGBMI_der, -# along with height (HWTGHTM) and weight (HWTGWTK). Then by using bind_rows(), you can combined HWTGBMI_der -# across cycles. +# To transform the derived BMI variable, use RecWTable() for each CCHS cycle and specify +# HWTGBMI_der, along with height (HWTGHTM) and weight (HWTGWTK). Then by using bind_rows(), you +# can combined HWTGBMI_der across cycles. suppressMessages(library(bllflow))
    #> Warning: package ‘tableone’ was built under R version 3.5.2
    #> Warning: package ‘DDIwR’ was built under R version 3.5.2
    #> Warning: package ‘xml2’ was built under R version 3.5.2
    #> Warning: package ‘stringr’ was built under R version 3.5.2
    #> Warning: package ‘recipes’ was built under R version 3.5.2
    #> Warning: package ‘dplyr’ was built under R version 3.5.2
    #> Warning: package ‘sjlabelled’ was built under R version 3.5.2
    #> Warning: package ‘haven’ was built under R version 3.5.2
    library(cchsflow) -bmi2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, datasetName = "cchs2010", -variables = c("HWTGHTM", "HWTGWTK", "HWTGBMI_der"))
    #> [1] "NOTE: Height is a reported in meters from 2005 CCHS onwards"
    head(bmi2010)
    #> HWTGHTM HWTGWTK HWTGBMI_der +bmi2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, +datasetName = "cchs2010", variables = c("HWTGHTM", "HWTGWTK", "HWTGBMI_der"))
    #> [1] "NOTE: Height is a reported in meters from 2005 CCHS onwards"
    head(bmi2010)
    #> HWTGHTM HWTGWTK HWTGBMI_der #> 1 1.600 56.25 21.97266 #> 2 1.600 54.00 21.09375 #> 3 1.829 83.25 24.88610 #> 4 1.727 99.00 33.19331 #> 5 1.753 99.00 32.21598 #> 6 1.727 69.75 23.38619
    -bmi2012 <- RecWTable(dataSource = cchs2012, variableDetails = variableDetails, datasetName = "cchs2012", -variables = c("HWTGHTM", "HWTGWTK", "HWTGBMI_der"))
    #> [1] "NOTE: Height is a reported in meters from 2005 CCHS onwards"
    tail(bmi2012)
    #> HWTGHTM HWTGWTK HWTGBMI_der +bmi2012 <- RecWTable(dataSource = cchs2012, variableDetails = variableDetails, datasetName = +"cchs2012", variables = c("HWTGHTM", "HWTGWTK", "HWTGBMI_der"))
    #> [1] "NOTE: Height is a reported in meters from 2005 CCHS onwards"
    tail(bmi2012)
    #> HWTGHTM HWTGWTK HWTGBMI_der #> 195 1.829 108.00 32.28467 #> 196 1.524 70.20 30.22506 #> 197 1.803 84.00 25.83972 @@ -240,8 +249,8 @@

    Examp #> 399 1.829 85.50 25.55870 #> 400 1.702 74.25 25.63170

    # Using BMI_fun() to generate a BMI value with user inputted height and weight values -# BMI_fun() can also generate a value for BMI if you input a value for height and weight. Let's say your height is -# 170cm (1.7m) and your weight is 50kg, your BMI can be calculated as followed: +# BMI_fun() can also generate a value for BMI if you input a value for height and weight. Let's +# say your height is 170cm (1.7m) and your weight is 50kg, your BMI can be calculated as follows: library(cchsflow) BMI <- BMI_fun(HWTGHTM = 1.7, HWTGWTK = 50) diff --git a/docs/reference/DHHGAGE_cat_fun.html b/docs/reference/DHHGAGE_cat_fun.html new file mode 100644 index 00000000..fa8a8dd5 --- /dev/null +++ b/docs/reference/DHHGAGE_cat_fun.html @@ -0,0 +1,242 @@ + + + + + + + + +Derived categorical age — DHHGAGE_cat_fun • cchsflow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This is a derived categorical age variable that groups various age categories + across all CCHS cycles. This is based on the continuous age variable (DHHGAGE_cont) that is + harmonious across all CCHS cycles.

    +

    The categories of this variable are based on the age groupings seen in CCHS cycles from 2007 to + 2014. The age breakdown is as follows:

    +

    1 - 12 to 14 years

    +

    2 - 15 to 17 years

    +

    3 - 18 to 19 years

    +

    4 - 20 to 24 years

    +

    5 - 25 to 29 years

    +

    6 - 30 to 34 years

    +

    7 - 35 to 39 years

    +

    8 - 40 to 44 years

    +

    9 - 45 to 49 years

    +

    10 - 50 to 54 years

    +

    11 - 55 to 59 years

    +

    12 - 60 to 64 years

    +

    13 - 65 to 69 years

    +

    14 - 70 to 74 years

    +

    15 - 75 to 79 years

    +

    16 - 80 years or more

    + +
    + +
    DHHGAGE_cat_fun(DHHGAGE_cont)
    + +

    Arguments

    + + + + + + +
    DHHGAGE_cont

    continuous age variable

    + +

    Details

    + +

    The categories in the grouped age variable (DHHGAGE) vary between CCHS cycles. As such, + a continous age variable (DHHGAGE_cont) was created that harmonized age across all CCHS cycle + by taking the midpoint of each age category.

    + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/Pack_years_fun.html b/docs/reference/Pack_years_fun.html index 8f1826c5..f09163a4 100644 --- a/docs/reference/Pack_years_fun.html +++ b/docs/reference/Pack_years_fun.html @@ -41,8 +41,9 @@ - + @@ -76,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3
    @@ -147,8 +148,9 @@

    Smoking pack-years

    -

    This function creates a derived variable (Pack_years_der) that measures an individual smoking pack-years - based on various CCHS smoking variables. This is a popular variable used by researchers to quantify lifetime exposure to cigarette use.

    +

    This function creates a derived variable (Pack_years_der) that measures an + individual's smoking pack-years based on various CCHS smoking variables. This is a popular + variable used by researchers to quantify lifetime exposure to cigarette use.

    @@ -180,11 +182,13 @@

    Arg

    SMK_09A_B

    number of years since quitting smoking. Variable asked to former daily smokers who quit <3 years ago.

    number of years since quitting smoking. Variable asked to former daily smokers +who quit <3 years ago.

    SMKG09C

    number of years since quitting smoking. Variable asked to former daily smokers who quit >=3 years ago.

    number of years since quitting smoking. Variable asked to former daily smokers who +quit >=3 years ago.

    SMKG203_cont
    SDCGCBG

    whether or not someone was born in Canada (1 - born in Canada, 2 - born outside Canada)

    whether or not someone was born in Canada (1 - born in Canada, 2 - born outside +Canada)

    SDCGRES

    how long someone has lived in Canada. Note in the PUMF CCHS datasets, this is a categorical variable -with two categories (1 - 0-9 years; 2 - 10+ years).

    how long someone has lived in Canada. Note in the PUMF CCHS datasets, this is a +categorical variable with two categories (1 - 0-9 years; 2 - 10+ years).

    Value

    -

    Numeric value that is a fraction between 0 and 1 that represents percentage of a respondent's time in Canada

    +

    Numeric value that is a fraction between 0 and 1 that represents percentage of a + respondent's time in Canada

    Note

    -

    Since SDCGRES is a categorical variable measuring length of time, we've set midpoints in the function. A respondent - identified as being in Canada for 0-9 years is assigned a value of 4.5 years, and someone who has been in Canada for over 10 years - is assigned a value of 15 years.

    +

    Since SDCGRES is a categorical variable measuring length of time, we've set midpoints in + the function. A respondent identified as being in Canada for 0-9 years is assigned a value of + 4.5 years, and someone who has been in Canada for over 10 years is assigned a value of 15 years.

    Examples

    # Using Pct_time_fun() to create percent time values across CCHS cycles -# Pct_time_fun() is specified in variableDetails.csv along with the CCHS variables and cycles included. +# Pct_time_fun() is specified in variableDetails.csv along with the CCHS variables and cycles +# included. -# To transform Pct_time_der across cycles, use RecWTable() for each CCHS cycle and specify Pct_time_der, along with -# age (DHHGAGE_cont), whether or not someone was born in Canada (SDCGCBG), how long someone has lived in Canada (SDCGRES). -# Then by using bind_rows(), you can combine Pct_time_der across cycles +# To transform Pct_time_der across cycles, use RecWTable() for each CCHS cycle and specify +# Pct_time_der, along with age (DHHGAGE_cont), whether or not someone was born in Canada +# (SDCGCBG), how long someone has lived in Canada (SDCGRES). Then by using bind_rows(), +# you can combine Pct_time_der across cycles suppressMessages(library(bllflow)) library(cchsflow) -pct_time2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, datasetName = "cchs2010", -variables = c("DHHGAGE_cont", "SDCGCBG", "SDCGRES", "Pct_time_der"))
    #> [1] "NOTE: CCHS 2001 does not have don't know (7) or refusal (8)" +pct_time2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, +datasetName = "cchs2010", variables = c("DHHGAGE_cont", "SDCGCBG", "SDCGRES", "Pct_time_der"))
    #> [1] "NOTE: CCHS 2001 does not have don't know (7) or refusal (8)" #> [1] "NOTE: CCHS 2001 missing don't know (7), refusal (8)"
    head(pct_time2010)
    #> DHHGAGE_cont SDCGCBG SDCGRES Pct_time_der #> 1 22 1 NA(a) 1.0000000 #> 2 42 2 2 0.3571429 @@ -202,8 +206,8 @@

    Examp #> 4 37 1 NA(a) 1.0000000 #> 5 37 1 NA(a) 1.0000000 #> 6 32 1 NA(a) 1.0000000

    -pct_time2012 <- RecWTable(dataSource = cchs2012, variableDetails = variableDetails, datasetName = "cchs2012", -variables = c("DHHGAGE_cont", "SDCGCBG", "SDCGRES", "Pct_time_der"))
    #> [1] "NOTE: CCHS 2001 does not have don't know (7) or refusal (8)" +pct_time2012 <- RecWTable(dataSource = cchs2012, variableDetails = variableDetails, +datasetName = "cchs2012", variables = c("DHHGAGE_cont", "SDCGCBG", "SDCGRES", "Pct_time_der"))
    #> [1] "NOTE: CCHS 2001 does not have don't know (7) or refusal (8)" #> [1] "NOTE: CCHS 2001 missing don't know (7), refusal (8)"
    tail(pct_time2012)
    #> DHHGAGE_cont SDCGCBG SDCGRES Pct_time_der #> 195 42 1 NA(a) 1.000000 #> 196 57 1 NA(a) 1.000000 @@ -225,9 +229,10 @@

    Examp #> 398 77 1 NA(a) 1.000000 #> 399 47 1 NA(a) 1.000000 #> 400 85 1 NA(a) 1.000000

    -# Using Pct_time_fun() to generate a value for percent time spent in Canada with user inputted values -# Let's say you are 27 years old who was born outside of Canada and have been living in Canada for less than 10 years. -# Your estimated percent time spent in Canada can be calculated as follows: +# Using Pct_time_fun() to generate a value for percent time spent in Canada with user inputted +# values Let's say you are 27 years old who was born outside of Canada and have been living in +# Canada for less than 10 years. Your estimated percent time spent in Canada can be calculated +# as follows: pct_time <- Pct_time_fun(DHHGAGE_cont = 27, SDCGCBG = 2, SDCGRES = 1) diff --git a/docs/reference/Resp_condition_fun1.html b/docs/reference/Resp_condition_fun1.html index 679298de..bfedab37 100644 --- a/docs/reference/Resp_condition_fun1.html +++ b/docs/reference/Resp_condition_fun1.html @@ -41,9 +41,11 @@ - + @@ -77,7 +79,7 @@ cchsflow - 0.2.2 + 0.2.3
    @@ -148,9 +150,11 @@

    Resp_condition_fun1

    -

    This is one of 3 functions used to create a derived variable (Resp_condition_der) that determines if a respondents has a respirtory condition. - 3 different functions have been created to account for the fact that different respiratory variables are used across CCHS cycles. - This function is for CCHS cycles (2009-2014) that only use COPD and Emphysema as a combined variable.

    +

    This is one of 3 functions used to create a derived variable (Resp_condition_der) + that determines if a respondents has a respirtory condition. 3 different functions have been + created to account for the fact that different respiratory variables are used across + CCHS cycles. This function is for CCHS cycles (2009-2014) that only use COPD and Emphysema as a + combined variable.

    @@ -183,16 +187,19 @@

    See a

    Examples

    # Using Resp_condition_fun1() to create pack-years values across CCHS cycles (2009-2014) -# Resp_condition_fun1() is specified in variableDetails.csv along with the CCHS variables and cycles included. +# Resp_condition_fun1() is specified in variableDetails.csv along with the CCHS variables and +# cycles included. -# To transform Resp_condition_der, use RecWTable() for each CCHS cycle and specify Resp_condition_der, -# along with the various respiratory variables. Then by using bind_rows(), you can combined Resp_condition_der -# across cycles. +# To transform Resp_condition_der, use RecWTable() for each CCHS cycle and specify +# Resp_condition_der,along with the various respiratory variables. Then by using bind_rows(), +# you can combined Resp_condition_der across cycles. suppressMessages(library(bllflow)) library(cchsflow) -resp2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, datasetName = "cchs2010", -variables = c("DHHGAGE_cont", "CCC_091", "Resp_condition_der")) + +resp2010 <- RecWTable(dataSource = cchs2010, variableDetails = variableDetails, +datasetName = "cchs2010", variables = c("DHHGAGE_cont", "CCC_091", "Resp_condition_der")) + head(resp2010)
    #> DHHGAGE_cont CCC_091 Resp_condition_der #> 1 22 NA(a) NA #> 2 42 2 3 @@ -200,8 +207,9 @@

    Examp #> 4 37 1 1 #> 5 37 2 3 #> 6 32 NA(a) NA

    -resp2012 <- RecWTable(dataSource = cchs2012, variableDetails = variableDetails, datasetName = "cchs2012", -variables = c("DHHGAGE_cont", "CCC_091", "Resp_condition_der")) +resp2012 <- RecWTable(dataSource = cchs2012, variableDetails = variableDetails, +datasetName = "cchs2012", variables = c("DHHGAGE_cont", "CCC_091", "Resp_condition_der")) + tail(resp2012)
    #> DHHGAGE_cont CCC_091 Resp_condition_der #> 195 42 2 3 #> 196 57 2 3 @@ -210,6 +218,7 @@

    Examp #> 199 47 2 3 #> 200 85 2 3

    combined_resp <- bind_rows(resp2010, resp2012) + head(combined_resp)
    #> DHHGAGE_cont CCC_091 Resp_condition_der #> 1 22 NA(a) NA #> 2 42 2 3 diff --git a/docs/reference/Resp_condition_fun2.html b/docs/reference/Resp_condition_fun2.html index 159ddb39..5dd6edb9 100644 --- a/docs/reference/Resp_condition_fun2.html +++ b/docs/reference/Resp_condition_fun2.html @@ -41,8 +41,9 @@ - + @@ -76,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3
    @@ -147,8 +148,9 @@

    Resp_condition_fun2

    -

    This is one of 3 functions used to create a derived variable (Resp_condition_der) that determines if a respondents has a respirtory condition. - This function is for CCHS cycles (2005-2007) that use COPD & Emphysema as separate variables, as well as Bronchitis.

    +

    This is one of 3 functions used to create a derived variable (Resp_condition_der) + that determines if a respondents has a respirtory condition. This function is for CCHS cycles + (2005-2007) that use COPD & Emphysema as separate variables, as well as Bronchitis.

    @@ -190,16 +192,20 @@

    See a

    Examples

    # Using Resp_condition_fun2() to create pack-years values across CCHS cycles (2005-2007) -# Resp_condition_fun2() is specified in variableDetails.csv along with the CCHS variables and cycles included. +# Resp_condition_fun2() is specified in variableDetails.csv along with the CCHS variables and +# cycles included. -# To transform Resp_condition_der, use RecWTable() for each CCHS cycle and specify Resp_condition_der, -# along with the various respiratory variables. Then by using bind_rows(), you can combined Resp_condition_der -# across cycles. +# To transform Resp_condition_der, use RecWTable() for each CCHS cycle and specify +# Resp_condition_der, +# along with the various respiratory variables. Then by using bind_rows(), you can combined +# Resp_condition_der across cycles. suppressMessages(library(bllflow)) library(cchsflow) -resp2005 <- RecWTable(dataSource = cchs2005, variableDetails = variableDetails, datasetName = "cchs2005", -variables = c("DHHGAGE_cont", "CCC_91E", "CCC_91F", "CCC_91A", "Resp_condition_der")) + +resp2005 <- RecWTable(dataSource = cchs2005, variableDetails = variableDetails, +datasetName = "cchs2005", variables = c("DHHGAGE_cont", "CCC_91E", "CCC_91F", "CCC_91A", +"Resp_condition_der")) head(resp2005)
    #> DHHGAGE_cont CCC_91A CCC_91E CCC_91F Resp_condition_der #> 1 27 2 NA(a) NA(a) NA #> 2 77 2 2 2 3 @@ -207,8 +213,10 @@

    Examp #> 4 77 2 2 2 3 #> 5 85 2 2 2 3 #> 6 13 2 NA(a) NA(a) NA

    -resp2007_2008 <- RecWTable(dataSource = cchs2007_2008, variableDetails = variableDetails, datasetName = "cchs2007_2008", -variables = c("DHHGAGE_cont", "CCC_91E", "CCC_91F", "CCC_91A", "Resp_condition_der")) +resp2007_2008 <- RecWTable(dataSource = cchs2007_2008, variableDetails = variableDetails, +datasetName = "cchs2007_2008", variables = c("DHHGAGE_cont", "CCC_91E", "CCC_91F", "CCC_91A", +"Resp_condition_der")) + tail(resp2007_2008)
    #> DHHGAGE_cont CCC_91A CCC_91E CCC_91F Resp_condition_der #> 195 62 2 2 2 3 #> 196 37 2 2 2 3 @@ -216,7 +224,8 @@

    Examp #> 198 42 2 2 2 3 #> 199 32 2 2 2 3 #> 200 72 NA(b) 2 2 NA

    -combined_resp <- bind_rows(resp2005, resp2007_2008)
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    head(combined_resp)
    #> DHHGAGE_cont CCC_91A CCC_91E CCC_91F Resp_condition_der +combined_resp <- bind_rows(resp2005, resp2007_2008)
    #> Warning: Unequal factor levels: coercing to character
    #> Warning: binding character and factor vector, coercing into character vector
    #> Warning: binding character and factor vector, coercing into character vector
    +head(combined_resp)
    #> DHHGAGE_cont CCC_91A CCC_91E CCC_91F Resp_condition_der #> 1 27 2 NA(a) NA(a) NA #> 2 77 2 2 2 3 #> 3 32 2 2 2 3 diff --git a/docs/reference/Resp_condition_fun3.html b/docs/reference/Resp_condition_fun3.html index f2c048ec..ef013cb0 100644 --- a/docs/reference/Resp_condition_fun3.html +++ b/docs/reference/Resp_condition_fun3.html @@ -41,8 +41,9 @@ - + @@ -76,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3
    @@ -147,8 +148,9 @@

    Resp_condition_fun3

    -

    This is one of 3 functions used to create a derived variable (Resp_condition_der) that determines if a respondents has a respirtory condition. - This function for CCHS cycles (2001-2003) that use COPD and Emphysema as a combined variable, as well as Bronchitis

    +

    This is one of 3 functions used to create a derived variable (Resp_condition_der) + that determines if a respondents has a respirtory condition. This function for CCHS cycles + (2001-2003) that use COPD and Emphysema as a combined variable, as well as Bronchitis

    @@ -186,24 +188,30 @@

    See a

    Examples

    # Using Resp_condition_fun3() to create pack-years values across CCHS cycles (2001-2003) -# Resp_condition_fun3() is specified in variableDetails.csv along with the CCHS variables and cycles included. +# Resp_condition_fun3() is specified in variableDetails.csv along with the CCHS variables and +# cycles included. -# To transform Resp_condition_der, use RecWTable() for each CCHS cycle and specify Resp_condition_der, -# along with the various respiratory variables. Then by using bind_rows(), you can combined Resp_condition_der -# across cycles. +# To transform Resp_condition_der, use RecWTable() for each CCHS cycle and specify +# Resp_condition_der, along with the various respiratory variables. Then by using bind_rows(), +# you can combined Resp_condition_der across cycles. suppressMessages(library(bllflow)) library(cchsflow) -resp2001 <- RecWTable(dataSource = cchs2001, variableDetails = variableDetails, datasetName = "cchs2001", -variables = c("DHHGAGE_cont", "CCC_091", "CCC_91A", "Resp_condition_der"))
    #> [1] "NOTE: Not applicable, don't know, refusal, not stated (96-99) were options in CCHS 2003, but had zero responses"
    head(resp2001)
    #> DHHGAGE_cont CCC_091 CCC_91A Resp_condition_der + +resp2001 <- RecWTable(dataSource = cchs2001, variableDetails = variableDetails, +datasetName = "cchs2001", variables = c("DHHGAGE_cont", "CCC_091", "CCC_91A", +"Resp_condition_der"))
    #> [1] "NOTE: Not applicable, don't know, refusal, not stated (96-99) were options in CCHS 2003, but had zero responses"
    +head(resp2001)
    #> DHHGAGE_cont CCC_091 CCC_91A Resp_condition_der #> 1 85 2 2 3 #> 2 85 2 2 3 #> 3 32 2 2 3 #> 4 77 2 2 3 #> 5 22 NA(a) 2 NA #> 6 77 2 2 3
    -resp2003 <- RecWTable(dataSource = cchs2003, variableDetails = variableDetails, datasetName = "cchs2003", -variables = c("DHHGAGE_cont", "CCC_091", "CCC_91A", "Resp_condition_der"))
    #> [1] "NOTE: Not applicable, don't know, refusal, not stated (96-99) were options in CCHS 2003, but had zero responses"
    tail(resp2003)
    #> DHHGAGE_cont CCC_091 CCC_91A Resp_condition_der +resp2003 <- RecWTable(dataSource = cchs2003, variableDetails = variableDetails, +datasetName = "cchs2003", variables = c("DHHGAGE_cont", "CCC_091", "CCC_91A", +"Resp_condition_der"))
    #> [1] "NOTE: Not applicable, don't know, refusal, not stated (96-99) were options in CCHS 2003, but had zero responses"
    +tail(resp2003)
    #> DHHGAGE_cont CCC_091 CCC_91A Resp_condition_der #> 195 22 NA(a) 2 NA #> 196 57 2 1 1 #> 197 42 2 2 3 @@ -211,6 +219,7 @@

    Examp #> 199 17 NA(a) 2 NA #> 200 17 NA(a) 2 NA

    combined_resp <- bind_rows(resp2001, resp2003) + head(combined_resp)
    #> DHHGAGE_cont CCC_091 CCC_91A Resp_condition_der #> 1 85 2 2 3 #> 2 85 2 2 3 diff --git a/docs/reference/cchs2001.html b/docs/reference/cchs2001.html index d0adbb6b..13908f04 100644 --- a/docs/reference/cchs2001.html +++ b/docs/reference/cchs2001.html @@ -41,9 +41,9 @@ - + @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3
    @@ -148,9 +148,9 @@

    2001 CCHS data

    -

    This is a subset of 200 observations from the 2001 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada. -See the Statistics Canada Open License here.

    +

    This is a subset of 200 observations from the 2001 cycle of the Canadian Community Health Survey +(CCHS) Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics +Canada.

    @@ -168,7 +168,8 @@

    Value

    Details

    -

    Long name: cchs-82M0013-E-2001-c1-1-general-file

    +

    See the open license here.

    +

    Long name: cchs-82M0013-E-2001-c1-1-general-file

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/cchs-82M0013-E-2001-c1-1-general-file.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/cchs2003.html b/docs/reference/cchs2003.html index b86e057d..2d277345 100644 --- a/docs/reference/cchs2003.html +++ b/docs/reference/cchs2003.html @@ -41,9 +41,9 @@ - + @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3
    @@ -148,9 +148,9 @@

    2003 CCHS data

    -

    This is a subset of 200 observations from the 2003 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada. -See the Statistics Canada Open License here.

    +

    This is a subset of 200 observations from the 2003 cycle of the Canadian Community +Health Survey (CCHS) Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by +Statistics Canada.

    @@ -168,7 +168,9 @@

    Value

    Details

    -

    Long name: cchs-82M0013-E-2003-c2-1-General File

    +

    See the open licensehere.

    + +

    Long name: cchs-82M0013-E-2003-c2-1-General File

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/cchs-82M0013-E-2003-c2-1-GeneralFile.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/cchs2005.html b/docs/reference/cchs2005.html index 13168e7b..e2229cf9 100644 --- a/docs/reference/cchs2005.html +++ b/docs/reference/cchs2005.html @@ -41,9 +41,9 @@ - + @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -148,9 +148,9 @@

    2005 CCHS data

    -

    This is a subset of 200 observations from the 2005 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada. -See the Statistics Canada Open License here.

    +

    This is a subset of 200 observations from the 2005 cycle of the Canadian Community Health Survey +(CCHS) Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by +Statistics Canada.

    @@ -168,7 +168,9 @@

    Value

    Details

    -

    Long name: cchs-82M0013-E-2005-c3-1-main-file

    +

    See the open license here.

    + +

    Long name: cchs-82M0013-E-2005-c3-1-main-file

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/cchs-82M0013-E-2005-c3-1-main-file.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/cchs2007_2008.html b/docs/reference/cchs2007_2008.html index aa519b46..fa7ff044 100644 --- a/docs/reference/cchs2007_2008.html +++ b/docs/reference/cchs2007_2008.html @@ -41,9 +41,9 @@ - + @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -148,9 +148,9 @@

    2007-2008 CCHS data

    -

    This is a subset of 200 observations from the 2007-2008 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada. -See the Statistics Canada Open License here.

    +

    This is a subset of 200 observations from the 2007-2008 cycle of the Canadian Community Health +Survey (CCHS) Public Use Microdata file (PUMF) dataset. +The CCHS survey is conducted by Statistics Canada.

    @@ -168,7 +168,8 @@

    Value

    Details

    -

    Long name: cchs-E-2007-2008-AnnualComponent

    +

    See the open license here.

    +

    Long name: cchs-E-2007-2008-AnnualComponent

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/cchs-E-2007-2008-AnnualComponent.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/cchs2009_2010.html b/docs/reference/cchs2009_2010.html index 10c7645b..39a3e6c4 100644 --- a/docs/reference/cchs2009_2010.html +++ b/docs/reference/cchs2009_2010.html @@ -41,8 +41,9 @@ - + @@ -76,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -147,8 +148,9 @@

    2009-2010 CCHS data

    -

    This is a subset of 200 observations from the 2009-2010 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada.

    +

    This is a subset of 200 observations from the 2009-2010 cycle of the Canadian Community +Health Survey (CCHS) Public Use Microdata file (PUMF) dataset. +The CCHS survey is conducted by Statistics Canada.

    @@ -166,7 +168,7 @@

    Value

    Details

    -

    See the Statistics Canada Open License here.

    +

    See the open license here.

    Long name: CCHS-82M0013-E-2009-2010-Annualcomponent

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/CCHS-82M0013-E-2009-2010-Annualcomponent.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/cchs2010.html b/docs/reference/cchs2010.html index 5f1c8a21..9b3c5c54 100644 --- a/docs/reference/cchs2010.html +++ b/docs/reference/cchs2010.html @@ -41,9 +41,9 @@ - + @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -148,9 +148,9 @@

    2010 CCHS data

    -

    This is a subset of 200 observations from the 2010 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada. -See the Statistics Canada Open License here.

    +

    This is a subset of 200 observations from the 2010 cycle of the Canadian Community Health Survey +(CCHS) Public Use Microdata file (PUMF) dataset. +The CCHS survey is conducted by Statistics Canada.

    @@ -168,7 +168,8 @@

    Value

    Details

    -

    Long name: CCHS-82M0013-E-2010-AnnualComponent

    +

    See the open license here.

    +

    Long name: CCHS-82M0013-E-2010-AnnualComponent

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/CCHS-82M0013-E-2010-AnnualComponent.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/cchs2011_2012.html b/docs/reference/cchs2011_2012.html index ba060b7c..003bdf1b 100644 --- a/docs/reference/cchs2011_2012.html +++ b/docs/reference/cchs2011_2012.html @@ -41,9 +41,9 @@ - + @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -148,9 +148,9 @@

    2011-2012 CCHS data

    -

    This is a subset of 200 observations from the 2011-2012 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada. -See the Statistics Canada Open License here.

    +

    This is a subset of 200 observations from the 2011-2012 cycle of the Canadian Community Health +Survey (CCHS) Public Use Microdata file (PUMF) dataset. +The CCHS survey is conducted by Statistics Canada.

    @@ -168,7 +168,9 @@

    Value

    Details

    -

    Long name: cchs-82M0013-E-2011-2012-Annual-component

    +

    See the open license here.

    + +

    Long name: cchs-82M0013-E-2011-2012-Annual-component

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/cchs-82M0013-E-2011-2012-Annual-component.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/cchs2012.html b/docs/reference/cchs2012.html index 7535ab24..58a190ff 100644 --- a/docs/reference/cchs2012.html +++ b/docs/reference/cchs2012.html @@ -41,9 +41,9 @@ - + @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -148,9 +148,9 @@

    2012 CCHS data

    -

    This is a subset of 200 observations from the 2012 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada. -See the Statistics Canada Open License here.

    +

    This is a subset of 200 observations from the 2012 cycle of the Canadian Community Health Survey +(CCHS) Public Use Microdata file (PUMF) dataset. +The CCHS survey is conducted by Statistics Canada.

    @@ -168,7 +168,8 @@

    Value

    Details

    -

    Long name: cchs-82M0013-E-2012-Annual-component

    +

    See the open license here.

    +

    Long name: cchs-82M0013-E-2012-Annual-component

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/cchs-82M0013-E-2012-Annual-component.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/cchs2013_2014.html b/docs/reference/cchs2013_2014.html index 923613d9..757ecc87 100644 --- a/docs/reference/cchs2013_2014.html +++ b/docs/reference/cchs2013_2014.html @@ -41,9 +41,9 @@ - + @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -148,9 +148,9 @@

    2013-2014 CCHS data

    -

    This is a subset of 200 observations from the 2013-2014 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada. -See the Statistics Canada Open License here.

    +

    This is a subset of 200 observations from the 2013-2014 cycle of the Canadian Community Health +Survey (CCHS) Public Use Microdata file (PUMF) dataset. +The CCHS survey is conducted by Statistics Canada.

    @@ -168,7 +168,8 @@

    Value

    Details

    -

    Long name: cchs-82M0013-E-2013-2014-Annual-component

    +

    See the open license here.

    +

    Long name: cchs-82M0013-E-2013-2014-Annual-component

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/CCHS-82M0013-E-2013-2014-Annual.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/cchs2014.html b/docs/reference/cchs2014.html index b8df691b..f75c1409 100644 --- a/docs/reference/cchs2014.html +++ b/docs/reference/cchs2014.html @@ -41,9 +41,9 @@ - + @@ -77,7 +77,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -148,9 +148,9 @@

    2014 CCHS data

    -

    This is a subset of 200 observations from the 2014 cycle of the Canadian Community Health Survey (CCHS) -Public Use Microdata file (PUMF) dataset. The CCHS survey is conducted by Statistics Canada. -See the Statistics Canada Open License here.

    +

    This is a subset of 200 observations from the 2014 cycle of the Canadian Community Health Survey +(CCHS) Public Use Microdata file (PUMF) dataset. +The CCHS survey is conducted by Statistics Canada.

    @@ -168,7 +168,8 @@

    Value

    Details

    -

    Long name: cchs-82M0013-E-2014-Annual-component

    +

    See the open license here.

    +

    Long name: cchs-82M0013-E-2014-Annual-component

    DDI: https://github.com/Big-Life-Lab/cchsflow/blob/master/inst/extdata/CCHS_DDI/cchs-82M0013-E-2014-Annual-component.xml

    Additional documentation (PDFs): https://osf.io/hkuy3/

    diff --git a/docs/reference/ifelse2.html b/docs/reference/ifelse2.html index 8a09d724..598bf7f0 100644 --- a/docs/reference/ifelse2.html +++ b/docs/reference/ifelse2.html @@ -75,7 +75,7 @@ cchsflow - 0.2.2 + 0.2.3 diff --git a/docs/reference/index.html b/docs/reference/index.html index ec2ac318..d13d8303 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -73,7 +73,7 @@ cchsflow - 0.2.2 + 0.2.3 @@ -229,6 +229,12 @@

    Resp_condition_fun3()

    Resp_condition_fun3

    +

    DHHGAGE_cat_fun()

    +

    Derived categorical age