View source: R/CorrelatedPfsAndOs2.R
| CorrelatedPfsAndOs2 | R Documentation |
Generate correlated PFS and OS endpoints using the Gumbel copula. Marginally,
both PFS and OS follow exponential distributions. This function can be used
as custom generator in the function endpoint().
Note that the Gumbel copula is applied to the survival functions of OS and time-to-progression (TTP). PFS is defined as min(TTP, OS), which also follows an exponential distribution.
For more information, refer to this vignette.
CorrelatedPfsAndOs2(
n,
median_pfs,
median_os,
kendall,
pfs_name = "pfs",
os_name = "os"
)
n |
integer. Number of observations. |
median_pfs |
numeric. Median of PFS. |
median_os |
numeric. Median of OS. |
kendall |
numeric. Kendall's tau between observed, uncensored PFS and OS. Must be non-negative and usually away from zero. Note that this argument is not the Kendall's tau between TTP and OS. |
pfs_name |
column name of PFS in returned data frame. It must be
consistent with name in the function |
os_name |
column name of OS in returned data frame. It must be
consistent with name in the function |
A data frame of n rows and four columns, including PFS, OS and their
event indicators. The event indicators are all 1s. The column names are
<pfs_name>, <pfs_name>_event, <os_name>,
and <os_name>_event.
pfs_and_os <- endpoint(name = c('PFS', 'Os'),
type = c('tte', 'tte'),
generator = CorrelatedPfsAndOs2,
median_pfs = 5,
median_os = 11,
kendall = .6,
pfs_name = 'PFS',
os_name = 'Os')
pfs_and_os # run it in console to see summary report
## for validation purpose only
## not the recommended way to use TrialSimulator
dat <- pfs_and_os$test_generator(n = 1e4)
cor(dat[, 1:2], method = 'kendall') ## close to 0.6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.