SimDat_BiVarIntCensd: Simulate Bivariate Interval-censored Data

View source: R/SimDat_BiVarIntCensd.R

SimDat_BiVarIntCensdR Documentation

Simulate Bivariate Interval-censored Data

Description

This function generates the bivariate event time data from Clayton copula model, where the marginal distributions of each outcome follows an exponential distribution. The observations windows are generated from uniform distribution.

Usage

SimDat_BiVarIntCensd(
  size,
  case = 2,
  lambda1,
  lambda2,
  K.tau,
  T1.start,
  T1.end,
  T2.start,
  T2.end,
  seed = 123
)

Arguments

size

Sample size, i.e., the number of subjects

case

Either one of c(1,2), where 1 for current status data and 2 for interval-censored data. Default is case = 2

lambda1

Hazard (rate parameter) of the exponential distribution for outcome 1

lambda2

Similar to lambda1, but just for outcome 2

K.tau

Kendall's τ for Clayton copula. It determines the correlation between two outcomes in the joint distribution

T1.start

The observation time (left boundary) can be no earlier than this value for outcome 1

T1.end

The observation time (right boundary) can be no late than this value for outcome 1

T2.start

Similar to T1.start, for outcome 2

T2.end

Similar to T1.end, for outcome 2

seed

Random seed

Details

Changing lambda1 and lambda2 can lead to different proportions of left-, interval, and right-censoring. Another way is to adjust T.start/T.end. Increasing T.start can increase the proportion of left-censoring (which will lead to less interval censoring); while decreasing T.end can increase the proportion of right-censoring (and lower that of interval censoring)

Value

A list of two elements: T1 and T2. Both including tu_, tv_, and Ind_. [tu, tv] is the observation interval with tu can be as small as 0 (most likely indicating a left-censoring) and tv can be Inf indicating a right-censoring. Ind is the indicator of censoring type.

Examples

SampleDat_case1 = SimDat_BiVarIntCensd(size = 400, case = 1, lambda1 = 0.45, lambda2 = 0.55, K.tau = 0.5,
    T1.start= 0.1, T1.end = 4, T2.start = 0.1, T2.end = 4)
SampleDat_case2 = SimDat_BiVarIntCensd(size = 400, case = 2, lambda1 = 0.45, lambda2 = 0.55, K.tau = 0,
    T1.start= 0.1, T1.end = 4, T2.start = 0.1, T2.end = 4)

junyzhou10/BivarIntCensored documentation built on July 14, 2022, 8:14 a.m.