Package 'asd'

Title: Simulations for Adaptive Seamless Designs
Description: Package runs simulations for adaptive seamless designs with and without early outcomes for treatment selection and subpopulation type designs.
Authors: Nick Parsons
Maintainer: Nick Parsons <[email protected]>
License: GPL-3
Version: 2.2
Built: 2024-10-13 02:46:33 UTC
Source: https://github.com/cran/asd

Help Index


Simulation Tools for Adaptive Seamless Design (ASD)

Description

Functions to run simulations for trial designs that either (i) test a number of experimental treatments against a single control treatment group in a seamless adaptive trial or (ii) test an experimental treatment against a single control treatment group in a seamless adaptive trial with co-primary analyses in a pre-defined subgroup and the full population.
In setting (i) test treatments are compared to the control treatment using Dunnett's many-to-one testing procedure, with an interim analysis undertaken using an early outcome measure. A decision is made on which of the treatments to take forward using a pre-defined selection rule. Data are simulated for the final outcome measure that is correlated with the early outcome measure. Data from the interim and final analyses for the final outcome measure are combined together using either the inverse normal or Fisher combination test and hypotheses are either rejected or accepted after controlling the familywise error rate at the selected level.
In setting (ii) an interim analysis is undertaken using an early outcome measure and a decision is made on whether to continue with both full and subpopulations, the subpopulation only or the full population, using a pre-defined selection rule. A number of different methods to control the family wise error rate are implemented. Data are simulated for the early and final outcome measures, subpopulation prevalence and correlation between the final and the early outcomes.

Details

Package: asd
Type: Package
Version: 2.2
Date: 2016-05-23
License: GPL-3

Simulations are run using the functions (i) treatsel.sim and (ii) subpop.sim. The other functions are not generally to be called by the user.

Author(s)

Nick Parsons ([email protected])

References

Some useful references to adaptive designs and more specifically to the methodology described here:

Thall PF, Simon R, Ans Ellenberg SS. A two-stage design for choosing amongst several experimental treatments and a control in clinical trials. Biometrics 1988;45:537-547.

Thall PF, Simon, R, Ans Ellenberg SS. Two-stage selection and testing designs for comparative clinical trials. Biometrika 1989;75,303-310.

Bauer P, Kieser M. Combining different phases in the development of medical treatments within a single trial. Statistics in Medicine 1999;18:1833-1848.

Stallard N, Todd S. Sequential designs for phase II and phase III clinical trials incorporating treatment selection. Statistics in Medicine 2003;22:689-703.

Posch M, Koenig F, Branson M, Brannath W, Dunger-Baldauf C, Bauer P. Testing and estimation in flexible group sequential designs with adaptive treatment selection. Statistics in Medicine 2005;24:3697-3714.

Bretz F, Schmidli H, Koenig F, Racine A, Maurer W. Confirmatory seamless phase II/III clinical trials with hypotheses selection at interim: General concepts. Biometrical Journal 2006;48:623-634.

Koenig F, Brannath W, Bretz F, Posch M. Adaptive Dunnett tests for treatment selection. Statistics in Medicine 2008;27:1612-1625.

Stallard N, Friede T. A group-sequential design for clinical trials with treatment selection. Statistics in Medicine 2008;27:6209-6227.

Friede T, Parsons N, Stallard N, Todd S, Valdes Marquez E, Chataway J, Nicholas R. Designing a Seamless Phase II/III Clinical Trial using Early Outcomes for Treatment Selection: an Application in Multiple Sclerosis. Statistics in Medicine 2011;30:1528-1540.

Parsons N, Friede T, Todd S, Valdes Marquez E, Chataway J, Nicholas R, Stallard N. An R package for implementing simulations for seamless phase II/III clinicals trials using early outcomes for treatment selection. Computational Statistics and Data Analysis 2012;56:1150-1160.

Friede T, Parsons N, Stallard N. A conditional error function approach for subgroup selection in adaptive clinical trials. Statistics in Medicine 2012;31:4309-4320.

See Also

treatsel.sim, subpop.sim


Combination Tests for ASD

Description

Implements weighted inverse normal and Fisher combination tests for combining p-values for adaptive seamless designs.

Usage

combn.test(stage1, stage2, weight = 0.5, method = "invnorm")

Arguments

stage1

Output from function dunnett.test from stage 1 of an ASD

stage2

Output from function dunnett.test from stage 2 of an ASD

weight

