tdSim.method2: Simulate 1 dataframe (1 simulation) of time-dep exposure...

Description Usage Arguments Details Value Author(s) Examples

View source: R/method2.R

Description

This function simulate Survival Data. It generates a simulated dataset with time-dependent exposure under method 2 with a user-specified list of parameters as input.

Usage

1
2
tdSim.method2(N,duration, lambda12, lambda23=NULL, lambda13, 
    HR=NULL, exp.prop,rateC, min.futime = 0, min.postexp.futime = 0)

Arguments

N

Number of subjects

duration

Duration of the study. This is used in censoring

lambda12

Lambda12 parameter to control time to exposure

lambda23

Lambda23 parameter to control time to event after exposure

lambda13

Lambda13 parameter to control time to event in the control group

HR

Hazard Ratio. This input is optional. If HR is set and lambda23 is not set, lambda23 = lambda13*HR

exp.prop

A numeric value between 0 and 1 (not include 0 and 1) that represents the proportion of subjects that are assigned with an exposure

rateC

Rate of the exponential distribution to generate censoring times

min.futime

A numeric value that represents minimum follow-up time (in months). The default value is 0, which means no minimum follow-up time is considered. If it has a positive value, this argument will help exclude subjects that only spend a short amount of time in the study

min.postexp.futime

A numeric value that represents minimum post-exposure follow-up time (in months). The default value is 0, which means no minimum post-exposure follow-up time is considered. If it has a positive value, this argument will help exclude subjects that only spend a short amount of time in the study after their exposure

Details

Simulata a Survival dataset using a modified version of illness-death model controlled by lambda12, lambda23, lambda13

Value

A data.frame object with columns corresponding to

id

Integer that represents a subject's identification number

start

For counting process formulation. Represents the start of each time interval

stop

For counting process formulation. Represents the end of each time interval

status

Indicator of event. status = 1 when event occurs and 0 otherwise

x

Indicator of exposure. x = 1 when exposed and 0 otherwise

Author(s)

Danyi Xiong, Teeranan Pokaprakarn, Hiroto Udagawa, Nusrat Rabbee
Maintainer: Nusrat Rabbee <[email protected]>

Examples

1
2
sim_data <- tdSim.method2(500, duration=24,lambda12=1.3,lambda23=0.04, 
    lambda13=0.03, exp.prop=0.2,rateC=0.05, min.futime=4, min.postexp.futime=4)

SimHaz documentation built on May 29, 2017, 8:26 p.m.