graph_psm_survs {psm3mkv} | R Documentation |
Graph the PSM survival functions
Description
Graph the PSM survival functions
Usage
graph_psm_survs(timevar, endpoint, ptdata, dpam, psmtype)
Arguments
timevar |
Vector of times at which to calculate the hazards |
endpoint |
Endpoint for which hazard is required (TTP, PPD, PFS, OS or PPS) |
ptdata |
Dataset of patient level data. Must be a tibble with columns named:
|
dpam |
List of survival regressions for each endpoint:
|
psmtype |
Either "simple" or "complex" PSM formulation |
Value
List containing:
-
adj
is the hazard adjusted for constraints -
unadj
is the unadjusted hazard
Examples
bosonc <- create_dummydata("flexbosms")
fits <- fit_ends_mods_par(bosonc)
# Pick out best distribution according to min AIC
params <- list(
ppd = find_bestfit(fits$ppd, "aic")$fit,
ttp = find_bestfit(fits$ttp, "aic")$fit,
pfs = find_bestfit(fits$pfs, "aic")$fit,
os = find_bestfit(fits$os, "aic")$fit,
pps_cf = find_bestfit(fits$pps_cf, "aic")$fit,
pps_cr = find_bestfit(fits$pps_cr, "aic")$fit
)
# Graphic illustrating effect of constraints on OS model
psms_simple <- graph_psm_survs(
timevar=6*(0:10),
endpoint="OS",
ptdata=bosonc,
dpam=params,
psmtype="simple"
)
psms_simple$graph