Weight indicating how p-values from stages 1 and 2 are combined; default weight is 0.5 indicating equal weighting between stages (0<weight<1)

method

Select combination test method; available options are “invnorm” or “fisher”, with default “invnorm

Details

The basic ideas of the combination test approach were proposed by Bauer and Kieser (1999) and make use of a combination function (Bauer and Kohne, 1994) to combine stagewise p-values to allow for interim adaptations and the application of the closed test principle (Marcus et al., 1976) to control the overall test size across multiple hypotheses.

Value

method

Selected method of combining p-values

zscores

Z-scores for each hypothesis

hyp.comb

A list of matrices indicating the structure of the intersection hypotheses

weights

Weights used for each stage

Author(s)

Nick Parsons ([email protected])

References

Bauer P, Kieser M. Combining different phases in the development of medical treatments within a single trial. Statistics in Medicine 1999;18:1833-1848.

Bauer P, Kohne K. Evaluation of experiments with adaptive interim analyses. Biometrics 1994;50:1029-1041.

Marcus R, Peritz E, Gabriel KR. On closed testing procedures with special reference to ordered analysis of variance. Biometrika 1976;63:655-660.

Lehmacher W, Wassmer G. Adaptive sample size calculations in group sequential trials. Biometrics 1999;55:1286-1290.

See Also

treatsel.sim, dunnett.test, hyp.test, select.rule, simeans.binormal

Examples

stage1 <- dunnett.test(c(0.75,1.5,2.25))
stage2 <- dunnett.test(c(0.15,1.75,2.15))
combn.test(stage1,stage2,weight=0.5,method="invnorm")

Dunnett Test

Description

Implements Dunnett's test (Dunnett, 1955) for many-to-one comparisons.

Usage

dunnett.test(Z = Z, select = rep(1, length(Z)))

Arguments

Z

A vector of test statistics

select

A vector of length Z; to include treatments set values to one and to exclude treatments set values to zero

Details

A many-to-one comparison test for the the null hypothesis that all the treatment effects are equal to zero against the alternative that at least one is larger than zero.

Value

pvalues

A list of matrices of p-values for all intersection hypotheses

zscores

A list of matrices of z-scores for all intersection hypotheses

hyp.comb

A list of matrices indicating the structure of the intersection hypotheses

Author(s)

Nick Parsons ([email protected])

References

Dunnett CW. A multiple comparison procedure for comparing several treatments with a control. Journal of the American Statistical Association 1955;50:1096-1121.

See Also

treatsel.sim, combn.test, hyp.test, select.rule, simeans.binormal

Examples

dunnett.test(c(0.75,1.5,2.25))

# select two treatments only
dunnett.test(c(0.75,1.5,2.25),select=c(1,1,0))

# set test statistic to -Inf
dunnett.test(c(0.75,1.5,-Inf))

ASD simulation for subpopulation selection

Description

Function subpop.sim runs simulations for a trial design that tests an experimental treatment against a single control treatment group in a seamless adaptive trial with co-primary analyses in a pre-defined subgroup and the full population. An interim analysis is undertaken using an early outcome measure and a decision is made on whether to continue with both full and subpopulations, the subpopulation only or the full population, using a pre-defined selection rule. A number of different methods to control the family wise error rate are implemented; (i) the treatment is compared to the control in the subpopulation and full populations using Simes test and the inverse normal combination function used to combine p-values before and after design adaptation, (ii) as (i) but the bivariate normal method of Spiessens and Debois (2010) is used to control the type I error rate, (iii) as (i) but a Bonferroni test is used and (iv) a conditional error function approach using the Spiessens and Debois test. Data are simulated for the early and final outcome measures, subpopulation prevalence and correlation between the final and the early outcomes. This function should not generally be called by the user. The more user-friendly function subpop.sim covers most common applications.

Usage

gsubpop.sim(z.early=NULL,z1=z1,z2=z2,sprev=sprev,
        corr=NULL,selim=NULL,nsim=nsim,seed=12345678,
        level=level,select="thresh",wt=NULL,method="CT-SD")

Arguments

z.early

Vector of test statistics for early outcome subpopulation and full population i.e. c(sub, full)

z1

Vector of test statistics for final outcome subpopulation and full population i.e. c(sub, full)

z2

Vector of test statistics for final outcome subpopulation and full population, and subpopulation and full population when both are selected i.e. c(sub only, full only, sub, full)

sprev

Subpopulation prevalence

corr

Correlation between early and final outcomes

selim

Upper and lower limits for the difference between test statistics for the threshold rule

