preserve. set printback=on. * SIMPLE AND COMPLEX RANDOM ASSIGNMENT IN EXPERIMENTAL DESIGNS Valentim R. Alferes, University of Coimbra (Portugal), 2009. * ChooseRMD.sps - Choosing a suitable repeated measures design (see http://www.fpce.uc.pt/niips/spss_prc/scra/recomendations.htm). set printback=off. set ovars labels onumbers values tvars labels tnumbers labels. set errors=none. data list list/u(f8.0) t(f8.0). * Enter number of units and number of treatments. begin data 48 4 end data. compute tf=rnd(exp(lngamma(t+1))). compute mt=mod(u,t). compute m2=mod(t,2). compute a=u/t. if (mt=0) b=a. if(mod(b,2)=0) c=1. compute d=mod(u,tf). recode d (0=1) (else=sysmis). recode b c d (sysmis=0). if (d=1) Design=1. if (m2=0 and b<>0 and d=0) design=2. if (m2=1 and b<>0 and d=0) design=4. if (m2=1 and c=1 and d=0) design=3. recode design (sysmis=5). compute x=design. formats all(f8.0). value labels design '1' "Complete Counterbalancing" '2' "Single Carryover Design" '3' "Double Carryover Design" '4' "Partial Counterbalancing (Latin Square)" '5' "Truncated Counterbalancing ". string pro (a5). recode design (1='CC') (2='CO') (3='CO') (4='LQ') (5='[...]') into pro. string sps (a4) . recode design (1='.sps') (2='.sps') (3='.sps') (4='.sps') (5='.sps') into sps. string Program(a14). compute program=concat(rtrim(pro),ltrim(string(t,f5)),sps). value labels x '1' "S = T! \n n = N/S" '2' "R = N/T" '3' "D = N/(T*2)" '4' "L = N/T" '5' "See URL above". variable labels u"Number of Units per Study [N]" t"Number of Treatments [T]" x"Other Specifications" program"SCRAED Program". oms/select tables/if commands=["summarize"] subtypes=["case processing summary"]/destination viewer=no. summarize/tables=design/format=validlist nocasenum nototal /title='Suitable Repeated Measures Design'/cells=none. summarize/tables=u t x program/format=list nocasenum nototal /title='Design Specifications'/cells=none/footnote 'S = Number of different sequences of treatments \n n = Number of units per' +' sequence \n L = Number of randomized Latin squares \n R = Number of Latin' +' squares - single carryover \n D = Number of duplicate' +' Latin squares - double carryover'. restore.