treatment_effect_size: Treatment Effect Back Calculation

Description Usage Arguments Examples

View source: R/sample-size.r

Description

Calculates the treatment effect that can be detected given a desired study power and overall study sample size for the two-stage randomized design

Usage

1
2
3
4
5
6
7
8
9
treatment_effect_size(
  N,
  power,
  sigma2,
  alpha = 0.05,
  theta = 0.5,
  xi = 1,
  nstrata = 1
)

Arguments

N

overall study sample size.

power

desired study power. Should be numeric value between 0 and 1.

sigma2

variance estimate. Should be positive numeric values. If study is stratified, should be vector of within-stratum variances with length equal to the number of strata in the study.

alpha

desired type I error rate.

theta

proportion of patients assigned to choice arm in the initial randomization. Should be numeric value between 0 and 1 (default=0.5).

xi

a numeric vector of the proportion of patients in each stratum. Length of vector should equal the number of strata in the study and sum of vector should be 1. All vector elements should be numeric values between 0 and 1. Default is 1 (i.e. unstratified design).

nstrata

number of strata. Default is 1 (i.e. unstratified design).

Examples

1
2
treatment_effect_size(N=300, power=0.9, sigma2=c(1,0.8), xi=c(0.3,0.7), 
                      nstrata=2)

Example output

Attaching package: 'preference'

The following object is masked from 'package:stats':

    power

[1] 0.4908872

preference documentation built on Sept. 13, 2020, 5:08 p.m.