pwr_overall_pois: Power Calculation from Sample Size

Description Usage Arguments Examples

View source: R/poisson-pref.r

Description

Calculates the study power to detect a set of effects given a particular sample size in a two-stage randomized clinical trial

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
pwr_overall_pois(
  N,
  phi,
  lambda11,
  lambda22,
  lambda1,
  lambda2,
  alpha = 0.05,
  theta = 0.5,
  xi = 1,
  nstrata = 1
)

Arguments

N

overall study sample size.

phi

the proportion of patients preferring treatment 1. Should be numeric value between 0 and 1. If study is stratified, should be vector with length equal to the number of strata in the study.

lambda11

response mean of patients choosing to receive treatment 1 in the choice arm. Should be numeric value larger than 0. If study is stratified, should be vector with length equal to the number of strata in the study.

lambda22

response mean of patients choosing to receive treatment 2 in the choice arm. Should be numeric value larger than 0. If study is stratified, should be vector with length equal to the number of strata in the study.

lambda1

response mean of patients randomized to receive treatment 1 in the random arm. Should be numeric value larger than 0. If study is stratified, should be vector with length equal to the number of strata in the study.

lambda2

response mean of patients randomized to receive treatment 2 in the random arm. Should be numeric value larger than 0. If study is stratified, should be vector 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
3
4
5
# Unstratified
pwr_overall_pois(N=400, phi=0.5, lambda11=0.8, lambda22=0.5, lambda1=0.5, lambda2=0.4)
# Stratified
pwr_overall_pois(N=400, phi=c(0.5,0.5), lambda11=c(0.7,0.8), lambda22=c(0.4,0.4), 
lambda1=c(0.5,0.4), lambda2=c(0.2,0.3), xi=c(0.3,0.7), nstrata=2)

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