nsim

Number of simulations (maximum=10,000,000)

seed

Seed number

level

Test level (default=0.025)

select

Selection rule type; available options are “thresh” and “futility

wt

User set weight for combination test

method

Test type; available options are “CT-Simes”, “CT-SD”, “CT-Bonferroni” or “CEF

Details

A structured description of the the methodology and the simulation model is given by Friede et al. (2012).

Value

results

Table of counts; (i) the number of times the subpopulation, full population or both population are selected (n), (ii) the number of times the subpopulation is rejected when either it alone or both populations are selected (Hs), (iii) the number of times the full population is rejected when either it alone or both populations are selected (Hf), (iv) the number of times both populations are rejected (Hs+Hf) and (v) the number of times the intersection hypothesis is rejected (Hs+f)

Author(s)

Nick Parsons ([email protected])

References

Spiessens B, Debois M. Adjusted significance levels for subgroup analysis in clinical trials. Contemporary Clinical Trials 2010;31:647-656.

Jenkins M, Stone A, Jennison C. An adaptive seamless phase II/III design for oncology trials with subpopulation selection using survival endpoints. Pharmaceutical Statistics 2011;10:347-356.

Friede T, Parsons N, Stallard N. A conditional error function approach for subgroup selection in adaptive clinical trials. Statistics in Medicine 2012;31:409-4320.

See Also

subpop.sim

Examples

gsubpop.sim(z.early=c(-1,-1),z1=c(-1,-1),z2=c(-1,0,-1,0),sprev=c(0.5,0.5),
        corr=0.5,selim=c(-0.5,0.5),nsim=100,seed=12345678,level=0.025,
        select="thresh",wt=0.5,method="CT-SD")

ASD simulation for treatment selection

Description

Function treatsel.sim runs simulations for a trial design that tests a number of experimental treatments against a single control treatment group in a seamless adaptive trial. Test treatments are compared to the control treatment using Dunnett's many-to-one testing procedure. An interim analysis is undertaken using an early outcome measure for each treatment (and control). A decision is made on which of the treatments to take forward, using a pre-defined selection rule. Data are simulated for the final outcome measure, and data from the interim and final analyses for the final outcome measure are combined together using either the inverse normal or Fisher combination test, and hypotheses tested at the selected level. This function should not generally be called by the user. The more user-friendly function treatsel.sim covers most common applications.

Usage

gtreatsel.sim(z1=c(0,0,0),z2=c(0,0,0),zearly=c(0,0,0),v1=c(1,1,1,1),
           v2=c(1,1,1,1),vearly=c(1,1,1,1),corr=0,weight=0.5,
           nsim=1000,seed=12345678,select=0,epsilon=1,thresh=1,
           level=0.025,ptest=seq(1:length(z1)),fu=FALSE,
           method="invnorm")

Arguments

z1

Vector of test statistics for the final outcome measure based on stage 1 data

z2

Vector of test statistics for the final outcome measure based on stage 2 data

zearly

Vector of test statistics for the early outcome measure

v1

Vector of variances for the final outcome measure based on stage 1 data; in format control treatment variance followed by the test treatment variances

v2

Vector of variances for the final outcome measure based on stage 2 data; format as v1

vearly

Vector of variances for the early outcome measure; format as v1

corr

Vector of correlations between the early and final outcome measures for the control and test treatments; format as v1

weight

Weighting between stages 1 and 2; default is for equal weighting (0.5)

nsim

Number of simulations (maximum=10,000,000)

seed

Seed number

select

Selection rule type; 0 = select all treatments, 1 = select maximum, 2 = select maximum two, 3 = select maximum three, 4 = epsilon rule (select means within epsilon of maximum), 5 = randomly select a single treatment and 6 = threshold rule (select means greater than or equal to threshold). See select.rule

epsilon

For select = 4, set epsilon criterion

thresh

For select = 6, set threshold criterion

level

Test level (default=0.025)

ptest

Vector of treatment numbers for determining power; for example, c(1,2) will count rejections of one or both hypotheses for testing treatments 1 and 2 against control

fu

Logical indicating whether patients from dropped treatments (after interim selection) should be followed-up; default TRUE

method

Select combination method; available options are “invnorm” or “fisher”, with default “invnorm

Details

A structured description of the the methodology and the simulation model is given by Friede et al. (2011) and implementation by Parsons et al. (2012).

Value

count.total

Number of times one or more treatments are selected

select.total

Number of times each test treatment is selected

