data_sim: Simulated survival data with uncertain endpoints from...

Description Usage Arguments Value Author(s) Examples

View source: R/data_sim.R

Description

data_sim function simulates data from a hypothetic 1:1 two-arms clinical trial, with one year uniform accrual period and three years follow-up.

data_sim2 function simplifies data list generated from above function to a more events only case. Note this function is only used for demonstration purpose.

Usage

1
2
data_sim(n=200,true_hr=0.8,haz_c=1/365)
data_sim2(data_list,covariates,percentage)

Arguments

n

Total number of subject.

true_hr

True hazard ratio between trt and control.

haz_c

True event rate in the control arm.

data_list

The data list which has been transformed from the long format by uc_data_transform function.

covariates

The covariate we pose the true HR.

percentage

The percentage of censored subjects with potential events we would like to ultilize in the analysis. Ideally, with more potential events added, more power gain of imputation.

Value

Dataframe. Simulated datasets with event probabilities and potential event date.

Author(s)

Yiming Chen, John Lawrence

Examples

1
2
3
4
5
6
7
df_x<-data_sim(n=500,true_hr=0.8,haz_c=1/365)
data_intrim<-uc_data_transform(data=df_x,
                               var_list=c("id_long","trt_long"),
                               var_list_new=c("id","trt"),
                               time="time_long",
                               prob="prob_long")
df_y<-data_sim2(data_list=data_intrim,covariates=c("trt"),percentage=0.2)

SurvMI documentation built on July 13, 2020, 9:07 a.m.

Related to data_sim in SurvMI...