Skip to content

Added ci parameter to chi_calc()#10

Merged
rwbuie merged 35 commits intodevfrom
chi_calc_CI_option
Feb 24, 2025
Merged

Added ci parameter to chi_calc()#10
rwbuie merged 35 commits intodevfrom
chi_calc_CI_option

Conversation

@dcolombara
Copy link
Copy Markdown
Contributor

Added ci parameter to chi_calc()

motivated by Joie's request to calculate 90% CI, not 95%, so pass ci argument to rads::calc()

passed all tests

 - drop VignetteBuilder: knitr b/c no vignettes to build
 - added future and future.apply to imports
 - replace remote install of rads.data with rads b/c rads is needed too
   and auto installs rads data
 - removed self reference to github::PHSKC-APDE/apde.chi.tools
 - changed role = 'auth' to role = 'aut'
 - tweaked the Description paragraph, which must be in complete sentences
 - specify namespace for substrRight, calc,chi_cols,
   compare_estimate, get_population,
 - added @importFrom for crossing & substrRight
 - replace .() with list()
 - added trend.span parameter that was missing
 - name space updated by devtools::document() due to importFrom
 - to avoid warnings about missing visible bindings for global variables
- chi_generate_trend_years does not exist for testing
 - added year.span as explicit argument to chi_generate_tro_shell()  and test
 - replaced `span` (undefined var) with `trend.span) in chi_process_trends
- Replaced `assign()` calls with local variable assignments within `chi_calc`
  function to improve encapsulation and avoid unintended
  side effects in the global environment
- Simplified code for better readability and maintainability
- Removed unnecessary cleanup of global variables (`rm()`)
- Eliminating globals within package functions is important
  for ensuring predictability, avoiding conflicts,
  and maintaining clean, self-contained functions
 - validate_yaml_data >> tsql_validate_field_types
 - updated filepath to CHI standards
 - update roxygen2 header
 - added chi_get_yaml & chi_get_cols to streamline code
 - updated references to chi_qa >> chi_qa_tro
 sql_clean deprecated in rads
 - replace validate_yaml_data with tsql_validate_field_types
 - replace import and refernce to imported YAML with
   get_chi_yaml and get_chi_cols
 - updated / improved header
 - based on email from Joie on 2/18/2025
- BUG FIX: arguments for where statement in future_lapply
  rads::calc were out of scope. Fix was to subset ph.data
  directly using data.table/dtsurvey syntax
- added progress bar for future_lapply
- simplified syntax within future_lapply
- eliminated creation of columns Joie no longer wants:
  comparison_with_kc, significance, time_trends
- input validation
- switch to using na.omit rather than setdiff(X, NA)
- better roxygen2 header
 - improved headers
 - added section compare cat1*/cat2* with rads.data::misc_chi_byvars
 - chi_est >> NOW CHIestimates
 - chi_meta >> NOW CHImetadata
 - removed declaration of globals (now in separate file)
 - dropped all ref to `comparison_with_kc`
 -
 - as always, so devtools::check() plays nicely with data.table syntax
 - BUG FIX in error check for server argument values
 - BUG FIX in error check for CHIestimates and CHImetadata:
   both checked if exists, but always existed bc NULL.
   Now checks if NULL
 - Eliminated asking if want to create a table that doesn't exist.
   Replaced with a Warning because the need
   for a reply broke the esting and would also
   break if used in a long data processing piepline
 - Improved headers
 - improved header
 - added input validation
 - Limit the available years in metadata to 10
   years, since trends are only for 10 years.
 - Added link to reference docs
 - Made bullet point list
 - no functional change
- New code to create the analysis_set if it it does not exist
- Output is used by chi_generate_tro_shell
 - used to identify differences between two
   datasets (typically the current year's and
   last year's), in order to identify notable
   changes
 - most new ones use contents of testthat/helper.R
 - improved tests for chi_generate_tro_shell
 - created a dummy test for chi_process_trends
   > this can be updated in the future, but I
   wanted to pass all tests.
 - updated for new functions and function revisions
 - will make separate vignetted for rates
 - put in /quarto_docs rather than /vignettes
   bc vignettes expects files that can be
   rendered during package builds. Currently,
   RMD but not QMD can be used that way.
 - previously said it woudl not load the table
   if it did not previously exist. Now it
   states that a new table will be made
 - improved details in header
 - removed ignore_trends argument because Joie
   officially asked that we no longer have the
   time_trends column
 - added tweaks to deal with the non-standard
   nature of birth data race/ethicity
 - changed name of code for chi_calc and
   chi_compare_estimeates & which resulted
   in inconsequential changes to their helpfiles
 - specifying a minimum version
   caused devtools::check() to fail
 - Joie changed default to 90% CI, and good
   to have option to change on demand from 90%
@rwbuie rwbuie merged commit 5e31754 into dev Feb 24, 2025
@rwbuie rwbuie deleted the chi_calc_CI_option branch February 24, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants