Skip to contents

Turns the numeric output of responder_analysis() into a compact, display-ready data frame: proportions and risk differences as percentages, the risk ratio and odds ratio with intervals, and the number needed to treat in the form of Altman (1998): NNTB for benefit, NNTH for harm, and an interval that passes through infinity when the risk-difference interval includes 0. Used by the print() method, the bundled Shiny app and handy for reports.

Usage

format_responder_results(results, digits = 1)

Arguments

results

A data frame returned by responder_analysis().

digits

Number of decimal places (default 1).

Value

A data frame with character columns Method, PE, PC, RD, RR, OR and NNT (percentages for proportions and RD; ratios for RR and OR). Methods without a variance model show point estimates only.

References

Altman DG (1998). Confidence intervals for the number needed to treat. BMJ, 317(7168), 1309 to 1312. doi:10.1136/bmj.317.7168.1309

Examples

format_responder_results(responder_analysis(sample_responder_data, mid = 1))
#>            Method   PE   PC                  RD                  RR
#> 1      Individual    -    - 25.5 (20.0 to 31.0) 2.15 (1.79 to 2.58)
#> 2   Weighted mean 47.6 22.1 25.5 (20.0 to 31.1) 2.16 (1.80 to 2.59)
#> 3 Unweighted mean 47.7 22.8                24.9                2.09
#> 4          Median 48.7 21.5                27.2                2.26
#>                    OR                   NNT
#> 1 3.20 (2.45 to 4.18) NNTB 3.9 (3.2 to 5.0)
#> 2 3.21 (2.46 to 4.19) NNTB 3.9 (3.2 to 5.0)
#> 3                3.09              NNTB 4.0
#> 4                3.46              NNTB 3.7