cards icon indicating copy to clipboard operation
cards copied to clipboard

More `ard_categorical()` efficiencies 😿

Open ddsjoberg opened this issue 1 year ago • 0 comments

I was fixing an edge-case bug in ard_categorical() when the variable was all NA. To correct this, I made an update to the way the denominator N was calculated. After the update, there is now a space for an efficiency gain when denominator = c("column", "row", "cell"), the most common cases.

  1. Instead of handling denominator = c("column", "row", "cell") entirely separately, we can instead include useNA="always" for the primary variable tabulation, then calculate the Ns by performing a grouped sum of "n".
  2. The other cases allowed in denominator will still be handled in the same way they are now. But as these are less common calculations, I expect an overall gain in efficiency.

ddsjoberg avatar Feb 14 '24 03:02 ddsjoberg