Download A Robust Code for Producing Stratified, Blocked Randomizations Utilizing VMS' Macro Facilities and the SET Statement with the POINT Option

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
Transcript
A Robust Code for Producing
Stratified, Blocked Randomizations
Utilizing VMS™ Macro Facilities and the
SET Statement with the POINT Option
David Main, Fidia Pharmaceutical Corporation
SOLUTION:
PROBLEM:
The system presented here is written to produce the desired
randomizations using the elements. described below_
To design a SAS based system which produces a SAS file
with N records with each record randomized to one of
Three files with data specific to a particular randomization:
several treatment groups or sequences of treatments.
1. MACRD.SAS
A file edited to contain SAS source code which assigns
values to MACRO variables using the %LET statement.
This file saved under a separate file name, serves as
documentation for each randomization;
The system has to have the following features:
- Produce records for designs that are produced in one
randomization (Le. designs requiring a second
randomization based on response to a first stage of study
are outside of the system);
- Randomize designs with both equal and unequal
numbers of records in treatment groups;
-Suppon crossover designs (Le. designs with patients
receiving more than one of the treatments during the
study);
2.RAW.DAT
A file containing the desired types and proportions of
exposure to treatment in the experiment. The flexibility
of this file allows for treatment groups with either
equal or unequal number of records;
- Handle designs with single or multiple stratification
3. FORMAT.DAT
A file containing PROC FORMATS used to document
the treatment groups and strata (if any) in the design.
factors~
- Allow the statistician to choose the blocksize of the
randomization.
One master source code (R1.SAS). This code contains
the following features:
The system has to produce a SAS data set of the
randomized records for use in labeling experiment
materials:
DEFINmONS AND FILES FOR TWO RANDOMIZATIONS
By use of %INCLUDE statements to insert %LEf
Design:
I-Period, Unequal
statements from MACRD.SAS and PROC FORMAT
statements from FORMAT.DAT into the SAS code;
Raliu;
Strata:
2 Pfl.l:& to I Comrol
Mild Disease HI
M()(.ie;att Dilease 12l
Severe Disease 13J
By use of PROC PRINTIO to direct the .LlS file to a
specified file name during the job execution;
Study
Centers;
By use of the SET statement with the POINT option
inside 2 DO LOOPS to generate the randomized data set.
The program uses 4 DATA STEPS and I PROC SORT to
produce the required results. This poster presents the
supporting files and annotated results of two distinct
randomizations. These designs are:
1. A I-Period Unequal Group Design;
2. A 2·Peried Crossover Design.
DEMONSTRATION:
- A well documented listing of the randomization;
- Files of the data used in each specific randomization.
The system must run in the VMS TM environment
with SAS release 5.16.
1067
Croter#1 ina Muhi.·center
Srudy
2-Per:iod Crossover
I Drug 1<;> 1 P!.aceb<l-
Ur.der 65 yean old. Male II)
65 year.; Uf ulder, Male [2]
Under (6 years old, Female (3)
65 yeMS or older. Female [41
The only center in the stJ;dy
SOURCE CODE
t;.·N·AM~·DuAi~I~::kMA!NrosTERJRi.s::s··
..•..•••..
DATA STEP 1
,,*·-"n ........... -.~
progran will generate a file WII!aining
records randomly
l:e PURPOSE:This
'lSSiglled IWO or more U'ealment groopll. 11ie p1'(IgJ'lIitlls Griven by 11
p3til:n\
II}
/1: ...., •.,.,.,.,..........., ...... *........ +............... +......................,.............
:1*'
~ generates DATA SET A with an om for each IfeI'IUIWlt. The nllmooofvariables irl ..~
"f" DATA SET A Is defined by lhenumber of expooute$ in the design.
r
file MACRD.sAS used loMme macro variables specific fora
rnndOO\;~tiw. 'The liSlirtg of the job is $tIll lQ {&OUTFILEjR.U.wT, .~
the log's in Rl.LOG. The SAS data set is $a'ledas {&OUTFILE),SSD."j
f:
..
..
~:
VARIABLE
&OtITFILE
7" &TI'It..El
,; &lNFUT
z: &WITHlNB arereadinlcDATASETB.
&TRTCOm defines the
COOlbl.mltiQn$.
z: &STRAT defines rnunbeTof w:m buhe design.
l"
1=
lWmben)f IttillIJlenl
the
~
r.
~:
I:
i·1=
.~
'"
:1'"
:1'
&sEa:>
&ALOG
&SrrE
&PERIDD
defines !he site numberuf aStildy being rendQmirui.
defm«!he tIlWW ofpetiods in L~ srudy design.
Y,
INPUTS:
The I'n)grllm requlUS tWI.> lllpm filfS~
~ DUAl:IANAL.MAIN.POSTERl&OUT~E.Rl. <:ontzins the listings c(the
randoollzOO patients.
DUAI:{ANAL.MAIN.POSTERJ &OUIFILE a SAS file used. in la!er programs
CREA1'ED: 9!12!ll&AUTHORDWM LASTUPOATED: m(l3m
f!
t.:
:~
"/
PROC PRINTDATA=A;
TITLE2 'THIS LISTlNG IS A PRlNT OP THE ORIGINAL
DATAINRAW.DAT';
:~
.~
.,
",. DUAl:[ANAL.MAIN.POSTERJ RAW.DATcontaining treaonemsequences
r DUAl:tANAL.MAIN.f'OSTERJ FORMAT.SAS providi~ PROC FORMATS
r QlJTPUTS:
to document the repon 0 Itre randomiuuion.
"/!':
RAW.DATFILE
I·PERIOD UNEQUALGROUJ>S DESIGN t 2~PERIOO CROSSOVER DESiON
CDD
I
POOP
'"
:,
f'
r
:'
defines !he nwnbet of times !he block .l'ae10f (&WITHINB"
&TRTCOMB) ~ replicated IQ pro4ucc the proper stnta size.
defines the ~d value used fur therandomizmion.
defines llle cooe used to produce -patienl numlJlm.
&NSTRAT
:}
:/,
:;:
THIS LISTING IS A PRINT OF THE ORIGINAL
..~
./
DATA IN RAW.DAT
:J
:~
i-.....................................................« ...............................• ..• .. • ... ••••• ..7
2-PfRIOD
CROSSOVER DESIGN
OBS TXt
,
C
2
D
OBS TXt TX2
,
P
D
2
D
P
D
The resuh {lfth$s dat4 step if the prodvttifHI {IfDATA SET A which {:f}ntains lite
ltNJfmfn/$ ill RA W.DAT t~ Wv SAS by the INPUT $lakmenrdrjinedin
&INPUT,
DATA STEP 2
%INCLUDE PORMT;
PROCFORMAT:
VALUESTRTP
'O'='DRUO'
VALUE$TR1F
'D'='DRUG'
DATAB (DROP = 11 11);
DO II = 1 TO &WITHINB; f* do loop A *f
DO 11 = 1 TO &TRTCOMB; /* do loop B *f
SET A POINT = J1;
OUTPUTB;
END;
1* end loop B *f
END;
f* end loop A *f
STOP;
PROC PRlNT DATA= B;
TITLE2 'THIS LISTlNG IS A BLOCK SIZE REPORT OF
THE TREATMENT COMBINATIONS';
'J>"::: 'PLACRB{Y;
VALUESTR1F
'C'" "COl'IThOL';
VALUESTRTF
1",' MILD DISEASE (1]'
2=' MOOERATEOISEASE 12],
'0'
1 z.'
13d
3»' SEVERBOIS£ASE (3T;
%INCLUDE MACRD;
1
l-PERlODUNEQUAL
GROUPSDESlON
,
OPTIONS DQUOTE LS=80;
FILENAME MACRD 'DUAl:[pOSTERjMACRD'sAS';
FILENAME RAW 'DUAl:[pOSTERjRAW.DAT';
FILENAME PORMT 'DUAl:[POSTER]FORMAT.DAT';
LlBNAME FILE 'DUAl: [POSTER],;
f..;-
.~
...........,1
DATA A;
INFILERAW;
INPUT &INPUT;
:~
PURPOSE
defines !he file name 10 3erId log output.and data set.
defines first line of title fur ou1pllL
defille5-theinpulstatementUffiiwitl\RAWDAT,
defines the number of ttealmllnts in the inpllt file RAW .DAT that
"f
:?
INPUT: Jrdile RAW
~OtTfPUT;DA1'ASIITA
I........ u .... u.~*u..............~........................ _u ....._
~ CONTENTS OF TIlE MACRO VARIABLES DEFINED IN MACRD.5AS: :~
i!
~
~ VAT A STEP L Thiutep reads in the treatment combination triJm RAW DA T and ,
:~
MACRD.sAS FILJ:.
l-PERI6DUNEQUALGROUPSDESIo""N T 2:rmiOD-CROSsOVERDESION ~~'I'I~D~~~~1 ~Wl$~6D'~~~TION
OROill' STUDy DESI(IN';
%LETINPUT=TX1$@@;
%LET PERIOD" TXl;
%LET WTIHINB '" 2;
%LET TRTCOMB ... 3;
%LErSTRAT:::4;
%LETNSTRAT=2;
%LBTSITE:;;:I;
%LET ALOG=((&SIlE'" 10lXl)+
(STRATUM· )00) + COUNT};
%LBT SEED '" 092288;
%LE:r mtrF.n.E •.tlNBALtp;.
I
STUDYDESlON';
%l..ET INPUT =1'Xl STX2$@@;
%LBTPERlOO=TXl TX2;
THIS LISTING IS A BLOCK SIZE REPORT OFTHE
TREATMEN1'COMBINATIONS
.,""'"
,.reltlOl) l.JNEQVId.
%LET Wl'IHINB '" 2;
%LET'ffiTCOMB '" 2;
GkQUI'$ .l;!&$U
~oo
%LETSTRAT:;;:3;
%LETNSTRAT=2;
%LE.TSITE",:
%LET ALOG :({STRATUM· 100)
+COUNT};
%LET SEED '" 012389;
%LETOIJ!FILE", C_O_lP;
C
D
D
C
Cl!.Os:wvllRDl!.SlCtI
OBS "tXt 1Xl
•
,
D
,
,
D
,
D
D
o
D
FILENAME DEST "DUAl:[POSTERj&OUTFlLE.RI ";
PROC PRlN'ITO FILE=DEST NEW;
TI1l..E &TITLEI;
T'bt r«fIll of the IUO#d doJa slep u w production oj DATA SET B whieh conhWls 1
bioc:k oj tmdmmts. A. blMl fj Ifut /lumber tl/ ttetmIt"UIhd t6 4SS1U"t 1M dttInd
tnttJ.lnKnt roJUJ is lMil>f4int:d. iff. tht I'period ueflt4l trMlmUJI glV1lp duit" the 2:1
crotW oj drug t6 V1l1treJ is assured s./lff etu:h 6 ~t4 records.
Tlte hIod'is<ontrol1e4 II, DO WOP A and DO 1..OOP B. Tht OUTPUT statemelll is
ftS€d i.n f;fllljunetiJJn wlih /hI POINT opIiulf {II tM SET $tllUmml to tMUm 'ht
owpmdng of rteordt.
1068
DATA STEP 4
•••••••.o-..................................*.......,...................~.~...* •••:I
j
DATA STEP 3
,• .,............" ............................................................'"* .......j
r. -
~ DATASTEPl.Thisstep:
:~
:f
w;tru.n
bled.;
f:~.. . the
l'tSulting data set «(:) it sontd by STUTUM. BLOCK and RAND
r.INPUf:DATASETB
rI .OUfPUl':DATASE'fC
••••• u ...........................u
'*
'*
"Z
*'
FORMAT &FERlOD $TRTF. STRATUM STRTF.;
OUTPUT;
COUNT+I:
PROC PRINT DATA= F1LE,&OUTFlLE;
VAR PATIENT RAND BLOCK &PERJOD;
BY STRATUM:
*'
TITLE2
'THIS LISTING SHOWS THE FINAL VERSION OF
THE RANDOMIZATION WITH RECORD NUMBERS';
TlTLE2
THIS USTING SHOWS THE RANDOMIZED DATA
SET BEFORE CREATION OF RECORD NUMBERS':
THIS LISTING SHOWS TIlE FINAL VERSION OF
TitE RANDOMIZATION WITH RECORD NUMIlERS
AANOOMrlAT1ON OJ' A
t.PEJUOO 1.iM:Q1JAL STIJDY OESWN
THIS LISTING SHOWS THE RANDOMIZED DATA SET
BEFORE CREATION OF RECORD NUMBERS
IIANDOMlZATIONOFA
,,, •,,
,
••
,•
OilS lX! STR,\.TIlM RAND IltoCK
O.O:llM!
O.6S4[tiO
,,•
,,
,•
,,
"""
"""
""
"
"
.
W
~
""
"""u
"
""n
"""
~
,,
,
,
,
,,
,,,
,,,
,,,
,
,,,
0
0
D
D
D
D
D
,
,,
D
,
D
,0,#1,:;1
••• M1S623 ,•
•, ,,- ,
•• M"'" ,,•
,,,• utmt ,•
•
,,••
,•,
,,••
,,,
, M._ ,,
,,,
,
, ,,, ••
, ."'., •
,, ,-" ,,••
,,, ,=» ,,,
.. ,,
, ,•
O.<I4l3S4
Q.1~n»
1'1.S41J9(1
0.76511(;
.""".
U91Wl
0.S401~
0.961144
&.9141!i1
O.915S60
iH$!~S
o.m~!4
~.ml"
...
1>.574Wi
O.63I1S4
O.TI2242
;
O,84!~1
;
-
lJ.8'!!706
IUown
0.~1'I11il
._ ••• _-_ .• _._ ••• snvo.TUM=MItD Df5.EASE [1]. __ •. ---.ODS fATIE:lT MND BLOCK TXI
1101
RANDOMIZATION OF A
:PI'I\R[ODCROSSOVE& OSSlGN
H'6RlOO UNEQUAL GROVt OESIGN
,,
,
,, ,
• ,,"
".."" ,
.."
,,
OBS lXl 1X1 STRATUM
,,•
,,
,
0
D
0
0
0
D
..""
"
,.""n
~
n
,,"
",0
,,0
0
,,"0
""" ,
"""n ,0
D
0
0
,,
,,
RAM)
n,3K'145~
(I.slIm
U~
U~
M91l91
..
D
!)$81'n
UM
llU!
•,
,,••
"
0.119:l!n
...
..."
"
Q139UIJ
M2'lllt
OSlTnl
0
o.zJ\890
D
D
0
;
"""
""
ll.1o1111
0.J34131
-t>.n'IQlo
0
~
o.nlS4!.l
.
l!$HI611
D
M;~
lilt>
IIIl
tllZ
U.m71fi
.~
0.391091
"'"
,~.
.~
o.S(1l90
UJ7TII
U~lM
M6l844
"" ..""'"
.~
.~
.~
111U
!Zit
1ZI1
DR"G
M"~
~.II147Sl
.W
~o,
~.W695
a·m~I'
o.W11S
.-M
-~
0.6111501
""
..
'"'''''
'"'''''
"""""
DROO
~o,
CONnOL
DROO
CONIROL
",,00
DROO
DROO
... --~-·snlA1U~0IS£ASE]31·-_-_··_
....
M1i~1i4
wn~
. ,""'"
""."
"u .M.
"'"
.,. ."""
0.9118911;
D
~,~
,~
U~
,~
D
D
O.!ll'1I!41
_'00
••• """
Dll.1JO
0.641384
• DJi;UG
,,•• ~"
MnllZ
M~19:l2
•
,•• .W,
UM
""'"
,• .w,
DR""
..0'''''
""" ,,, ""=
"U
, '''''''."
oomw,
BtoCK
••
•• """" ,
~"
, ,,•• ....
••
••
,, ,,•
•
,
~'"
, ,,, 0,101641 ,,,
OM9att
,, ,•, "'~" ••,
""'"
, ,,
,,•
",, ,, '"= ,,,
, ,•• " '" ,,
,
", ,,• G.mnS4 ,,••
", , ,,,"'" •
=,~
0
.,
DATA FlLE.&OUTFlLE (DROP= COUNT) ;
SETC;
RETAIN COUNT;
BY STRATUM;
IFFlRST,STRATUMTHEN COUNT=l;
PATIENT = &ALOG;
:~
"I
•••••• -u ••••••••••••••• " .................4/
DATA C (DROP= 12 J2);
SETB;
DC 12= 1 TO &STRAT; 1* do loop C */
DO 12 = ! TO &NSTRAT: do loop D
STRATUM = 12;
RAND = RANUNI(&SEED);
BLOCK=J2;
OUTPUTC;
END'
end loop D */
END;'
/* end loop C
PROCSORTDATA=C;
BY STRATUM BLOCK RAND;
PROC PRINT DATA= C;
:~
_atlactle5 f<ll'Jl'liH$ from FORMAT.OAT fOHjQCmuMuUOO
_ putS the SAS wna setout!O a file defined oy &Ol1TFlLEssd
1:·"'·"'··..p~U£lltj. ..~\U'lt$J.l!!~.\~l\~a~J!.:4!fIR~~l~:lJis..u·"""" ...1
.z~
C$cll
rDATA_sm~'U!::=berder!!ledby&ALOG;
):
r
tl1eneeded nwnber Qfnmdolniled recoois for each StriItUm ofthedesign;"l
Z· _ produce.! the variables STRATUM and StOCK and;he nmdom number In!he
~: variable RAND;
.,
'" _ rand.o1n numbers are generated within each levu of BLOCK to 1nsUU; ba\.ance :'
creates
" UM
".
..". """"
{I.lHI:li6
M!II09!
U
~
;;'lI09n4
~
~
The ll!$ult oj rM third d4ttu.ttp if 1M TA SET C. This dtwJ stt contm"s 1M lsillm oj
records llUdetlfor ru mmiomirJUion. T1u IUl.mbi;r of ucom requirt4 is f;{)1llrol1t4 b,
mt #JIQr;ksizt, the "limber (Jf mortis nnikd in {I. SJrutum (defintd bj &NSTRAT in DO
WOP D;, an4 tht IIlJmbuo/straUl in tlu! design (4ejine4 by &STKAT in DO WOP C;'
This Sftp rdfo tl'tai~ tnt random number RAND 101' each ruord U$ing lh1! RAN UNJ
funcnon wUh4su6ltnmiJertk/inm bl &SEED. TIte Itn' l'oriaMe BLOCK is: ustSI"
assu!'"! ra.f4follfk/JtWn within a singk blrJCk.
Finally, PROC SORT by STRATUM, BLOCK an4 RANDotfuaffy tttndMl/v:slht!
gtRt!1rlted rtClJfds.
1069
B~
B~
U10
nil
1311
0.841953
'"""
."""
0.102041
M"n161
IU!l!iBI4
'''''''
",,,.,
'"""
DR'' '
D.""
"""""
""""",
DROO
~GG
,",GG
~,..'"
""""",
"'"G
""uo
THIS LISTING SHOWS THE FINAL VERSION Of
THE RANDOMIZATION WITH RECORD NUMBERS
CONCLUSIONS:
MJID:)MlZATION (,)F A
2·!'EJI.IOD CROSSOVER STIJDY O£:SKil>l
-The system presented has a number of flexible features
which allow for easy randomization of several different
types of experimental study designs.
- The resulting data set can be used with other SAS
programs to produce labels and inventQry listings of
supplies packaged for trials.
• STl<AWM*UNOUR 6$ YEl0l.S. MALE (il
;;;lBS
YATIENf
Mt14!1S
I(r,l:
(/."'17"
1m
11$3100
II.M191
IIA!I<P!II
O.illin
164
105
106
un
108'
..•
....""
"
...."
n
w
"
n
""
W,
'"
'"
'"
'W
'"
,~
M
3QI
~
'""
"
BLOCK
T.J(I
=
moo
>'U"oo
~~ ~oo
NOO
~oo
~cr",
","",00
"'-''''''
DRUG
IIMJool
"'""''''
"-''''''
moo
"""""
0.1l9301
moo
0.543651
o.•WUr.I
O..fll3U
O.m711
o=m
0.NI647
Q.2nS9o:l
Q.£~U
~oo
NOO
nAC'''' ",wo
'""'''' "'''
""~
~o
",00
"""'.,
",uo
"-''''''
"'00
~"'"
"-"EO> "'00
O.5!i2611
O.Wl:i11
O.1U2111
DRUG
PlACllW
Jill
DRUG
PLACElIO
o.134J31
:f'U.CE80 OI<UG
1M
3M
IU#?U
0.177086
fUC£SO
1'tACESO mmG
101
J!:>t
1l711i40
o.!U631
l'LACEtIO DRUG
...,
."",
O.9U90l
~0Cl
o.soon
0.61066
l"UCEl"IO DRUG
nt<UG
nl!:UG
fLACE!!O
moo
muo
~=Q
"""'"
KACEW D&UG
M,",~976
1'tACl100 DtWv
~,
O.I:tS154
PLAC'E&O DRUG
~
0.11112~
PLACEBO
JU,CESO DRUG
~,o
PLACEBO
O,4J3Q"/\
O.9}0022
-The system as presented has been used at FIDIA
Pharmaceutical Corporation since 1988 to produce
random codes for i clinical trials at 28 sites •
~~
:ID>
""n .",
.M
~
RAND
WI
muo
In this-final tk;.ta litep a perrmmero SAS data set named by &OUTFILE is Heated. In
this data set 1he reCQrd number 1$ ~nfftlttd using J:AWG along with fhe &SITE, if
applicaale, PM the STRATUM lewis in the ruord number.
The./QrtOOts.are attachaf at this Jfflintfor the purp!Jses af doctlmetrlatwII o/the listing
only, 1he /or!'f1(j" are IWf all4tl!e!l to the perm(fnUlt $AS daM set.
1070