calc_likes {psm3mkv} | R Documentation |
Calculate likelihoods for three three-state model structures
Description
Calculate likelihood values and other summary output for the following three state models structures: partitioned survival, clock forward state transition, and clock reset state transition. The function requires appropriately formatted patient-level data, a set of fitted survival regressions, and the time cut-off (if two-piece modeling is used).
Usage
calc_likes(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 |
Time cutoff - this is nonzero for two-piece models. |
Value
A list of three tibbles:
all
is a tibble of results for all patients:
-
methname
: the model structure or method. -
npar
: is the number of parameters used by that method. -
npts_1
tonpts_4
are the number of patients experiencing outcomes 1-4 respectively (see below), andnpts_tot
the total. -
ll_1
toll_4
are the log-likelihood values for patients experiencing outcomes 1-4 respectively (see below), andll_tot
the total.valid
is a tibble of the same design asall
but only in patients with valid likelihoods for all 4 methodssum
is a tibble in respect of patients with valid likelihoods for all 4 methods providing: -
npts
: number of patients contributing results for this method. -
npar
: number of parameters used by that method. -
ll
: total log-likelihood -
AIC
: Akaike Information Criterion value for this model -
BIC
: Bayesian Information Criterion value for this model
The four outcomes are as follows:
(1) refers to patients who remain alive and progression-free during the follow-up;
(2) refers to patients who die without prior progression during the follow-up;
(3) refers to patients who progress and then remain alive for the remaining follow-up, and
(4) refers to patients who progress and die within the follow-up.
Examples
bosonc <- create_dummydata("flexbosms")
fits <- fit_ends_mods_spl(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
)
calc_likes(bosonc, dpam=params)