graph_survs {psm3mkv} | R Documentation |
Graph the observed and fitted state membership probabilities
Description
Graph the observed and fitted state membership probabilities for PF, PD, OS and PPS.
Usage
graph_survs(ptdata, dpam, cuttime = 0)
Arguments
ptdata |
Dataset of patient level data. Must be a tibble with columns named:
Survival data for all other endpoints (time to progression, pre-progression death, post-progression survival) are derived from PFS and OS. |
dpam |
List of survival regressions for each endpoint:
|
cuttime |
is the cut-off time for a two-piece model (default 0, indicating a one-piece model) |
Value
List of two items as follows.
data
is a tibble containing data derived and used in the derivation of the graphics.
graph
is a list of four graphics as follows:
-
pf
: Membership probability in PF (progression-free) state versus time since baseline, by method -
pd
: Membership probability in PD (progressive disease) state versus time since baseline, by method -
os
: Probability alive versus time since baseline, by method -
pps
: Probability alive versus time since progression, by method
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
)
# Create graphics
gs <- graph_survs(ptdata=bosonc, dpam=params)
gs$graph$pd