This function returns a ggplot derived from an rpsftm object showing hazard ratio and 95 percent CI for each psi tested in the g-estimation. A flat line suggests that there is no impact of switching on the results. A sloped line indicates that switching does affect the results.

ggdiscount(x)

Arguments

x

rpsftm object (rpsftm)

Examples

# use data included in rpsftm package
immdef <- rpsftm::immdef
immdef$rx <- with(immdef, 1 - xoyrs/progyrs)

# fit the model
imm.fit <- rpsftm::rpsftm(Surv(progyrs, prog) ~ rand(imm, rx),
                  data=immdef,
                  censor_time=censyrs)

ggdiscount(imm.fit)
#> Warning: `data_frame()` was deprecated in tibble 1.1.0.
#> Please use `tibble()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.