Create a dataset that can be used to produce a PHR cumulative incidence curves and effect plots.

plot_phr(
  ...,
  effect_measure_type = NULL,
  smooth = FALSE,
  alpha = 0.05,
  ref = 1
)

Arguments

...

cumrisk objects supplied as a list or as seperate arguments

effect_measure_type

The type of effect to plot (default NULL = plots cumulative risk funtions), valid options include: RD,CD,RR, CR,AR, logRR.

smooth

A flag to indicate the use of LOESS smoothing for risk difference

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 = seq(0,24,0.1),
                       labels = c("IPTCW main analysis"))

plot_phr(fit)
#> # A tibble: 482 × 7
#>     time estimate      lcl     ucl group_label grp1                grp2 
#>    <dbl>    <dbl>    <dbl>   <dbl> <fct>       <fct>               <fct>
#>  1   0    0       0        0       Control     IPTCW main analysis NA   
#>  2   0.1  0       0        0       Control     IPTCW main analysis NA   
#>  3   0.2  0       0        0       Control     IPTCW main analysis NA   
#>  4   0.3  0.00127 0        0.00255 Control     IPTCW main analysis NA   
#>  5   0.4  0.00127 0        0.00255 Control     IPTCW main analysis NA   
#>  6   0.5  0.00164 0.000261 0.00302 Control     IPTCW main analysis NA   
#>  7   0.6  0.00349 0.000325 0.00665 Control     IPTCW main analysis NA   
#>  8   0.7  0.00426 0.000920 0.00759 Control     IPTCW main analysis NA   
#>  9   0.8  0.00583 0.00214  0.00951 Control     IPTCW main analysis NA   
#> 10   0.9  0.00599 0.00230  0.00969 Control     IPTCW main analysis NA   
#> # … with 472 more rows