R: Simulate 1 dataframe (1 simulation) of time-dep exposure...
tdSim.method2
R Documentation
Simulate 1 dataframe (1 simulation) of time-dep exposure under method 2
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.
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
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(SimHaz)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/SimHaz/tdSim.method2.Rd_%03d_medium.png", width=480, height=480)
> ### Name: tdSim.method2
> ### Title: Simulate 1 dataframe (1 simulation) of time-dep exposure under
> ### method 2
> ### Aliases: tdSim.method2
> ### Keywords: Simulation
>
> ### ** Examples
>
> 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)
>
>
>
>
>
> dev.off()
null device
1
>