Skip to content

Bug fixes for acs#12

Merged
rwbuie merged 12 commits intodevfrom
bug_fixes_for_acs
Mar 3, 2025
Merged

Bug fixes for acs#12
rwbuie merged 12 commits intodevfrom
bug_fixes_for_acs

Conversation

@dcolombara
Copy link
Copy Markdown
Contributor

  • chi_calc now processes correctly when numerator == 0, uses Wilson
    Score for calculating the CI when numerator == 0, triggers caution flag
    when numerator ==0 (or RSE > 30%)
  • chi_calc can now distinguish between CHI indicators that must meet all
    standards and non-CHI indicators that are processed with CHI for
    efficiency/convenience
  • chi_generate_analysis_set ... allow to use a table in memory in addition
    to tables in prod server
  • chi_generate_metadata allows for missing data specified by the user
  • chi_generate_tro_shell .. more tweaks to get race3/race4 to behave
  • chi_generate_tro_shell ... fix so the trends only created for specific
    indicator_keys
  • chi_qa_tro ... intelligent roundning based on whether metadata designates
    estimates as integers, rates, or proportions
  • chi_qa_tro ... checks for missing years in data
  • chi_qa_tro ... allow exceptions for ACS's unique qualities
  • chi_qa_tro, allow for legitimate cases where RSE is NA, namely when
    numerator == 0
  • chi_sql_update renamed to to chi_update_sql to follow naming convention

 - before created race3_hispanic when needed
   but stopped if there was race3_hispanic.
   It was non-sensical. Now gives informative
   messages
 - chi_calc checks to make sure that all CHI
   cat1_varname and cat2_varname are coded
   as would be expected based upon rads.data::
   misc_chi_byvars. However, there are times
   we have non-CHI variables that are created
   alongside CHI (for example for BSK, COO, etc.).
   This allows the function to maintain strict
   standards for CHI variables but with
   flexibility if we are producing non-CHI
   estimates
 - previously gave empty rows for trends when there were no real trends to calculate
 - previously if there were any indicators that had trends,
   then rows for trends would be created for all variables.
    Now it will only create trend rows for specific
    variables that should have trends calculated
 - Wilson score gives better CI when 0% or 100%
 - Needed to add level because when using factor
   variables in calc, will get estimates for each
   level and need a way to filter out undesired
   levels from CHI output
 - ACS does not need to have cat1_varname, cat2_varname, numerator, and denominator
 - RSE is legitimately NA (actually undefined)
   when numerator is zero and therefore the
   result would be zero, which puts zero in
   the denominator for calculating RSE
 - properly deal with times when numerator == 0
 - Wilson socre no longer depends on se == 0, but only that result is 0 or 1
  - caution flag now noted when numerator == 0 (in addition to RSE > 30)
 - now follows standard naming convention in this pacackage:
  chi _ verb _ noun
 - now allows a specific indicator to be missing a
   specific bit of information. For example,
   in ACS
   medinc variable does not have latest_year_count
 - does not allow race4 to be 'Ethnicity' ...
   another of many tweaks
   to deal with insanity of race3/race4
 - previously only could read relevant tables
   from prod server
 - Now can use a data.frame/data.table in memory to make
   an anlysis set
 - allow for proper rounding based on whether
   integer, proportion, or rate
 - ensures there are no gaps in single years for trends
  - warns if there appears to be more than one distinct multi year 'year' value
 - streamlined messaging and warnings depdenent upon verbose argument
@dcolombara dcolombara added bug Something isn't working enhancement New feature or request labels Mar 3, 2025
@rwbuie rwbuie merged commit 8b530bd into dev Mar 3, 2025
@rwbuie rwbuie deleted the bug_fixes_for_acs branch March 3, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants