cards
cards copied to clipboard
More `ard_categorical()` efficiencies 😿
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.
- Instead of handling
denominator = c("column", "row", "cell")
entirely separately, we can instead includeuseNA="always"
for the primary variable tabulation, then calculate the Ns by performing a grouped sum of"n"
. - 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.