reject.total

Number of times each hypothesis is rejected

sim.reject

Number of times one or more of the treatments selected using ptest is rejected

Author(s)

Nick Parsons ([email protected])

References

Friede T, Parsons N, Stallard N, Todd S, Valdes Marquez E, Chataway J, Nicholas R. Designing a Seamless Phase II/III Clinical Trial using Early Outcomes for Treatment Selection: an Application in Multiple Sclerosis. Statistics in Medicine 2011;30:1528-1540.

Parsons N, Friede T, Todd S, Valdes Marquez E, Chataway J, Nicholas R, Stallard N. An R package for implementing simulations for seamless phase II/III clinicals trials using early outcomes for treatment selection. Computational Statistics and Data Analysis 2012;56:1150-1160.

See Also

treatsel.sim

Examples

gtreatsel.sim(z1=c(1,0,2),z2=c(1,0,2),zearly=c(1,0,1), 
    v1=c(1,1,1,1),v2=c(1,1,1,1),vearly=c(1,1,1,1), 
    corr=0,weight=0.25,nsim=100,seed=12345678,
    select=1,level=0.025,ptest = c(1:3),method="fisher")

Closed Testing for ASD

Description

Implements the closure principle (Marcus et al., 1976) for controlling the familywise type I error rate in ASD.

Usage

hyp.test(comb.test, level = level, full.hyp = FALSE)

Arguments

comb.test

Output from function combn.test

level

Test level (default=0.025)

full.hyp

Logical indicating whether the full set of intersection hypotheses should be reported; default FALSE

Details

In order to control the familywise type I error rate in the strong sense at the pre-specified level α\alpha the closure principle (Marcus et al., 1976) is applied. This means that an individual null hypothesis is rejected if and only if all intersection hypotheses are also rejected at level α\alpha.

Value

reject

Matrix indicating whether elementary hypotheses have been rejected

all.rejects

Matrix indicating rejections for each intersection hypothesis, if full.hyp=TRUE

all.hyp

Matrix labelling each intersection hypothesis, if full.hyp=TRUE

Author(s)

Nick Parsons ([email protected])

References

Marcus R, Peritz E, Gabriel KR. On closed testing procedures with special reference to ordered analysis of variance. Biometrika 1976;63:655-660.

See Also

treatsel.sim,dunnett.test, combn.test, select.rule, simeans.binormal

Examples

stage1 <- dunnett.test(c(0.75,1.5,2.25))
stage2 <- dunnett.test(c(0.15,1.75,2.15))
comb.test <- combn.test(stage1,stage2,weight=0.5)
hyp.test(comb.test,level=0.025,full.hyp=FALSE)

# more output
hyp.test(comb.test,level=0.025,full.hyp=TRUE)

Selection Rules for Interim Analysis in ASD

Description

Function select.rule provides a number of options for selecting treatments at an interim analysis in ASD.

Usage

select.rule(x, type = 0, epsilon = 1, thresh = 1)

Arguments

x

Vector of test statistics.

type

Decision rule type; 0, 1, 2, 3, 4, 5 or 6 (see below for details); default is 0.

epsilon

For type = 4, set epsilon criterion

thresh

For type = 6, set threshold criterion

Details

There are seven types of selction rule available:
(0) Select all treatments
(1) Select one treatment; largest value of x
(2) Select two treatments; two largest values of x
(3) Select three treatments; three largest values of x
(4) Epsilon rule; select all x within epsilon of maximum
(5) Randomly select one treatment
(6) Threshold rule; select all x larger than thresh

Value

select

Indicator vector that shows treatments selected (1) or not selected (0)

z

Vector of same length as select set to -Inf if not selected and 0 otherwise. For use with function dunnett.test

Author(s)

Nick Parsons ([email protected])

See Also

treatsel.sim, dunnett.test, hyp.test, combn.test, simeans.binormal

Examples

# select maximum treatment
select.rule(x=c(5.3,5.2,1.3,4.5,-1.3),type=4,epsilon=1)

Simulate Bivariate Normal Means

Description

Simulates bivariate normal means; for use with asd.sim and gasd.sim in ASD.

Usage

simeans.binormal(n = n, means = means, vars = vars, corr = corr)

Arguments

n

Number of records used to calculate means

means

Vector of expected means for two samples

vars

Vector of expected variances for two samples

corr

Correlation between two samples

Details

Uses function rmvnorm from package mvtnorm to generate means from correlated normal variates.

Value

samp1

Mean of sample 1

