rtimeroc {parTimeROC}R Documentation

rtimeroc

Description

Function to generate bivariate data from PH or copula model.

Usage

rtimeroc(obj, n, censor.rate = 0, params.x, params.t, params.copula, params.ph)

Arguments

obj

An initialized 'TimeROC' object.

n

An integer of sample size.

censor.rate

An integer between 0 to 1 that is used for randomized censoring.

params.x

Vector of biomarker parameter.

params.t

Vector of time-to-event parameter.

params.copula

An integer for copula parameter.

params.ph

An integer for association parameter.

Value

A dataframe with 3 columns (x = biomarker value, t = observable time-to-event, status = censored/not censor (0 or 1))

Examples

## Copula model
test <- timeroc_obj(dist = 'gompertz-gompertz-copula', copula = "gumbel90")
set.seed(23456)
rr <- rtimeroc(obj = test, censor.rate = 0, n=500,
               params.t = c(shape=3,rate=1),
               params.x = c(shape=1,rate=2),
               params.copula=-5)
plot(t~x, rr)

## PH model
test <- timeroc_obj(dist = 'weibull-gompertz-PH')
set.seed(23456)
rr <- rtimeroc(obj = test, censor.rate = 0, n=100,
               params.t = c(shape=2, rate=1),
               params.x = c(shape=2, scale=1),
               params.ph=0.5)
plot(t~x, rr)

[Package parTimeROC version 0.1.0 Index]