# Power

### ctpower

`ClinicalTrialUtilities.ctpower`

— Function```
function ctpower(;param::Symbol, type::Symbol, group::Symbol = :notdef,
alpha::Real = 0.05, n::Real = 0, diff::Real = 0, sd::Real = 0,
a::Real = 0, b::Real = 0,
k::Real = 1, logscale::Bool = true)::TaskResult
```

Clinical trial power estimation.

**param (Parameter type):**

- :mean - Means;
- :prop - Proportions;
- :or - Odd Ratio;

**type (Hypothesis type):**

- :ea - Equality (two-sided hypothesis, 100*(1 - α)% two-sided CI);
- :ei - Equivalence (two-sided hypothesis, 100*(1 -
**2*α**)% two-sided CI); - :ns - Non-Inferiority / Superiority (one-sided hypothesis, one side of 100*(1 -
**2*α**)% two-sided CI); - :mcnm - McNemar's Equality test;

**group (group num):**

- :one - one sample;
- :two - Two sample;

**alpha** - Alpha (0 < α < 1) (default = 0.05);

**n** - Subjects number;

**diff** - difference/equivalence margin/non-inferiority/superiority margin;

**sd** - Standard deviation (σ, for Means only);

**a** - Group A (μ₀/p₀) - Test group;

**b** - Group B (μ₁/p₁) - Reference group or reference value;

**k** - Na/Nb (after sample size estimation second group size: Na=k*Nb, only for two sample design) (default=1);

**logscale** - diff is log transformed for OR:

- true - diff is already in log-scale, no transformation required (default);
- false - diff is not in log-scale, will be transformed;

### bepower

`ClinicalTrialUtilities.bepower`

— Function```
bepower(;alpha::Real=0.05, theta1::Real=0.8, theta2::Real=1.25, theta0::Real=0.95,
cv::Real=0.0, sd::Real=0.0, n::Int=0,
design::Symbol=:d2x2, method::Symbol=:owenq, logscale::Bool=true)::TaskResult
```

Bioequivalence power estimation.

**alpha** - Alpha (0 < α < 1) (default = 0.05);

**theta1** - Lower Level (default = 0.8);

**theta2** - Upper level (default = 1.25);

**theta0** - T/R Ratio (default = 0.95);

**cv** - coefficient of variation;

**n** - subject number;

**logscale** - theta1, theta2, theta0: if true - make log transformation (default true);

**design** - trial design;

- :parallel
- :d2x2 (default)
- :d2x2x4
- :d2x4x4
- :d2x3x3
- :d2x4x2
- :d3x3
- :d3x6x3

**method** - calculating method: Owen's Q Function | NonCentral T, Shifted;

- :owenq (default)
- :nct
- :shifted