samp2

Mean of sample 2

Author(s)

Nick Parsons ([email protected])

See Also

treatsel.sim, dunnett.test, hyp.test, select.rule, combn.test

Examples

# need to load mvtnorm
library(mvtnorm)

# generate data
set.seed(1234)
simeans.binormal(n=10,means=c(2,3),vars=c(1,5),corr=0.5)

ASD simulation for subpopulation selection

Description

Function subpop.sim runs simulations for a trial design that tests an experimental treatment against a single control treatment group in a seamless adaptive trial with co-primary analyses in a pre-defined subgroup and the full population. An interim analysis is undertaken using an early outcome measure and a decision is made on whether to continue with both full and subpopulations, the subpopulation only or the full population, using a pre-defined selection rule. A number of different methods to control the family wise error rate are implemented; (i) the treatment is compared to the control in the subpopulation and full populations using Simes test and the inverse normal combination function used to combine p-values before and after design adaptation, (ii) as (i) but the bivariate normal method of Spiessens and Debois (2010) is used to control the type I error rate, (iii) as (i) but a Bonferroni test is used and (iv) a conditional error function approach using the Spiessens and Debois test. Data are simulated for the early and final outcome measures, subpopulation prevalence and correlation between the final and the early outcomes.

Usage

subpop.sim(n=list(stage1=32,enrich=NULL,stage2=32),
          effect=list(early=c(0,0),final=c(0, 0)),
          outcome=list(early="N",final="N"),
          control=list(early=NULL,final=NULL),sprev=0.5,
          nsim=1000,corr=0,seed=12345678,select="thresh",
          weight=NULL,selim=NULL,level=0.025,method="CT-SD",
          sprev.fixed=TRUE,file="")

Arguments

n

List giving sample sizes for each treatment group at stage 1 (interim) and stage 2 (final) analyses; enrich allows for sample size modifications if the subgroup only is selected at stage 1

effect

List giving effect sizes for early and final outcomes

outcome

List giving outcome type for early and final outcomes; available options are “N”, “T” and “B”, for normal, time-to-event and binary data

control

Optional list giving effect sizes for early and final outcomes

sprev

Subpopulation prevalence

nsim

Number of simulations (maximum=10,000,000)

corr

Correlation between early and final outcomes

seed

Seed number

select

Selection rule type; available options are “thresh” and “futility

weight

Optional user set weight for combination test; default is to use those suggested by Jenkins et al. (2011)

selim

Upper and lower limits for the difference between test statistics for the threshold rule

level

Test level (default=0.025)

method

Test type; available options are “CT-Simes”, “CT-SD”, “CT-Bonferroni” or “CEF

sprev.fixed

Logical indicating whether subpopulation prevalence is fixed at each simulation; default TRUE

file

File name to dump output; if unset will default to R console

Details

A structured description of the the methodology and the simulation model is given by Friede et al. (2012).

Value

results

Table of counts; (i) the number of times the subpopulation, full population or both population are selected (n), (ii) the number of times the subpopulation is rejected when either it alone or both populations are selected (Hs), (iii) the number of times the full population is rejected when either it alone or both populations are selected (Hf), (iv) the number of times both populations are rejected (Hs+Hf) and (v) the number of times the intersection hypothesis is rejected (Hs+f)

Author(s)

Nick Parsons ([email protected])

References

Spiessens B, Debois M. Adjusted significance levels for subgroup analysis in clinical trials. Contemporary Clinical Trials 2010;31:647-656.

Jenkins M, Stone A, Jennison C. An adaptive seamless phase II/III design for oncology trials with subpopulation selection using survival endpoints. Pharmaceutical Statistics 2011;10:347-356.

Friede T, Parsons N, Stallard N. A conditional error function approach for subgroup selection in adaptive clinical trials. Statistics in Medicine 2012;31:409-4320.

See Also

gsubpop.sim

Examples

# hazard ratio in subgroup = 0.6 and full population = 0.9
# for both early and final time-to-event outcomes
# subgroup prevalence = 0.3 and correlation = 0.5
# futility stopping rule, with limits 0 and 0
subpop.sim(n=list(stage1=100,enrich=200,stage2=300),
           effect=list(early=c(0.6,0.9),final=c(0.6,0.9)),
           sprev=0.3,outcome=list(early="T",final="T"),nsim=100,
           corr=0.5,seed=1234,select="futility",weight=NULL,
           selim=c(0,0),level=0.025,method="CT-SD",file="")

ASD simulation for treatment selection

Description

Function treatsel.sim runs simulations for a trial design that tests a number of experimental treatments against a single control treatment group in a seamless adaptive trial. Test treatments are compared to the control treatment using Dunnett's many-to-one testing procedure. An interim analysis is undertaken using an early outcome measure for each treatment (and control). A decision is made on which of the treatments to take forward, using a pre-defined selection rule. Data are simulated for the final outcome measure, and data from the interim and final analyses for the final outcome measure are combined together using either the inverse normal or Fisher combination test, and hypotheses tested at the selected level.

Usage

treatsel.sim(n=list(stage1=32,stage2=32),
             effect=list(early=c(0,0,0),final=c(0,0,0)),
             outcome=list(early="N",final="N"),nsim=1000,
             corr=0,seed=12345678,select=0,epsilon=1,
             weight=NULL,thresh=1,level=0.025,ptest=c(1),
             method="invnorm",fu=FALSE,file = "")

Arguments

n

List giving sample sizes for each treatment group at stage 1 (interim) and stage 2 (final) analyses

effect

List giving effect sizes for early and final outcomes

outcome

List giving outcome type for early and final outcomes; available options are “N”, “T” and “B”, for normal, time-to-event and binary data

nsim

Number of simulations (maximum=10,000,000)

corr

Correlation between early and final outcomes

seed

Seed number

select

Selection rule type (select.rule); 0 = select all treatments, 1 = select maximum, 2 = select maximum two, 3 = select maximum three, 4 = epsilon rule (select means within epsilon of maximum), 5 = randomly select a single treatment and 6 = threshold rule (select means greater than or equal to threshold)

epsilon

For select = 4, set epsilon criterion

weight

Optional user set weight for combination test; default is to use those suggested by Jenkins et al. (2011)

thresh

For select = 6, set threshold criterion

level

Test level (default=0.025)

ptest

Vector of treatment numbers for determining power; for example, c(1,2) will count rejections of one or both hypotheses for testing treatments 1 and 2 against the control

method

Select combination method; available options are “invnorm” or “fisher”, with default “invnorm”.

fu

Logical indicating whether patients from dropped treatments (after interim selection) should be followed-up; default FALSE

file

File name to dump output; if unset will default to R console

Details

A structured description of the the methodology and the simulation model is given by Friede et al. (2011) and implementation by Parsons et al. (2012).

Value

count.total

Number of times one or more treatments are selected

select.total

Number of times each test treatment is selected

reject.total

Number of times each hypothesis is rejected

sim.reject

Number of times one or more of the treatments selected using ptest is rejected

Author(s)

Nick Parsons ([email protected])

References

Friede T, Parsons N, Stallard N, Todd S, Valdes Marquez E, Chataway J, Nicholas R. Designing a Seamless Phase II/III Clinical Trial using Early Outcomes for Treatment Selection: an Application in Multiple Sclerosis. Statistics in Medicine 2011;30:1528-1540.

Parsons N, Friede T, Todd S, Valdes Marquez E, Chataway J, Nicholas R, Stallard N. An R package for implementing simulations for seamless phase II/III clinicals trials using early outcomes for treatment selection. Computational Statistics and Data Analysis 2012;56:1150-1160.

Bretz F, Schmidli H, Koenig F, Racine A, Maurer W. Confirmatory seamless phase II/III clinical trials with hypotheses selection at interim: General concepts. Biometrical Journal 2006;48:623-634.

See Also

gtreatsel.sim

Examples

# two test treatment groups
# effect size = 0.3 for group 1
# for both early and final normal outcomes
# correlation = 0.3
# select one treatment only at interim
treatsel.sim(n=list(stage1=100,stage2=300),
        effect=list(early=c(0,0.3,0),final=c(0,0.3,0)),
        outcome=list(early="N",final="N"),
        nsim=100,corr=0.3,seed=145514,select=1,
        level=0.025,ptest=c(1,2),fu=FALSE,
        method="invnorm",file="")

# five test treatment groups
# correlation = 0.3
# flexible selection rule, with epsilon = 1
treatsel.sim(n=list(stage1=100,stage2=300),
        effect=list(early=c(0,0.3,0.2,0.1,0.3,0.05),
        final=c(0,0.2,0.3,0.2,0.1,0.5)),
        outcome=list(early="N",final="N"),
        nsim=200,corr=0.3,seed=145514,select=4,epsilon=1,
        level=0.025,ptest=c(1:5),method="invnorm")