Learn R Programming

BRACE (version 0.1.0)

gendat2: simulation data generating function (Adding a measured confounder)

Description

generating the simulation data to apply in brace

Usage

gendat2(nsims, nobs, f1, f2, g, b1, b2, w1, w2, omegaplus, theta1, theta2, k3)

Value

a matrix of nsims*nobs row, which consists of nsims datasets

Arguments

nsims

number of simulation datasets

nobs

number of observations for one dataset

f1

parameter for generating unmeasured binary confounder

f2

parameter for generating measured binary confounder

g

parameter for generating group assignment

b1

unmeasured confounder effect on group assignment

b2

measured confounder effect on group assignment

w1

shape parameter in generating survival time for event 1 from weibull distribution

w2

shape parameter in generating survival time for event 2 from weibull distribution

omegaplus

multiplier on the baseline hazard for event 1

theta1

multiplier on the baseline hazard for event 1

theta2

multiplier on the baseline hazard for event 2

k3

multiplier on the baseline hazard for event 2

Examples

Run this code
nsims = 1; nobs = 1500
f1 = f2 = 0.5; g = 0.333; b1 = 8; b2 = 4; w1 = w2 = 0.667
theta1 = 0.5; theta2 = 1; omegaplus = 1; k3 = 0.333
sim1 = gendat2(nsims,nobs,f1,f2,g,b1,b2,w1,w2,omegaplus,theta1,theta2,k3)

Run the code above in your browser using DataLab