generate,DataSimObject-method {psborrow2} | R Documentation |
Generate Data for a DataSimObject
Description
Generate Data for a DataSimObject
Usage
## S4 method for signature 'DataSimObject'
generate(x, n = 1, treatment_hr = NULL, drift_hr = NULL)
Arguments
x |
a |
n |
number of data sets to simulate |
treatment_hr |
vector of numeric treatment effects |
drift_hr |
vector of numeric drift effects |
Value
A SimDataList object for use with create_simulation_obj()
.
Examples
baseline_obj <- create_baseline_object(
n_trt_int = 100,
n_ctrl_int = 50,
n_ctrl_ext = 10,
covariates = baseline_covariates(
names = c("age", "score"),
means_int = c(55, 5),
means_ext = c(60, 5),
covariance_int = covariance_matrix(c(5, 1))
)
)
sim_obj <- create_data_simulation(
baseline_obj,
coefficients = c(age = 0.001, score = 1.5),
event_dist = create_event_dist(dist = "exponential", lambdas = 1 / 36)
)
data_sim_list <- generate(sim_obj, treatment_hr = c(0, 1), drift_hr = 0.5)
[Package psborrow2 version 0.0.3.4 Index]