Create a dataset that can be used to produce a PHR forest plot

forest_plot_phr(
  ...,
  risk_time = NULL,
  effect_measure_type = NULL,
  alpha = 0.05,
  ref = 1
)

Arguments

...

cumrisk objects supplied as a list or as seperate arguments

risk_time

The desired time at which to extract the the cumulative risk and risk difference. If null, uses the maximum time in the ipwrisk object.

effect_measure_type

The type of effect to plot (default NULL = plots cumulative risk functions)

alpha

The desired nominal significance level of the confidence intervals.

ref

Identifies the treatmet group in the supplied object(s) to be used as a referent category for risk differecence curves. Defaults to one.

Value

A tibble in the format for upload to a PHR using nswpr

Examples

models = specify_models(identify_treatment(Statin, formula = ~DxRisk ),
                        identify_censoring(EndofEnrollment, formula = ~DxRisk),
                        identify_outcome(Death))

fit = estimate_ipwrisk(example1, models,
                       times = 24,
                       labels = c("IPTCW main analysis"))

models2 = specify_models(identify_treatment(Statin),
                         identify_censoring(EndofEnrollment),
                         identify_outcome(Death))

fit2 = estimate_ipwrisk(example1, models,
                        times = 24,
                        labels = c("Unweighted main analysis"))

forest_plot_phr(fit, fit2)
#> # A tibble: 4 × 6
#>   analysis                 group    risk ci_lo ci_hi risk_time
#>   <fct>                    <fct>   <dbl> <dbl> <dbl>     <dbl>
#> 1 IPTCW main analysis      Control 0.441 0.374 0.508        24
#> 2 IPTCW main analysis      Treat   0.525 0.500 0.549        24
#> 3 Unweighted main analysis Control 0.441 0.374 0.508        24
#> 4 Unweighted main analysis Treat   0.525 0.500 0.549        24