From 19e60a964f8d1a8f8b387f5f06302f30ce4303d5 Mon Sep 17 00:00:00 2001 From: Warsame Yusuf Date: Fri, 29 Nov 2019 14:17:37 -0500 Subject: [PATCH] [Feature] update html files --- .DS_Store | Bin 18436 -> 18436 bytes docs/.DS_Store | Bin 10244 -> 10244 bytes docs/articles/usingcchsflow.html | 73 ++++++++++++++++++++++++----- docs/articles/variableDetails.html | 4 +- docs/articles/variablesSheet.html | 10 ++-- docs/index.html | 2 +- docs/news/index.html | 7 +++ 7 files changed, 77 insertions(+), 19 deletions(-) diff --git a/.DS_Store b/.DS_Store index dea71d612e91c499b68e3dacdfd7dfa9a3d7b2e8..4f29d5918cf8b6cdf51142b53b91543049beceda 100644 GIT binary patch delta 123 zcmZpfz}PZ@aYMiQ)Yq>Ca?`8dETt#lm{Csel*L=1wa%R+#8!7Kd)Q5&$B}Flhh) delta 110 zcmZpfz}PZ@aYMiQ=C#6EOp||Vs&DoX^Jm(eucOMy#N|2J(IR|ur=jv@0Syht$#0CT zCl_lbG47dMrL4U9r~Wkd$!mp6C$m^sPrhs1wt2SzD@cv%Ba40)yFn~cwUSe)4r?P_qgv-FeAjzP|;J^^V z5W|qlP{7bUSwK>r^$Ei>hUb$_B!jtEGp=D=%eakkH{+hkdBUMAu5Mf&m@e9!ASK2q agV)$e()EmsH@^`T<)5rB?N6Lq2_^vck3T~I delta 1098 zcmcJNOGs2v7{|ZAJ-p{$)H9Bb<0~~EsQDg6E8j*1Why%PNVIY8t#0Za@lK;jHH(CZ zjDjHxDp~|l)*{e0K^tq~s)8htT0~Ks7C{jhwdl-TH*Km#-Nn7!?|07m9=|i)KHYx5 z#KwAbug~bzr?k*(ySr+T#|Lz6qHWBt`wVlxHg1YYA5h z%ZZ_e{AIM?z;XHBDCBVyN1rdqP+J zM|wS`S2I-IINTl3O?_xY1>Pv+S-81HU<%(Qmfe_d-N4ALV!v@RNAt8O ze7vGJ!oo-TLaP9x5rZUTAPYIjMIK5~4i_p>B`h?esTnO16>Sj}edxyk289qE!x)7D zA0~y46F7-eID@k|7x6NSE4YelxQ<&Po|Zcw=lC2O6!ZDJrvFdRNB_F%f7SC>`~+bc B{j~r9 diff --git a/docs/articles/usingcchsflow.html b/docs/articles/usingcchsflow.html index 17e288aa..ba0d5276 100644 --- a/docs/articles/usingcchsflow.html +++ b/docs/articles/usingcchsflow.html @@ -147,8 +147,8 @@

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 142 variables that can be transformed. The variables are divided into 7 sections, and 40 subjects.

@@ -254,7 +254,7 @@

## 2 2 2 1 ## 3 NA::a 6 0 ## 4 NA::b 7:9 0 -
combinedSex <- bind_rows(sex2001, sex2013)
+
combinedSex <- bind_rows(sex2001, sex2013)
@@ -312,7 +312,7 @@

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 = variableDetails, datasetName = "cchs2013", variables = c("DHHGAGE_B"))
-
combinedAge_cat <- bind_rows(age2001, age2013)
+
combinedAge_cat <- bind_rows(age2001, age2013)
@@ -389,7 +389,7 @@

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 = variableDetails, datasetName = "cchs2013", variables = c("DHHGAGE_cont"))
-
combinedAge_cont <- bind_rows(age2001_cont, age2013_cont)
+
combinedAge_cont <- bind_rows(age2001_cont, age2013_cont)
+ @@ -645,6 +663,9 @@

+ + +
@@ -456,7 +456,7 @@

## 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)
+
combinedAgeSex <- bind_rows(agesex_2001, agesex_2013)
 labelledCombinedAgeSex <- SetDataLabels(dataToLabel = combinedAgeSex, variableDetails = variableDetails, variablesSheet = variables)
