258
TIPS - July 1986
Computer analysis of the sequential trial In clinical pharamacology, a rapid, reliable and highly efficient method for the clinical evaluation of n e w c o m p o u n d s is much sought after. The use of the sequential trial is often most appropriate but m a n y researchers are unaware of this procedure and its potential. We have designed a serial program to simplify the use of the sequential trial. We offer a variety of designs for the user to choose from according to his or her requirements. In a sequential trial, all subjects are not expected to be present at the initial stage, but each subject will enter the trial w h e n he or she becomes available. Results of the trial are plotted graphically. Subjects are p a i r e d and one of each pair receives either treatment A or B. If the graphs run horizontally, there is no difference in the treatment regimes. If A is preferred, the graph will move upwards; if B is preferred, the graph will tend to fall. Results are plotted continuously until the graph crosses one of several boundaries, indicating the end of the trial. Boundaries are d r a w n according to three specifications 2c~, ~ and 0 as defined b y Armitage (Fig. 1). The chance the researcher takes in r e c o m m e n d i n g one of the treatment regimes w h e n in fact A and B are similar is d e n o t e d b y 20~;
denotes the risk of failure to recommend one treatment when A and B are appreciably different; 0 is the proportion of 'preferences' in favor of the r e c o m m e n d e d
2~ SEQUENTI AL TR I AL ( ARMI TAGE DES I GN ) "~~" 2A = . 0 5
'I
10 ~ 38 . 4,0 ~ 20
-10
-15 -20 -25
Fig. 1. A diagram of sequential trial of Armitage design (the criteria of trial 2m ~ and ~ are displaced by 2A, B and C respectively).
treatment which could be considered beneficial to therapy (qualitative data). Once these critical Values are chosen, four boundaries can be plotted b y computer according to formulae and tables p r o v i d e d in Refs 1 and 2. The researcher m a y wish to compare quantitative rather than qualitative measurements and in
SEQUENTIAL T - T E S T ( R E S T R I C T E D ) 2A=. 0 5 r B=. 0 5
3 2 1 0
2
4
6
8
10
12
14
16
18
20
' 22
Fig. 2. A diagram of sequential t-test (restricted) (the criteria of trial 2o~,~ and 6 are displaced by 2,4, B and C respectively).
1986, Elsevier Science Publishers B.V., A m s t e r d a m
this case a sequential t-test should be applied. In a sequential t-test (quantitative data), 0 should be replaced b y 6. The difference between the effects of the two treatments should be calculated for each patient and transformed to a Z value, where Z = (Ed)2/]Cd2. The estimate of 6 (6 = d/Sa, where d is the mean of d, the difference between the effects of the two treatments; S = standard
0165 - 6147/86/$02.00
deviation), accompanied by the values 20~ and (3 determines the boundaries of the sequential t-test. The u p p e r b o u n d a r y denotes A superior or B superior according to Z d ~ O or E d > O respectively, while the lower b o u n d a r y denotes that there is no important difference between the two drugs. The value of Z is calculated at each stage and plotted against n, the n u m b e r of pairs. The trial is to be continued until the tracing formed b y joining the consecutive values of Z crosses one of the two boundaries. All procedures mentioned above can readily be performed b y computer programs (Fig. 2). The programs were developed b y the authors on an Apple II with 48K m e m o r y and one disk drive. It is written in Applesoft BASIC but it can be adapted to other types of microcomputer b y changing some commands. The program listing accompanies this article. It will run under mixed graphic-plus-text mode displaying a diagram of the sequential trial on the u p p e r portion of screen. The user keys in
259
TIPS - July 1986
]LIST 10 20
HONE V T A B 8: PRINT "A PROGRAM OF A RNITAGE DESIGN" 30 PRINT : HTAB 5 : PRINT "WI7~ ALSE POSITIVE RATE=.05;': 40 PRINT : HTAE 5: PRINT "WAL~CE NEGATIVE RATE=. 05 " 50 PRINT : HTAB 5 : PRINT "AND SE N S I T I U I T Y OF T R I A L = . 7 5 " 60 GET N$ 70 POKE 3 4 , 2 0 80 HONE : PRINT 90 U = .05 I00 V = .05 I I 0 W = .75 120 D$ = CHR$ (4) 130 PRINT D$;"BLOAD MCG" 140 HGR 150 HPLOT 2 5 , 1 0 TO 2 5 , 1 5 0 160 HPLOT 25~80 TO 265~8CI 170 FOR I = 0 TO 50 180 IF INT ( I / 5} = I / 5 THEN 20O 190 HPLOT 2 5 , 1 0 ÷ 2 . 8 ~ I TO 29, IO
200 210 220 230 240 250 260 270 280 290 300 310
320 330
*
2.8
•
I: HPLOT 2 5 ~ I 0 +
GOTO
210
=
STR$
(X(I)):
NEXT
GOSUB 750 FOR I = 0 TO 5 : Y ( I I / 5 ~ I Y$(I)
=
STR$
(Y(I))
NEXT
Y I:
GOSUB 7 9 0 340 FOR I = I TO 5 : Y I ( I ) = YI I 5 ~ I 350 Y I $ ( I ) = STR$ (YI(I)): NEXT I : OOSUB 030 3 6 0 L$ = "SESUENTIAL TRIAL (ARMIT AGE D E S I G N ) ' : H = 22:V1 ~ 8 : GOSUB 870 3 6 4 L$ = "A SUPERIOR':H = ~ O : V l = 3 0 : GOSUB 070 3 6 6 L$ = "B SUPERIOR":H = 90:U1 = 136:
380
:Vl = !7: GOSUB 8 7 0 L$ = "B=" ÷ STR$ (V):H Vl = 26: S O S U B 870
OOSUB B 7 0
the result 'SF' or 'FS' conform to the preference of A or B respectively. The numbers of 'SF' and 'FS' will display on the four lines of text on the lower portion of screen. As soon as the tracing reaches one of the boundaries the computer emits a sound announcing the end. In this program, the function of file MCG is to display characters in high-resolution graphics. This file
=
"2A ="
388 L$ =
+
STR$
(U):H
" N " : H = 250:V1
= =
Y ~ 70 / + 25180
28 28:
600
IF
GOSUB
610
IF
L$
20:
~0 630
PRINT
I
=
=C="
*
STR$
(W):H
=
V I = 3 5 : GOSUS 870 FOR I = - 1 TO 1 STEP 2 HPLOT 9 • 4 ÷ 2 5 , 8 0 - I ~ 9 ~
400 410
3
420
TO
12
•
25~80
+
-
I
•
10
660
3
TO
23
~
4
+
-
12 ~
25,80
-
4
*
25,80
-
I
1
HPLOT 7 • 3
720
15C
I -
20
~
,80
480 490 500
22
I
~
~ -
-
I
~
~
TO
~
3
21
60 ~ 4 + 25,00 TO 6 1 ~ 4 + 2 5 ~ 3
HPLOT 61 • 4 + 25,80 - I ~ 2 I • 3 T O 6 2 ff 4 + 2 5 , 8 0 - I ~ 20 ~ 3 HPLOT 44 ~ 4 + 25~80 TO 6 2 ~ 4 + 25,80 - I ~ I8 ~ 3 NEXT I
520
HT~B 5 ; PRINT : INPUT
PRINT "SF OR FS" NTAB 5
540 IF N$ ~ "SF" 550 I F N$ = "FS" 560 GOTO 510 570 X2 = X + I : Y 2
m Z:
HPLOT X ~ 240
Y -
1;22
m Z +
+
!
X2 -
IO)~"SF=";~2 -
20);"FS=";Z2 Y2:Z
HTAB
=
5:
Z2:
GOTO
PRINT
"A
51 SUP -
:
TAB(
HTAB
5:
TAB(
17);"SF=";X2
PRINT
mB SUP
25);"FS=';Z2:
GOTO
3 =
16336 = I TO 5
730
NEXT END
PEEK (S) PEEK (S)
PEEK
(S)
+
PEEK
I
LEN 810
820 830 840
850
890 900 910 920
(Y$(I))
DRAW ASC ( MID$ ) - 3 1 A T XX + 6 YY + C
(YI(TI I,~ J,6 + I
~
NEXT J : NEXT I : RETURN XX = O:YY = 15:C = 76 FOR I = 1 TO 5 : FOR 3 = I TO LEN ( Y 1 5 ( I } ) DRAW ASC ( HID$ ( Y I $ ( I ) , J , I )) - 31 AT XX + 6 ~ 3,6 + I YY + C NEXT J : NEXT I : RETURN FOR I = I TO LEN (L$) DRAW ASC ( MID$ ( L $ , I , I ) ) 31 AT 6 ~ I ÷ H , V I NEXT I RETURN PRINT IF
ASS
(Y2)
<
=
X2
-
44
GOTO
690 I
60 + 2 5 j 0 0
-
being a shape table is very useful to any type of graph displayed by the computer. The programs of other designs of the sequential trial can be obtained by writing to Mr Xu Duan-zheng. They may be copied without restriction.
XU DUAN-ZHENG
~
HTAB 5 HTAB 5 : PRINT "NO S I G N I . D I P F .'; TAB( 2 0 ) ; ' S F = ' ; X 2 - Z2; TAB( 30);"FS=';Z2: OOTO 700
740
880
= Y + l:Z2
580 X2 = X + 1 : Y 2 " 1
~2
750 X X = 4 0 : Y Y = 89:C = 12 760 FOR I ~ 1 TO 6 : FOR J = 1 TO LEN ( X $ ( I ) ) 770 DRAW ASC ( M I D I ( X $ ( I ) , 3 , l ) ) - 3 I A T J ~ 6 + I ~ X X + C ,YY 780 NEXT 3: NEXT I : RETURN 790 X X = 6 : Y Y = 15:C = 6 800 FOR I = 0 TO 5 : FOR J = I TO
870 T H E N 570 THEN 5 8 0
GOTO 5 ? 0
590
; .262
700
700 S = FOR I
860
Nil
TAB( =
:
710
X = O:Y = O:Z = 0
530
510
3
22 I
GOTO PRINT
(S)
3
~
690
I
HPLOT 50 ~ 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+ I ~ 4 , 8 0 TO 25 + I ~ 4,76 NEXT I SCALE= I POKE 2 3 2 = 0 : POKE 2 3 3 , 1 3 3 X = 60:Y = 25:YI = - 25 FOR I = I TO 6 : X ( I ) = X / 6 I X$(I}
370
AND
SHI
JUN
930
GOTO 630
Department of Pharmacology, Shanghai Medical University, Shanghai200032, China.
References 1 Armitage, P. (1975) Sequential Medical Trial, 2nd edn, Blackwell 2 Xu DZ. (1979) Sequential Trial in Medicine, Shanghai Scientific and Technical Publications