Trial.simulation {BayesianPlatformDesignTimeTrend} | R Documentation |

## Trial simulation

### Description

This function simulates and does final analysis of a trial with one scenario. The time cost of this function depend on the cpu cores of the user's cpmputer.

### Usage

```
Trial.simulation(
ntrials = 5000,
trial.fun = simulatetrial,
input.info = list(response.probs = c(0.4, 0.4), ns = c(30, 60, 90, 120, 150), max.ar =
0.75, test.type = "Twoside", rand.algo = "Urn", max.deviation = 3, model.inf =
list(model = "tlr", ibb.inf = list(pi.star = 0.5, pess = 2, betabinomialmodel =
ibetabinomial.post), tlr.inf = list(beta0_prior_mu = 0, beta1_prior_mu = 0,
beta0_prior_sigma = 2.5, beta1_prior_sigma = 2.5, beta0_df = 7, beta1_df = 7, reg.inf
= "main", variable.inf = "Fixeffect")), Stopbound.inf = Stopboundinf(Stop.type =
"Early-Pocock", Boundary.type = "Symmetric",
cutoff = c(0.99, 0.01)),
Random.inf = list(Fixratio = TRUE, Fixratiocontrol = 1, BARmethod = NA,
Thall.tuning.inf = NA, Trippa.tuning.inf = NA), trend.inf = list(trend.type = "step",
trend.effect = c(0, 0), trend_add_or_multip = "mult")),
cl = 2
)
```

### Arguments

`ntrials` |
A numeric variable indicating how many trial replicates you want to run. Default is 5000. |

`trial.fun` |
The function of trial simulation for more see |

`input.info` |
A list of input information including all information required for trial simulation. |

`cl` |
A numeric variable indicating how many cores you want to use in parallel programming. |

### Value

A list of output including the final output of each trial replicates called 'result' The analysis result table of the specific trial called 'OPC' and the file name for saving these output on the computer

### Author(s)

Ziyan Wang

### Examples

```
set.seed(1)
Trial.simulation(ntrials = 2, cl = 2)
```

[Package

*BayesianPlatformDesignTimeTrend*version 1.2.3 Index]