Title: | Sample Size, Power and CI for the Win Ratio |
---|---|
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>. |
Authors: | Autumn O'Donnell [aut, cre, cph] |
Maintainer: | Autumn O'Donnell <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-10-31 22:23:33 UTC |
Source: | CRAN |
Calculate the confidence interval for a win ratio.
Where;
= Natural log of the true or assumed win ratio.
= Z-score from normal distribution.
= Standard deviation of the natural log of the win ratio.
wr.ci(WR = 1, Z = 1.96, var.ln.WR, N, sigma.sqr, k, p.tie)
wr.ci(WR = 1, Z = 1.96, var.ln.WR, N, sigma.sqr, k, p.tie)
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. |
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. |
Autumn O'Donnell [email protected]
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.
## 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)
## 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)
Calculate the power of a win ratio.
wr.power(N, alpha = 0.025, WR.true = 1, sigma.sqr, k, p.tie)
wr.power(N, alpha = 0.025, WR.true = 1, sigma.sqr, k, p.tie)
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. |
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. |
Autumn O'Donnell [email protected]
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.
## 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)
## 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)
Calculate the assumed population variance of a win ratio.
Where;
wr.sigma.sqr(k, p.tie)
wr.sigma.sqr(k, p.tie)
k |
The proportion of subjects allocated to one group i.e. the proportion of patients allocated to treatment. |
p.tie |
The proportion of ties. |
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. |
Autumn O'Donnell [email protected]
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.
Calculates the approximate required sample size of a win ratio.
wr.ss(alpha = 0.025, beta = 0.1, WR.true = 1, k, p.tie, sigma.sqr)
wr.ss(alpha = 0.025, beta = 0.1, WR.true = 1, k, p.tie, sigma.sqr)
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 ( |
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 ( |
Autumn O'Donnell [email protected]
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.
## 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)
## 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)
) of the Win Ratio.Calculating the approximate variance of the natural log () a win ratio.
Where;
wr.var(N, sigma.sqr, k, p.tie)
wr.var(N, sigma.sqr, k, p.tie)
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. |
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. |
Autumn O'Donnell [email protected]
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.