preserve. set printback=on. * SIMPLE AND COMPLEX RANDOM ASSIGNMENT IN EXPERIMENTAL DESIGNS Valentim R. Alferes, University of Coimbra (Portugal), 2009. * CO8.sps - Single carryover design (8 treatments; 8 sequences/units). * STEP 1 * Run STEP 1 without any modification or addition; next, look at the botton of the output window and follow the instructions given in STEP 2. set printback=off. set ovars labels onumbers values tvars labels tnumbers values. oms/select tables/if commands=["summarize"] subtypes=["case processing summary"]/destination viewer=no. oms/select tables/if commands=["crosstabs"] subtypes=["case processing summary"]/destination viewer=no. data list free/v1(f8.0) v2(f8.0) v3(f8.0) v4(f8.0) v5(f8.0) v6(f8.0) v7(f8.0) v8(f8.0). begin data 1 2 3 4 5 6 7 8 2 3 4 5 6 7 8 1 3 4 5 6 7 8 1 2 4 5 6 7 8 1 2 3 5 6 7 8 1 2 3 4 6 7 8 1 2 3 4 5 7 8 1 2 3 4 5 6 8 1 2 3 4 5 6 7 end data. save outfile=outf1. set seed random. compute na1=uniform(1). rank na1(a)/print=no. formats rna1(f8.0). variable labels rna1"First Permutation". summarize/tables=rna1/format=validlist nocasenum nototal /title='Random Permution for Square 1 Rows'/cells=none. sort cases by na1(a). save outfile=outf2. flip variables=v1 to v8. compute na2=uniform(1). rank na2(a)/print=no. formats rna2(f8.0). variable labels rna2"Second Permutation". summarize/tables=rna2/format=validlist nocasenum nototal /title='Random Permution for Square 2 Columns'/cells=none. sort cases by na2(a). string xname(a8). recode rna2 (1='var001') (2='var002') (3='var003') (4='var004') (5='var005') (6='var006') (7='var007') (8='var008') into xname. flip variables=var001 to var008/newname=xname. save outfile=outf3. save outfile=outf4. get file=outf1. string C01 C02 C03 C04 C05 C06 C07 C08(a4). recode v1 to v8 (1='A') (2='B') (3='C') (4='D') (5='E') (6='F') (7='G') (8='H') into c01 to c08. summarize/tables=c01 to c08/format=validlist nocasenum nototal /title='Square 1 \n Standard Latin Square'/cells=none. get file=outf2. string C01 C02 C03 C04 C05 C06 C07 C08(a4). recode v1 to v8 (1='A') (2='B') (3='C') (4='D') (5='E') (6='F') (7='G') (8='H') into c01 to c08. summarize/tables=c01 to c08/format=validlist nocasenum nototal /title='Square 2 \n Random Permutation of Square 1 Rows'/cells=none. get file=outf3. string C01 C02 C03 C04 C05 C06 C07 C08(a4). recode var001 to var008 (1='A') (2='B') (3='C') (4='D') (5='E') (6='F') (7='G') (8='H') into c01 to c08. summarize/tables=c01 to c08/format=validlist nocasenum nototal /title='Square 3 \n Random Permutation of Square 2 Columns'/cells=none. get file=outf4. compute na3=uniform(1). rank na3(a)/print=no. formats rna3(f8.0). variable labels rna3"Third Permutation". summarize/tables=rna3/format=validlist nocasenum nototal /title='Random Permution for Square 3 Symbols'/cells=none. * STEP 2. * In the next syntax line, replace the "?" with the numbers of the "Third Permutation" (see botton of the output window); then run STEP 2 command lines without further changes or additions. recode var001 to var008 (1=?)(2=?)(3=?)(4=?)(5=?)(6=?)(7=?)(8=?) into pt01 to pt08. string C01 C02 C03 C04 C05 C06 C07 C08(a4). recode pt01 to pt08 (1='A') (2='B') (3='C') (4='D') (5='E') (6='F') (7='G') (8='H') into c01 to c08. summarize/tables=c01 to c08/format=validlist nocasenum nototal /title='Square 4 \n Random Permutation of Square 3 Symbols'/cells=none. N 4. execute. save outfile=file5a. rename variables (C01=C08) (C02=C07) (C03=C06) (C04=C05) (C05=C04) (C06=C03) (C07=C02) (C08=C01). save outfile=file5b. get file=file5a. execute. add files /file=*/file=file5b. execute. summarize/tables=c01 to c08/format=validlist nocasenum nototal /title='Square 5 \n Single Carryover Design \n Final Latin Square' /cells=none/footnote'Rows 1, 2, 3, and 4 are identical to those in ' +'Square 4; Rows 5, 6, 7, and 8 are the reversal of Rows 1, 2, 3, and 4.' +' \n If necessary, repeat the syntax for each new set of 8 units.'. restore.