Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/power_TOST_sim.R

Power is calculated by simulations of studies (PE via its normal distribution,
MSE via its associated *χ*^{2} distribution) and application of the two one-sided *t*-tests. Power is obtained via ratio of studies found BE to
the number of simulated studies.

1 2 | ```
power.TOST.sim(alpha = 0.05, logscale = TRUE, theta1, theta2, theta0, CV, n,
design = "2x2", robust = FALSE, setseed = TRUE, nsims = 1e+05)
``` |

`alpha` |
Significance level (one-sided). Commonly set to 0.05. |

`logscale` |
Should the data used on log-transformed or on original scale? |

`theta0` |
‘True’ or assumed T/R ratio or difference. |

`theta1` |
Lower (bio-)equivalence limit. |

`theta2` |
Upper (bio-)equivalence limit. |

`CV` |
In case of In case of cross-over studies this is the within-subject CV, in case of a parallel-group design the CV of the total variability. |

`n` |
Number of subjects under study. |

`design` |
Character string describing the study design. |

`robust` |
Defaults to |

`setseed` |
Simulations are dependent on the starting point of the (pseudo) random number
generator. To avoid differences in power for different runs a |

`nsims` |
Number of studies to simulate. Defaults to 100,000 = 1E5. |

Value of power according to the input arguments.

This function was intended for internal check of the analytical power
calculation methods. Use of the analytical power calculation methods
(`power.TOST()`

) for real problems is recommended.

For sufficient precision nsims > 1E5 (default) may be necessary.
Be patient if using nsims=1E6. May take some seconds.

D. Labes

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
# using the default design 2x2, BE range 0.8 ... 1.25, logscale, theta0=0.95
power.TOST.sim(alpha = 0.05, CV = 0.3, n = 12)
# should give 0.15054, with nsims=1E6 it will be 0.148533
# exact analytical is
power.TOST(alpha = 0.05, CV = 0.3, n = 12)
# should give 0.1484695
# very unusual alpha setting
power.TOST.sim(alpha = 0.9, CV = 0.3, n = 12)
# should give the same (within certain precision) as
power.TOST(alpha = 0.95, CV = 0.3, n = 12)
# or also within certain precision equal to
power.TOST(alpha = 0.95, CV = 0.3, n = 12, method = "mvt")
# SAS Proc Power gives here the incorrect value 0.60525
``` |

```
[1] 0.15054
[1] 0.1484695
[1] 0.99616
[1] 0.9985258
[1] 0.9985265
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.