R: Simulated Survival and Hazard Analysis for time-dependent
SimHaz-package
R Documentation
Simulated Survival and Hazard Analysis for time-dependent
Description
This package generates power for the Cox proportional hazards model by simulating survival events data with time dependent exposure status for subjects. A dichotomous exposure variable is considered with a single transition from unexposed to exposed status during the subject time's in the study.
# Simulate a dataset of 600 subjects with time-dependent exposure without
# considering minimum follow-up time or minimum post-exposure follow-up time.
# Specifically, set the duration of the study to be 24 months; the median time to
# event for control group to be 24 months; exposure effect to be 0.3; median time
# to censoring to be 14 months; and exposure proportion to be 20%.
df1 <- tdSim.method1(N = 600, duration = 24, lambda = log(2)/24, rho = 1,
beta = 0.3, rateC = log(2)/14, exp.prop = 0.2,
prop.fullexp = 0, maxrelexptime = 1, min.futime = 0,
min.postexp.futime = 0)
# We recommend setting nSim to at least 500. It is set to 10 in the example to
# reduce run time for CRAN submission.
ret <- getpower.method1(nSim = 10, N = 600, b = 0.3, exp.prop = 0.2,
type = "td", scenario = " ", maxrelexptime = 1/6, min.futime = 4,
min.postexp.futime = 4, output.fn = "output.csv")
Results
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/SimHaz-package.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SimHaz-package
> ### Title: Simulated Survival and Hazard Analysis for time-dependent
> ### Aliases: SimHaz-package SimHaz
>
> ### ** Examples
>
> # Simulate a dataset of 600 subjects with time-dependent exposure without
> # considering minimum follow-up time or minimum post-exposure follow-up time.
> # Specifically, set the duration of the study to be 24 months; the median time to
> # event for control group to be 24 months; exposure effect to be 0.3; median time
> # to censoring to be 14 months; and exposure proportion to be 20%.
>
> df1 <- tdSim.method1(N = 600, duration = 24, lambda = log(2)/24, rho = 1,
+ beta = 0.3, rateC = log(2)/14, exp.prop = 0.2,
+ prop.fullexp = 0, maxrelexptime = 1, min.futime = 0,
+ min.postexp.futime = 0)
>
> # We recommend setting nSim to at least 500. It is set to 10 in the example to
> # reduce run time for CRAN submission.
>
> ret <- getpower.method1(nSim = 10, N = 600, b = 0.3, exp.prop = 0.2,
+ type = "td", scenario = " ", maxrelexptime = 1/6, min.futime = 4,
+ min.postexp.futime = 4, output.fn = "output.csv")
>
>
>
>
>
>
> dev.off()
null device
1
>