@@ -554,6 +554,9 @@

+ @@ -569,6 +572,9 @@

+ + + +
FVCDTOT +DHHGAGE_C +
12 +4 +
@@ -583,6 +589,9 @@

4 +5 +
@@ -597,6 +606,9 @@

20 +7 +
@@ -611,6 +623,9 @@

9 +7 +
@@ -630,6 +645,9 @@

FVCDTOT +DHHGAGE_C +
25 +2 +
@@ -659,6 +680,9 @@

15 +1 +
@@ -673,10 +697,13 @@

6 +1 +
-
combinedCCHS <- bind_rows(transformed2001, transformed2013)
+
combinedCCHS <- bind_rows(transformed2001, transformed2013)
 labelledCombinedCCHS <- SetDataLabels(dataToLabel = combinedCCHS, variableDetails = variableDetails, variablesSheet = variables)
@@ -692,6 +719,9 @@

+ @@ -710,6 +740,9 @@

+ @@ -727,6 +760,9 @@

+ @@ -744,6 +780,9 @@

+ @@ -761,6 +800,9 @@

+ @@ -778,6 +820,9 @@

+ @@ -795,6 +840,9 @@

+ @@ -812,6 +860,9 @@

+ @@ -823,8 +874,8 @@

## "Age" "Age" ## DHH_SEX FVCDTOT ## "Sex" "Total fruit/veg consumption" -## DHHGAGE_B -## "Age" +## DHHGAGE_C DHHGAGE_B +## "Age" "Age"

@@ -838,7 +889,7 @@

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)

@@ -848,7 +899,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(variableDetails$notes)), "variables with notes.")
-
## `cchsflow` includes 33 variables with notes.
+
## `cchsflow` includes 36 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.

This note informs the decision to combine values 96 to 99 in DHHGAGE_A for CCHS2003 into one common missing value NA::b. The label for the NA::b category is, “don't know (97); refusal (98); not stated (99)”.

diff --git a/docs/articles/variableDetails.html b/docs/articles/variableDetails.html index 309be579..c5bfa67e 100644 --- a/docs/articles/variableDetails.html +++ b/docs/articles/variableDetails.html @@ -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 1129 rows and 16 columns

diff --git a/docs/articles/variablesSheet.html b/docs/articles/variablesSheet.html index 36558c87..4a4c392f 100644 --- a/docs/articles/variablesSheet.html +++ b/docs/articles/variablesSheet.html @@ -122,11 +122,11 @@

Introduction

This vignette describes how the variables.csv worksheet is organized and how to find variables that you can transform. See also the vignette variableDetails.csv. The vignette Using cchsflow provides examples of how to use the two worksheeets with the bllflow package.

Read variables.csv

-
#> 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"
-
- +
#> There are 142 variables, grouped in 40 subjects and 7 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 4 age variables that are used in the Transform CCHS variables vignette. All 4 variables are in the age subject. Try sorting the subject column by clicking the up beside the `subject` heading: the top 4 rows of the table should show the age variables:
+#> [1] "DHHGAGE_A"    "DHHGAGE_B"    "DHHGAGE_cont" "DHHGAGE_C"
+
+

diff --git a/docs/index.html b/docs/index.html index 0fced6b1..3af9a809 100644 --- a/docs/index.html +++ b/docs/index.html @@ -119,7 +119,7 @@

Usage

-

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.

+

cchsflow creates harmonized variables (where possible) between CCHS cycles. Searching BMI in variables (described in the Introduction section of variableDetails.csv vignette) 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
diff --git a/docs/news/index.html b/docs/news/index.html
index 891168ef..d5f63b6e 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -151,6 +151,7 @@ 

  • 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
  • +
  • Updates to variables.csv & variableDetails.csv

@@ -158,6 +159,12 @@

  • 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.
  • +
  • +New WTS_M - sampling weight variable
  • +
  • +New DHHGHSZ - household size
  • +
  • +New INCGHH_A, INCGHH_B, INCGHH_C, INCGHH_cont - household income. The categories for household income vary across CCHS cycles so three categorical variables were added along with a continuous variable that harmonizes household income across all CCHS cycles by taking the midpoint of each category.

FVCDTOT +DHHGAGE_C + DHHGAGE_B 12 +4 + NA 4 +5 + NA 20 +7 + NA 9 +7 + NA 25 +2 + 2 15 +1 + 1 6 +1 + 1