-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to make n-way tables #22
Comments
2020-06-15: |
2020-06-11 - Notes from while I was on the plane:
Row/column labels
|
Do this in a new branch |
So, meantables uses group_by. Then, the output is labeled "response_var" and "group_var". It might be worth considering keeping this consistent. One varmtcars %>% freq_table(am) Two+ varsmtcars %>% group_by(mpg) %>% freq_table(am) Could even have "response_var" (or something similar) and "group_var" in table of results. |
Needed it on the Sun Study for this (as an example):
Tested this in stata with: by period_f, sort : tabulate teacher_f ss_application_f, chi2. It returns this: Tried it in SAS using :
Which returned I also tried proc surveyfreq, but that won't return chisq for three-way tables. |
Overview
Currently, I
freqtables
will only create one- and two-way tables. It will not create n-way tables. We want to add the ability to create n-way tables.What I had in mind was something like:
However, what I've been doing in the meantime is:
And then:
Obviously, this is more verbose, but it gets the job done and is very versitile (e.g., user can return a list instead of a data frame). However, the spirit of freqtables isn't really to be the most "versitile" package. It's to be the easiest to use "out of the box" for 85%+ of normal use. Give this some thought.
The suggestion from a user on RStudio Community could also be useful:
Left off at
2023-03-17: Working on test.Rmd as part of #40.
/inst/extdata/freq_study.dta
and/inst/extdata/freq_study.xpt
.data-raw/study.R
./inst/extdata/compare_freqtables.do
- and a SAS script -/inst/extdata/compare_freqtables.sas
.2020-06-11: Created test.Rmd on the plane to Minnesota to test out different ways of doing this. test.Rmd is git ignored and build ignored.
Tasks
/inst/extdata/compare_freqtables.do
). Use them for comparison./inst/extdata/compare_freqtables.sas
). Use them for comparison.The text was updated successfully, but these errors were encountered: