Type: | Package |
Title: | Sample Size, Power and CI for the Win Ratio |
Version: | 0.1.0 |
Description: | Calculates non-parametric estimates of the sample size, power and confidence intervals for the win-ratio. For more detail on the theory behind the methodologies implemented see Yu, R. X. and Ganju, J. (2022) <doi:10.1002/sim.9297>. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.3 |
Suggests: | knitr, rmarkdown |
Language: | en-US |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2023-12-06 11:08:53 UTC; r2301007 |
Author: | Autumn O'Donnell [aut, cre, cph] |
Maintainer: | Autumn O'Donnell <autumn.research@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2023-12-06 16:10:02 UTC |
Confidence Interval (CI) for Win Ratio
Description
Calculate the confidence interval for a win ratio.
CI = exp((ln(WR) +/- Z\sqrt{var})
Where;
ln(WR)
= Natural log of the true or assumed win ratio.
Z
= Z-score from normal distribution.
\sqrt{var}
= Standard deviation of the natural log of the win ratio.
Usage
wr.ci(WR = 1, Z = 1.96, var.ln.WR, N, sigma.sqr, k, p.tie)
Arguments
WR |
Win ratio; Default: |
Z |
Z-score from normal distribution; Default: |
var.ln.WR |
Variance of the natural log ( |
N |
Sample size. |
sigma.sqr |
Population variance of the natural log ( |
k |
The proportion of subjects allocated to one group i.e. the proportion of patients allocated to treatment. |
p.tie |
The proportion of ties. |
Value
wr.ci
returns an object of class "list
" containing the following components:
ci |
The confidence interval of a win ratio. |
WR |
The win ratio. |
Z |
Z-score from normal distribution. |
var.ln.WR |
Variance of the natural log ( |
N |
Sample size. |
sigma.sqr |
Population variance of the natural log ( |
k |
The proportion of subjects allocated to one group. |
p.tie |
The proportion of ties. |
Author(s)
Autumn O'Donnell autumn.research@gmail.com
References
Yu, R. X. and Ganju, J. (2022). Sample size formula for a win ratio endpoint. Statistics in medicine, 41(6), 950-963. doi:10.1002/sim.9297.
See Also
Examples
## N = 100 patients, 1:1 allocation, one-sided alpha = 2.5%, power = 90%
## (beta = 10%), a small proportion of ties p.tie = 0.1, and 50% more wins
## on treatment than control.
### Calculation 95% CI
wr.ci(N = 100, WR = 1.5, k = 0.5, p.tie = 0.1)
Power of a Win Ratio
Description
Calculate the power of a win ratio.
Power = 1 - \Phi(Z[\alpha] - ln(WR[true])(\sqrt{N}/\sigma))
Usage
wr.power(N, alpha = 0.025, WR.true = 1, sigma.sqr, k, p.tie)
Arguments
N |
Sample size. |
alpha |
Level of significance (Type I error rate); Default: |
WR.true |
True or assumed win ratio; Default: |
sigma.sqr |
Population variance of the natural log ( |
k |
The proportion of subjects allocated to one group i.e. the proportion of patients allocated to treatment. |
p.tie |
The proportion of ties. |
Value
wr.power
returns an object of class "list
" containing the following components:
power |
Power of the win ratio. |
N |
Sample size. |
alpha |
Level of significance. |
WR.true |
True or assumed win ratio. |
sigma.sqr |
Population variance of the natural log ( |
k |
The proportion of subjects allocated to one group. |
p.tie |
The proportion of ties. |
Author(s)
Autumn O'Donnell autumn.research@gmail.com
References
Yu, R. X. and Ganju, J. (2022). Sample size formula for a win ratio endpoint. Statistics in medicine, 41(6), 950-963. doi: 10.1002/sim.9297.
See Also
Examples
## N = 100 patients, 1:1 allocation, one-sided alpha = 2.5%, small
## proportion of ties p.tie = 0.1, and 50% more wins on treatment
## than control.
### Calculate the Power
wr.power(N = 100, WR.true = 1.5, k = 0.5, p.tie = 0.1)
Assumed Population Variance of a Win Ratio
Description
Calculate the assumed population variance of a win ratio.
\sigma^2 = (4 * (1 + p[tie]))/(3 * k * (1 - k) * (1 - p[tie])
Where;
p[tie] = The proportion of ties.
k = The proportion of subjects allocated to one group.
Usage
wr.sigma.sqr(k, p.tie)
Arguments
k |
The proportion of subjects allocated to one group i.e. the proportion of patients allocated to treatment. |
p.tie |
The proportion of ties. |
Value
wr.sigma.sqr
returns an object of class "list
" containing the following components:
sigma.sqr |
Population variance of the natural log ( |
k |
The proportion of subjects allocated to one group. |
p.tie |
The proportion of ties. |
Author(s)
Autumn O'Donnell autumn.research@gmail.com
References
Yu, R. X. and Ganju, J. (2022). Sample size formula for a win ratio endpoint. Statistics in medicine, 41(6), 950-963. doi: 10.1002/sim.9297.
See Also
Approximate Sample Size of a Win Ratio
Description
Calculates the approximate required sample size of a win ratio.
N ~~ (\sigma^2 * (Z[1-\alpha] + Z[1-\beta])^2)/(ln^2(WR[true]))
Usage
wr.ss(alpha = 0.025, beta = 0.1, WR.true = 1, k, p.tie, sigma.sqr)
Arguments
alpha |
Level of significance (Type I error rate); Default: |
beta |
Type II error rate; Default: |
WR.true |
True or assumed win ratio; Default: |
k |
The proportion of subjects allocated to one group i.e. the proportion of patients allocated to treatment. |
p.tie |
The proportion of ties. |
sigma.sqr |
Population variance of the natural log ( |
Value
wr.ss
returns an object of class "list
" containing the following components:
N |
Sample size. |
alpha |
Level of significance (Type I error rate). |
beta |
Type II error rate. |
WR.true |
True or assumed win ratio. |
k |
The proportion of subjects allocated to one group. |
p.tie |
The proportion of ties. |
sigma.sqr |
Population variance of the natural log ( |
Author(s)
Autumn O'Donnell autumn.research@gmail.com
References
Yu, R. X. and Ganju, J. (2022). Sample size formula for a win ratio endpoint. Statistics in medicine, 41(6), 950-963. doi: 10.1002/sim.9297.
See Also
Examples
## 1:1 allocation, one-sided alpha = 2.5%, power = 90% (beta = 10%),
## a small proportion of ties p.tie = 0.1, and 50% more wins on treatment
## than control
### Calculate Sample Size
wr.ss(WR.true = 1.5, k = 0.5, p.tie = 0.1)
Approximate Variance of the Natural Log (ln
) of the Win Ratio.
Description
Calculating the approximate variance of the natural log (ln
) a win ratio.
Var(ln(WR)) ~~ \sigma^2/N
Where;
\sigma^2 = (4 * (1 + p[tie]))/(3 * k * (1 - k) * (1 - p[tie])
Usage
wr.var(N, sigma.sqr, k, p.tie)
Arguments
N |
Sample size. |
sigma.sqr |
Population variance of the natural log ( |
k |
The proportion of subjects allocated to one group i.e. the proportion of patients allocated to treatment. |
p.tie |
The proportion of ties. |
Value
wr.var
returns an object of class "list
" containing the following components:
var.ln.WR |
Approximate variance of the natural log ( |
N |
Sample size. |
sigma.sqr |
Population variance of the natural log ( |
k |
The proportion of subjects allocated to one group. |
p.tie |
The proportion of ties. |
Author(s)
Autumn O'Donnell autumn.research@gmail.com
References
Yu, R. X. and Ganju, J. (2022). Sample size formula for a win ratio endpoint. Statistics in medicine, 41(6), 950-963. doi: 10.1002/sim.9297.