This functions runs nSim (Number of simulations, specified by the user) Monte Carlo simulations, each time calling tdSim.method2 internally. The function returns a data frame of scenario-specific input parameters- and also output statistical power. The user has the option to append the output to a file with file name specified in the input parameters list.
getpower.method2(nSim = 500, N, duration = 24, scenario, lambda12, lambda23 = NULL, lambda13, HR = NULL, exp.prop, rateC, min.futime, min.postexp.futime, output.fn, simu.plot = FALSE)# We recommend setting nSim to at least 500. It is set to 10 in the example to
# reduce run time for CRAN submission.
# Run 10 simulations. Each time simulate a dataset of 600 subjects
ret <- getpower.method2(nSim=10, N=600, duration=24, scenario="test",
lambda12=1.3, lambda23=0.04, lambda13=0.03, HR=NULL,exp.prop=0.2, rateC=0.05,
min.futime=4, min.postexp.futime=4,output.fn="database.csv", simu.plot=FALSE)
Run the code above in your browser using DataLab