macro=; macro * 15 (nchar+25); /* Siddall */ /*** check whether blocks are defined ***/ if (nblocks < 2) quote * This macro is intended to implement ILD test of Farris et al 1995 Cladistics 10:315Ð319.... you must have defined partions using the BLOCKS command. No blocks have been found. Please define your blocks, or arraange your data input in blocks and re-run. ALSO note that while 100 random partitions is default, you may do as many as you like. Just include a number after ILD.RUN on the command line; proc/; end var: numblocks chararray[(nchar+1)] truelength thislength critical charnum p maxiter; set numblocks nblocks; set charnum nchar; if (!argnumber) set maxiter 99; else set maxiter %1; end if (getresponse ['numblocks' partitions found. To stop and see blocks click NO or CANCEL.]!=1) loop =dumpblocks 1 nblocks set numblocks blockstart[#dumpblocks]; quote blocknum #dumpblocks 'numblocks'; stop proc/; end if (getresponse [Using whatever New Tech Search params are current. To stop, view and reset them click NO or CANCEL.]!=1) xmult:; proc/; end /* calculate true values */ set truelength 0; loop =pizza 1 nblocks cc].; ccode [ @#pizza . ; xmult; set truelength += length[0]; stop quote the sum of partition lengths is 'truelength' ; set critical 0; set thislength 0; cc[.; report -; sil = all; loop =itera 1 'maxiter' progress #itera 'maxiter' Randomizing blocks ... ; /* the following randomizes order of char nums in an array */ set chararray randomlist[ ('charnum'+1) ] ; /* calculate partitions of same size from random order*/ set thislength 0; loop =here 1 nblocks cc].; loop =where blockstart[#here] blockend[#here] cc [ 'chararray[#where]'; stop xmult; set thislength += length[0]; stop if ('thislength' > 'truelength') set critical ++; end stop set p = (1-('critical'/('maxiter'+1))); sil - all; report =; quote ; quote the sum of partition lengths is 'truelength' ; quote 'critical' random partitions out of 'maxiter' (+1 for the observed) with greater sum of lengths; quote so technically P = 'p' ; quote you can run a higher than 'maxiter' number of randomizations as an argument after ILD.RUN ; macro-; procedure/;