# For illustration purposes a small number of simulations are used
# Example 1: simulate Poisson outcome with sample size 100, binary mediator
# and 2 covariate (binary and normal) variables
posOut <- maczic_power(nsim = 8, nsp = 100, mtype = 'binary',
sims = 40, ydist = "Poisson", ymax = 60,
px1 = 0.5, am = 0.2, bm = 0.5,
e1m = 0.1, e2m = 0.1, e3m = 0,
ag = 0.1, bg = 0.3, gg = 1,
e1g = 0.5, e2g = -0.2, e3g = 0, delta = 0.1)
# Example 2: simulate zero-inflated Poisson outcome with sample size 80,
# continuous mediator and 1 normal covariate variable
zipOut <-maczic_power(nsim = 5, nsp = 80, mtype = 'continuous',
sims=30, ydist = "zip", ymax = 88, hpct0 = 60,
px1 = 0.5, am = 0.1, bm = 1,
e1m = 0, e2m = 0.2, e3m = 0,
ag = 0.6, bg = 0.6, gg = 0.2, e1g = 0, e2g = -0.2,
e3g = 0, ag2 = -0.7, bg2 = 0.2, gg2 = 0.1,
e2g2 = 0.1, delta2 = 0.15)
Run the code above in your browser using DataLab