createTestData {SPCDAnalyze} | R Documentation |
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)