#Example with delta method
zimed=binoutzimed(outcome=mzipmed_data$binY,mediator=mzipmed_data$ziM,
exposure=mzipmed_data$X,confounder=cbind(mzipmed_data$C1,
mzipmed_data$C2),error="Delta",robust=FALSE,X=1,Xstar=0,
zioff=NULL,OFF=NULL,rare=FALSE)
#Example using bootstrapping, 10 iterations are used for succinctness
zimed2=binoutzimed(outcome=mzipmed_data$binY,mediator=mzipmed_data$ziM,
exposure=mzipmed_data$X,confounder=cbind(mzipmed_data$C1,
mzipmed_data$C2),error="Boot",n=10,C=c(0,0.5))
Run the code above in your browser using DataLab