You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug: {p_miss_unweighted} in tbl_svysummary Displays Proportion Instead of Percentage
Description
When using {p_miss_unweighted} in the missing_stat argument of tbl_svysummary, it incorrectly displays the proportion (on a 0–1 scale) instead of the percentage (on a 0–100 scale). This inconsistency can cause confusion and misinterpretation.
For the missing rows (e.g., Unknown), the table shows:
For var1: 2 (0.3%)
For var2: 2 (0.3%)
The percentage value (0.3%) appears to be incorrectly derived as if it were a proportion (0.003) formatted directly as a percentage without multiplying by 100.
Expected Output
The correct missing statistics should display percentages:
For var1: 2 (30.0%)
For var2: 2 (30.0%)
Proposed Fix
Update the internal logic for {p_miss_unweighted} to ensure the proportion is multiplied by 100 before formatting. This will align the behavior of {p_miss_unweighted} with other placeholders like {p}, which correctly display percentages.
This bug leads to significant misinterpretation in summary tables. Thank you for addressing this issue!
The text was updated successfully, but these errors were encountered:
Bug:
{p_miss_unweighted}
intbl_svysummary
Displays Proportion Instead of PercentageDescription
When using
{p_miss_unweighted}
in themissing_stat
argument oftbl_svysummary
, it incorrectly displays the proportion (on a 0–1 scale) instead of the percentage (on a 0–100 scale). This inconsistency can cause confusion and misinterpretation.Reproducible Example
Observed Output
For the missing rows (e.g.,
Unknown
), the table shows:var1
:2 (0.3%)
var2
:2 (0.3%)
The percentage value (
0.3%
) appears to be incorrectly derived as if it were a proportion (0.003
) formatted directly as a percentage without multiplying by 100.Expected Output
The correct missing statistics should display percentages:
var1
:2 (30.0%)
var2
:2 (30.0%)
Proposed Fix
Update the internal logic for
{p_miss_unweighted}
to ensure the proportion is multiplied by 100 before formatting. This will align the behavior of{p_miss_unweighted}
with other placeholders like{p}
, which correctly display percentages.This bug leads to significant misinterpretation in summary tables. Thank you for addressing this issue!
The text was updated successfully, but these errors were encountered: