Package 'SPCDAnalyze'

Title: Design and Analyze Studies using the Sequential Parallel Comparison Design
Description: Programs to find the sample size or power of studies using the Sequential Parallel Comparison Design (SPCD) and programs to analyze such studies. This is a clinical trial design where patients initially on placebo who did not respond are re-randomized between placebo and active drug in a second phase and the results of the two phases are pooled. The method of analyzing binary data with this design is described in Fava,Evins, Dorer and Schoenfeld(2003) <doi:10.1159/000069738>, and the method of analyzing continuous data is described in Chen, Yang, Hung and Wang (2011) <doi:10.1016/j.cct.2011.04.006>.
Authors: David A. Schoenfeld
Maintainer: David A. Schoenfeld <[email protected]>
License: Unlimited
Version: 0.1.0
Built: 2024-12-05 06:53:44 UTC
Source: CRAN

Help Index


Creates a test data set for the example

Description

Helper function for example that creates a test data set in the proper format

Usage

createTestData(times = c(0:11), transition = 5, rx1 = 0.5, rx2 = 1, slope = 0.5,
error=0.3, n = c(50, 50, 50))

Arguments

times

Observation times

transition

Time where phase I ends and Phase II begins

rx1

Drug effect on slope of outcome during phase 1.

rx2

Drug effect on slope of outcome during phase 2.

slope

Slope of outcome.

error

Standard Deviation of the error.

n

Sample sizes of the three groups, Placebo-Placebo, Placebo-Drug, Drug

Details

The model used is that the outcome is equal to (slope) times times for patients in the Placebo cohort with the addition of rx1 for the Drug cohort, during the first phase, and is equal to (slope+rx2) times (times-transition) for the Drug group in the second phase, and slope for the Placebo group in the second phase. A random noise is added to each observation with standard deviation error

Value

A dataframe is returned with variables:

ID

Patient ID

rx

Integer 1,2,3 indicating whether the patient is in the placebo-placebo, placebo-drug or drug groups

transition

Time that phase 1 ends and phase 2 starts

time

The observation time

y

The value of the outcome variable

Author(s)

David A. Schoenfeld

References

Fava, M., Evins, A. E., Dorer, D. J., and Schoenfeld, D. A. (2003). The problem of the placebo response in clinical trials for psychiatric disorders: culprits, possible remedies, and a novel study design approach. Psychotherapy and Psychosomatics, 72,3, 115–127.

Chen, Y. F., Yang, Y., Hung, H. J., & Wang, S. J. (2011). Evaluation of performance of some enrichment designs dealing with high placebo response in psychiatric clinical trials. Contemporary clinical trials, 32,4, 592-604.

Examples

createTestData(times=0:3,n=c(3,3,3),transition=5,rx1=0,rx2=0)

Example of helper function for determining placebo nonresponse

Description

The input to SPCDcontinuous requires a logical field which says that the patient was not a placebo responder in the the first phase of the study. Usually this is determined by whether their outcome was greater than a specified value but could have other criteria. This an example program which specifies non-responders as patients whose first phase results were greater than a constant.

Usage

placeboNonResponder(data, ID = "ID", k = 0)

Arguments

data

The data file to use to determine non-response.

ID

Text field indicating the name of the Patient ID variable.

k

A numeric constant. A patient is a non-responder if their change from baseline was greater than k.

Value

A new data frame with a variable named nonResponder.

Note

The choice of criteria should be specified in the protocol. One suggesting is to consider a non responder to be a patient who would still be eligible for the study.

Author(s)

David A. Schoenfeld, [email protected]

References

Chen, Y. F., Yang, Y., Hung, H. J., & Wang, S. J. (2011). Evaluation of performance of some enrichment designs dealing with high placebo response in psychiatric clinical trials. Contemporary clinical trials, 32,4, 592-604.

Examples

data1=createTestData(times=0:11,n=c(50,50,50),transition=5,rx1=0,rx2=0)
data1=placeboNonResponder(data1,k=0)

Runs a constrained longitudinal data analysis model for use with SPCDcontinuous

Description

The function SPCDFcontinuous requires an analysis function which estimates the treatment effect and it's standard error for each phase of the study. This function uses the so called cLDA model to analyze the data. In the situation where their are only pre-test and post-test measurements this is roughly equivalent to an analysis of covariance. This function can either be used as is or be used as a model for a user supplied function.

Usage

runGls(combData, times = "time")

Arguments

combData

This is the input file data file, it needs to have fields ID which is the patient identifier, time which is the observation time, y the outcome variable, trt a treatment code which is either Placebo or Active

times

This is the time variable. The set of times for each patient needs to be the same(except for some patients times may be missing). If they are different then the runSlopes function might work.

Value

A numerical vector of length 3 which gives the treatment effect, it's standard are and the z-score which is the ratio of the treatment effect to it's standard error. The function SPCDcontinuous will use the number of patients as the degrees of freedom to compute p-values.

Author(s)

David A. Schoenfeld [email protected]

References

Liang, K. Y. and Zeger, S. (2000). Longitudinal data analysis of continuous and discrete responses for pre-post designs. Sankhya: The Indian Journal of Statistics, Series B 62, 134–148.

See Also

SPCDcontinuous

Examples

data1=createTestData(times=c(0,5,11),n=c(50,50,50),transition=5,rx1=0,rx2=0)
data1=placeboNonResponder(data1,k=0)
#Example of use of function outside of SPCDcontinous
data1$trt=ifelse(data1$rx==3,'Active','Placebo')
runGls(data1,time='time')

Runs a random slopes model for use with SPCDcontinuous

Description

The function SPCDFcontinuous requires an analysis function which estimates the treatment effect and it's standard error for each phase of the study. This function uses the random slopes model to analyze the data.This is a random effects model with a random slope and intercept for each patient. The treatment effect is the difference in the mean slopes which modeled as the time-treatment interaction. This function can either be used as is or be used as a model for a user supplied function.

Usage

runSlopes(combData, times = "time")

Arguments

combData

This is the input file data file, it needs to have fields ID which is the patient identifier, time which is the observation time, y the outcome variable, trt a treatment code which is either Placebo or Active

times

This is the time variable.The observation time can be different for each patient. If they are the same then the runGls function might also be appropriate.

Details

This fits the random slopes model yt=μ+β1t+β2tI(rx=1)+u+bt+σϵy_{t}=\mu+\beta_1 t+ \beta_2 t*I(rx=1)+u+b t+\sigma \epsilon, where u,b,ϵu,b,\epsilon are random variables. Note that a treatment main effect is not included in the model by default, because in a randomized study the treatments should be the same at the baseline visit. This practice may vary.

Value

A numerical vector of length 3 which gives the treatment effect, it's standard are and the z-score which is the ratio of the treatment effect to it's standard error. The function SPCDcontinuous will use the number of patients as the degrees of freedom to compute p-values.

Author(s)

David A. Schoenfeld [email protected]

References

Laird, N. M., & Ware, J. H. (1982). Random-effects models for longitudinal data. Biometrics, 963-974.

See Also

runGls,SPCDcontinuous

Examples

data1=createTestData(times=0:11,n=c(50,50,50),transition=5,rx1=0,rx2=0)
data1=placeboNonResponder(data1,k=0)
#Example of use of function outside of SPCDcontinous
data1$trt=ifelse(data1$rx==3,'Active','Placebo')
runSlopes(data1,time='time')

Analyze a Sequential Parallel Comparison Design(SPCD), study with a binary endpoint

Description

Patients are randomized in three groups, patients who receive placebo in phase 1 and again in phase 2 of the study, patients who receive placebo in phase 1 and active in phase 2 and patients who receive active therapy in phase 1 and are not included in phase 2. A response criteria is determined and the phase 2 data of patients who respond in phase 1 is eliminated. Each phase is analyzed separately and the results are pooled. The idea of the design is that by removing the placebo responders in the analysis in the second phase the treatment effect will be greater and their will be an increase in power, both from the reuse of patients and from enrichment in the second phase

Usage

SPCDbinary(results, w = 0.5)

Arguments

results

This is a 3 by 4 matrix where with the first column being the number of responders in phase 1, in the 3 groups, Placebo-Placebo, Placebo-Drug and Drug-Drug. The second column is the number of non-responders, the third, the number of responders in the second phase and the forth the number of non-responders in the second phase.

w

The weight using to combine the first and second phases.

Value

A numeric vector with the effect, the standard error and the ratio of the effect to the standard error, for each phase and the pooled analysis followed by the three significance levels.

Author(s)

David A. Schoenfeld

References

Fava, M., Evins, A. E., Dorer, D. J., and Schoenfeld, D. A. (2003). The problem of the placebo response in clinical trials for psychiatric disorders: culprits, possible remedies, and a novel study design approach. Psychotherapy and psychosomatics, 72,3, 115–127.

Tamura, R. N., & Huang, X. (2007). An examination of the efficiency of the sequential parallel design in psychiatric clinical trials. Clinical Trials, 4,4, 309-31.

See Also

SPCDcontinuous

Examples

SPCDbinary(matrix(c(18,15,3,11,21,12,7,4,20,14,NA,NA),3,4,byrow=TRUE))

Analyze continuous data for the Sequential Parallel Comparison Design(SPCD) study

Description

Patients are randomized in three groups, patients who receive placebo in phase 1 and again in phase 2 of the study, patients who receive placebo in phase 1 and active in phase 2 and patients who receive active therapy in phase 1 and are not included in phase 2. A response criteria is determined and the phase 2 data of patients who respond in phase 1 is eliminated. Each phase is analyzed separately and the results are pooled. The idea of the design is that by removing the placebo responders in the analysis in the second phase the treatment effect will be greater and their will be an increase in power, both from the reuse of patients and from enrichment in the second phase

Usage

SPCDcontinuous(combData, recordID, times, group, transition, nonResponder,outcome,
runmod = runSlopes,w=0.5)

Arguments

combData

The data in long form that is to be analyzed.

recordID

The name or column number of the variable indicating the patient identifier.

times

The name or column number of the variable indicating observation time.

group

The name or column number of the variable indicating randomization group as defined above

transition

The time that is the end of phase 1 and the beginning of phase 2.

nonResponder

The name or column number of the logical variable indicating that the patient should be included in the phase 2 analysis

outcome

The name or column number of the outcome variable

runmod

A function to analyze the data from each phase. It must output a vector of three numbers, the treatment effect, it's standard error and the ratio of the treatment effect to its standard error. This package includes two examples runSlopes which uses a random slopes effects model, with a random slope and intercept, where the time-treatment interaction is the measure of treatment effect and runGls which is a repeated measures model where there is not treatment effect at time 0 and the outcome is the treatment effect at the last observation time. These models are described in more detail in the documentation of the package LPower which gives sample size methods for these models. You need to make sure these functions are selecting the correct coefficient if you use them.

w

The weight given to the first phase results, the weight given to the second phase is 1-w.

Details

The program uses the number of patients analyzed in each phase as the degree's of freedom for calculating the p-value and uses the Welch–Satterthwaite equation to calculate the p-value of the pooled result.

Value

A numeric vector with the treatment effect, its standard error and the ratio for each phase as well as the pooled values.

Author(s)

David A. Schoenfeld, [email protected]

References

Fava, M., Evins, A. E., Dorer, D. J., and Schoenfeld, D. A. (2003). The problem of the placebo response in clinical trials for psychiatric disorders: culprits, possible remedies, and a novel study design approach. Psychotherapy and psychosomatics, 72,3, 115–127.

Chen, Y. F., Yang, Y., Hung, H. J., & Wang, S. J. (2011). Evaluation of performance of some enrichment designs dealing with high placebo response in psychiatric clinical trials. Contemporary clinical trials, 32,4, 592-604.

See Also

createTestData,runSlopes,runGls

Examples

data1=createTestData(times=0:11,n=c(50,50,50),transition=5,rx1=0,rx2=0)
data1=placeboNonResponder(data1,k=0)
SPCDcontinuous(data1,'ID','time','rx','transition',
  nonResponder='nonResponder',outcome='y',w=.5,runmod=runSlopes)
data1=createTestData(times=c(0,5,11),n=c(50,50,50),
  transition=5,rx1=0,rx2=0)
data1=placeboNonResponder(data1,k=0)
SPCDcontinuous(data1,'ID','time','rx','transition',
  nonResponder='nonResponder',outcome='y',w=.5,runmod=runGls)

Calculate the power, sample size for a Sequential Parallel Comparison Design(SPCD) study

Description

Patients are randomized in three groups, patients who receive placebo in phase 1 and again in phase 2 of the study, patients who receive placebo in phase 1 and active in phase 2 and patients who receive active therapy in phase 1 and are not included in phase 2. A response criteria is determined and the phase 2 data of patients who respond in phase 1 is eliminated. Each phase is analyzed separately and the results are pooled. Calculates power or sample size as a function of the alternative hypothesis, posed in terms of response rates or effect sizes, for both binary and continuous outcomes.

Usage

SPCDPower(n=NULL, power=NULL, p, w=0.5, placeboProp=.66, drop = 0, alpha = 0.025,
         effect_size = rep(NULL, 2))

Arguments

n

Total sample size of the study, leave as null if you want the sample size computed.

power

Power of the study, leave as null if you want the power computed.

p

A 2 by 2 matrix, matrix(c(Phase1.response.drug,phase1.response.placebo,phase2.response.drug,phase2.response.placebo),2,2) indicating the alternative hypothesis

w

Weight for the first phase in the combined test

placeboProp

Proportion of patients randomized to placebo in the first phase

drop

The proportion of placebo non-responders that drop after the first phase

alpha

Significance level

effect_size

This is an alternative method of specifying the alternative. If it is used only p[2,1] needs to be specified. This is useful in the situation where a continuous endpoint is used and treatment response is not defined as the endpoint being greater than a constant.

Details

This program considers the situation in which response rates are supplied by the investigator, response is judged as by whether or not a continuous variable is greater than a constant, and the continuous variable is analyzed rather than the response variable. In this case it turns out the effect size for a comparison, where the response rates are p and q for placebo and active drug is qnorm(1-p)-qnorm(1-q).

Value

A numeric vector with the following fields, sample size n, Power for for the SPCD when using a dichotomous response outcome, Power for the SPCD using a continuous outcome where response is judged as a continuous variable being greater than a fixed constant, Power for a conventional design for a dichotomous variable and a continuous variable, Power for a SPCD design where the null is rejected if either the first phase or the second phase shows a significant difference. The first value is not corrected for multiple comparisons while the second uses a bonferroni correction.

Author(s)

David A. Schoenfeld [email protected]

References

Fava, M., Evins, A. E., Dorer, D. J., and Schoenfeld, D. A. (2003). The problem of the placebo response in clinical trials for psychiatric disorders: culprits, possible remedies, and a novel study design approach. Psychotherapy and psychosomatics, 72,3, 115–127.

Tamura, R. N., & Huang, X. (2007). An examination of the efficiency of the sequential parallel design in psychiatric clinical trials. Clinical Trials, 4,4, 309-31.

See Also

SPCDbinary,SPCDcontinuous

Examples

SPCDPower(n=150, power=NULL, p=matrix(c(.6,.3,.5,.3),2,2), w=0.5,
placeboProp=.66, drop = .1, alpha = 0.025,effect_size = rep(NULL, 2))