Add vignette on combine cut interaction functions#195
Conversation
|
|
||
| And now we have a new Categorical type variable with the alias `age4`, the name "Age (4 categories)", and it's made of 4 categories. | ||
|
|
||
| # Re-Combining Answer Choices |
There was a problem hiding this comment.
When I read re-combining at first, I found it a bit awkward. I wonder if maybe just "Combining answer choices" would be better here?
There was a problem hiding this comment.
Yeah. Re-combining is not great. Let's switch
|
|
||
| We have created a new Multiple Response type variable with the alias `boap_combined`, the name "Approval of Obama on issues (Combined Subvariables)", which has 4 subvariables instead of the original 13. | ||
|
|
||
| # Re-Combining Variables |
There was a problem hiding this comment.
Again, I think this might be ok just called "Combining variables"
|
|
||
| # Re-Combining Variables | ||
| Besides re-combining answer choices, we can also re-combine variables. For example, if our dataset has a categorical type variable for gender and another categorical type variable for Age, then we can cross these two together into a new variable using the `interactVariables()` function (named after the use of 'interaction terms' in regression). | ||
|
|
There was a problem hiding this comment.
It might be nice to add a more elaborated use case in here.
Codecov Report
@@ Coverage Diff @@
## master #195 +/- ##
=======================================
Coverage 89.81% 89.81%
=======================================
Files 104 104
Lines 6355 6355
=======================================
Hits 5708 5708
Misses 647 647
Continue to review full report at Codecov.
|
…ch into GitBrianLaw-combine_vignette
…is loaded, and a user uses ?cut they are provided with a choice of pages to visit so we aren't clobbering the base-version, and we get free pkgdown linking this way (as well as an easier way to get to crunch::cut's documentation))
…ttes that are already created.
…crunch into combine_vignette
jonkeane
left a comment
There was a problem hiding this comment.
I've addressed most of these questions myself. I also reworked the cooking-show in make-vignette-rdata so as not to have the new variables we create for this vignette show up in the previous vignettes.
| # options(crunch.api=getOption("test.api"), | ||
| # crunch.debug=FALSE, | ||
| # crunch.email=getOption("test.user"), | ||
| # crunch.pw=getOption("test.pw")) |
There was a problem hiding this comment.
I should have mentioned this before, brian, we should set up your r profile to have values for these options that point to a good backend. In the repository these lines should stay uncommented.
|
|
||
| - `cut()` allows you to transform a continuous numeric variable into a set of bins | ||
| - `combine()` lets you collapse a categorical variable's categories together | ||
| - `subtotals()` displays subtotaled categories along side the other categories |
There was a problem hiding this comment.
We don't go into too much detail about this lower down, so I would vote that we remove it from our list here.
| ``` | ||
| And now we have a new variable with the alias `age3`, the name "Age (3 categories)", and a category that combines 18 to 44 year-olds. | ||
|
|
||
| Note how this created an entirely new variable and so we can use it just like any other variable in Crunch. We can hide the original "Age (4 categories)" variable because we no longer need it. Hiding the original variable will not affect our new variable. |
There was a problem hiding this comment.
Do we want to link to the vignette that explains hide? or the help file? Or provide an example?
Brian first draft of vignette on combine cut and interAction functions