$TR! $MACRO csl_! $ca %z9=sc__(2) $VAR %z9 B_ Z_! $sort Z_ 1 ph__! $ca l1__=%cu(1)! $CALC B_=0:B_(L1__)=spu_! :B_(PQ__(Z_))=B_(PQ__(Z_))+B_(Z_):B_=B_-1:B_(L1__)=B_(L1__)+1-spu_! :%z9=%cu(spu_)! :B_=B_/(%z9-1)! $ca %z9=(opt_(2)==1)! $swi %z9 oon_! $pri ::*text 'Using the default "Figure 2" method'! ' for node heights.'! $use oof_! $$endmac! $macro clv_! $ca %z9=sc__(2) $VAR %z9 B_! $ca %z9=(opt_(2)==1)! $swi %z9 oon_! $pri ::*text 'Using the taxonomic levels as node heights. '! 'The heights for each level are taken from the vector ' *name %1 '.'! $ca %z9=(opt_(13)/=1)! $swi %z9 oof_! $pri ::'The values of ' *name %1 ' are:':! $pri %1! $use oof_! $ca %z8=%z8+1! $ca %z9=0: %z9=%if((%cu(1)>%z9)&(d_>1.5),%cu(1),%z9)! $ca b_(ixx_)=%1(hst_(%cu(1)))/%1(hst_(%z9))! $$endmac! $arg clv_ %1! $macro cpl_! $ca %z9=sc__(2) $VAR %z9 B_! $ca %z9=0: %z9=%if((%cu(1)>%z9)&(d_>1.5),%cu(1),%z9)! $ca b_(ixx_)=%1(%cu(1))/%1(%z9)! $ca %z9=(opt_(2)==1)! $swi %z9 oon_! $pri ::'Individual node heights taken from the vector ' *name %1 '.'! $ca %z9=(opt_(13)/=1)! $swi %z9 oof_! $pri ::'The values of ' *name %1 ' are:':! $pri %1! $use oof_! $$endmac! $arg cpl_ %1! $macro tpr_! $ca %z9=sc__(2) $VAR %z9 N_ TI_ TIJ_ TUD_ Z_! $sort Z_ 1 ph__! $ca l1__=%cu(1)! $ca N_=B_**%z8! $ca N_(Z_)=N_(PQ__(Z_))+(Pt__(Z_)==0)-N_(Z_)! $ca N_(L1__)=N_(L1__)*spu_! :TI_=0:TUD_=0:TIJ_=0! :TI_(L1__)=0:TUD_=0! :TI_(PQ__(Z_)) =! 1/(TUD_(PQ__(Z_))=TUD_(PQ__(Z_))+1/(TIJ_(Z_)=TI_(Z_)+N_(Z_) ))! :wl__=1/TIJ_! $calc l3__=0:l3__(ph__)=l3__(ph__)+1/(tij_**2)! $calc l2__=%log(tij_)! $calc %z9=-%cu(%log(l3__))/2:%z8=-%cu(l2__)! $ca sc__(7)=(%z8+%z9)/2! $CALC L3__=0:L3__(PH__)=L3__(PH__)+wl__! $CALC WF__=wl__/L3__(PH__)! $DEL N_ TI_ TIJ_ TUD_ Z_! $ $ENDMAC! $MACRO ef1_! $CALC S_ =%if(opt_(1)==0,(V_==(%z1+1)),! %if(V_==opt_(1),opt_(1),(V_==(%z1+1))))! $CALC %%z1=S_ $CALC %z1=%z1-1! $ $ENDMAC! $MACRO exf_! $CALC %z1=0:%z1=%IF((%1>%z1)&(%1/=opt_(1)),%1,%z1):%z1=%z1-1! $ca %z9=sc__(1) $VAR %z9 S_ V_! $CA V_=%1! $ARG ef1_ #%2! $WHILE %z1 ef1_! $DEL S_ V_! $ $ENDMAC! $MACRO if1_! $CALC S_ =%if(opt_(1)==0,VV_*(V_==(%z1+1)),! %if(V_==opt_(1),opt_(1),VV_*(V_==(%z1+1))))! $CALC %%z1=S_ $CALC %z1=%z1-1! $ $ENDMAC! $MACRO ifc_! $CALC %z1=0:%z1=%IF((%1>%z1)&(%1/=opt_(1)),%1,%z1):%z1=%z1-1! $ca %z9=sc__(1) $VAR %z9 S_ VV_! $CA V_=%1! $ARG if1_ #%3! $ca VV_=%2! $WHILE %z1 if1_! $DEL S_ V_ VV_! $ $ENDMAC! $macro iff_! $ass fc1_=%1:fc2_=%2! $var 2 fl_! $CALC %z9=2:%z9=%IF((fc1_>%z9)&(fc1_/=opt_(1)),fc1_,%z9):fl_(1)=%z9! $CALC %z9=2:%z9=%IF((fc2_>%z9)&(fc2_/=opt_(1)),fc2_,%z9):fl_(2)=%z9! $ca %z9=(fl_(1)-1)*(fl_(2)-1)! $var %z9 fd1_ fd2_! $ca fd1_=1+%gl(fl_(1)-1,fl_(2)-1)! $ca fd2_=1+%gl(fl_(2)-1,1)! $VAR 1 SH__ $CALC SH__(1)=3.14159! $ca %z7=1:%z3=1! $arg if6_ shm_ shm_ shm_ shm_ shm_ shm_ shm_ shm_ shm_! $arg if6_ #%3! $while %z7 if6_! $del sh__ fc1_ fc2_ fl_ fd1_ fd2_! $$endmac! $macro if6_! $arg if7_ sh__ sh__ sh__ sh__ sh__ sh__ sh__ sh__ sh__! $arg if7_ #%%z7! $ca %z8=1! $while %z8 if7_! $ca %z7=%if(%z7<8.5,%z7+1,0)! $ $endmac! $macro if7_! $ca %%z8=0! $ca %z9=%cu(%%z8==%%z8)! $ca %z9=%if(%z9==1,! %if(%z8==1,2,1),! %if(%z8==9,1,0))! $ca %z8=%z8+1! $exit %z9! $ca %z8=%z8-1! $ca %%z8=(fc1_==fd1_(%z3))*(fc2_==fd2_(%z3)) +! ((fc1_==opt_(1))?(fc2_==opt_(1)))*opt_(1)! $ca %z3=%z3+1! $ca %z8=%z8+1! $$endmac! $MACRO GO_! $ca %z9=1-sc__(22)! $swi %z9 oof_! $pri :*text 'You may not USE GO_ while you are interrupting a previous GO_.'! ' If you have done no irreperable damage, reset everything as it was '! 'at the start of the interrupted GO_, and '! 'RETURN. Otherwise, it is '! 'probably best to restart the session.'! $ca %z9=sc__(22)! $exit %z9! $del sho_ npp_ np_ sh__ l1__ i1__ l2__ zo__ wsh_ pq__ pr__ pt__! $del b_ m1_ m2_ txp_ ph__ l3__ i3__ gr_ v5_ v3_ qrs_ wl__ wf__! $del spu_ inf_! $ca %z9=%cu(phy_):%z9=%cu(#yv_)! $pri #con_! $pri #tst_! $VAR 1 SH__ $CALC SH__(1)=3.14159! $ca spu_=spi_! $ca %z3=0! $ca %z2=1 $use cou_ #yv_ $arg cou_ %1! $ca %z6=0:%z5=2! $use ou__ CON_! $ca sc__(17)=%z3! $ca %z6=0:%z5=2! $use ou__ TST_! $ca sc__(18)=%z3! $ca sc__(17)=%z3-sc__(17)! $ca %z9=(opt_(3)/=0)! $swi %z9 oon_! $ca %z9=%cu(spi_==spi_)! $pri :: 'Numbers of species:'! $pri ' Total: '*i %z9,5,1! $ca %z8=%cu(spi_):%z9=%z9-%z8! $pri : ' Omitted by spi_: '*i %z9,5,1! $ca %z9=%cu(spi_-spu_):%z8=%cu(spu_)! $pri ' Omitted for missing values: '*i %z9,5,1! $pri ' Included in analysis: '*i %z8,5,1! $use oof_! $use uw__! $CA SC__(1)=%cu(#yv_==#yv_) :SC__(2)=%cu(txp_==txp_)! $ca sc__(19)=%cu(phy_==phy_)! $ca SC__(3)=sc__(2)-sc__(1)+1! $ca sc__(11)=%cu(spu_):%z9=sc__(1)-sc__(11):sc__(12)=sc__(2)-%z9! $CA %Z9=SC__(1) $VAR %Z9 L1__ I1__! $CA %Z9=SC__(2) $VAR %Z9 L2__ zo__ wsh_ $UNITS %Z9 $CA zo__=0! $CA PQ__=txp_*(txp_/=(SC__(2)+1)):PR__=txp_-(txp_==(SC__(2)+1))! $ca l1__=%cu(1)! $ca pt__=pq__:pt__(l1__)=%if(spu_==1,pq__(l1__),-1)! $CALC %z9=%if(txp_==0,%z9,txp_):%z9=%IF((%z9= %sc*sc__(20))?! (qrs_*%sqrt(wl__) <= -%sc*sc__(20))! $ca wsh_=(%cu(1)<=sc__(3))&qrt_! $ca sc__(13)=%cu(wsh_)! $ca L3__=0:L3__(PH__)=L3__(PH__)+qrs_*qrs_*wl__:L3__=%sqrt(L3__)! :qrs_=qrs_*wl__/L3__(PH__)! $ca %z9=sc__(3)-sc__(13)! $while %z9 rom_! $del qrt_! $$endmac! $mac rom_! $use oon_! $ca l3__=(1-wsh_(%cu(1)))! $ca %z9=%cu(l3__) $var %z9 omi_! $ca omi_(l3__*%cu(l3__))=on_(sc__(1)+%cu(1))! $pri: 'PHYLOGENETIC DEGREES OF FREEDOM IN THE DENOMINATOR'! $ca %z9=1+(%z9/=1)! $swi %z9 oon_ oof_! $pri : *text 'One node was omitted as lacking a phylogenetic degree'! ' of freedom. The number of that higher node is: ' *i omi_! $ca %z9=%cu(omi_==omi_):%z9=1+(%z9/=1)! $swi %z9 oof_ oon_! $ca %z9=%cu(omi_==omi_)! $pri :*i %z9 *text ' nodes were omitted as lacking a phylogenetic degree'! ' of freedom. The numbers of those higher nodes are: '! $pri :*i omi_,6 ::! $use oof_! $del omi_! $ca %z9=0! $$endmac! $mac shr_! $ca L3__=0:L3__(PH__)=L3__(PH__)+qrs_*%%z2! $ca %%z2(i3__)=L3__! $$endmac! $mac ou__! $arg in__ shm_ shm_ shm_ shm_ shm_ shm_ shm_ shm_ shm_! $arg in__ #%1! $ca %z1=1! $while %z1 in__! $$endmac! $mac in__! $arg wk__ SH__ SH__ SH__ SH__ SH__ SH__ SH__ SH__ SH__! $use wk__ #%%z1! $ca %z2=(%z2==1)! $exit %z2! $arg wk2_ zo__ zo__ zo__ zo__ zo__ zo__ zo__ zo__ zo__! $use wk2_ #%%z1! $ca %z1=%if(%z1/=9,%z1+1,0)! $$endmac! $mac wk__! $ca %z2=1! $while %z2 und_! $$endmac! $mac und_! $ca %z9=%cu(%%z2==%%z2) :%z9=(%z9==1)! $exit %z9! $swi %z5 cou_ cou_ psh_ shr_ pll_ ext_ ext_ ext_ cmb_! $ca %z2=%if(%z2/=9,%z2+1,0)! $$endmac! $arg und_ %1 %2 %3 %4 %5 %6 %7 %8 %9! $mac wk2_! $swi %z6 vnd_! $$endmac! $mac shm_ SH__ $endmac! $mac ft1_! $ca l3__=0 $ass i3__=L3__ $ca i3__=%cu(1)! $ca L2__=0! $ca i1__=%cu(1)! $calc L2__=%cu(1)! $ca %z9=SC__(1)! $ca %z9=%z9*sc__(18)! $var %z9 sto_! $ca %z3=0! $ca i3__=%cu(1)! $ca %z2=1 $use psh_ #yv_ $arg psh_ %1! $ca %z6=0:%z5=3! $use ou__ CON_! $ca %z6=0:%z5=3! $use ou__ TST_! $use fnd_! $ca i3__=%cu(1)! $ca %z3=0! $ca %z2=1 $use pll_ #yv_ $arg pll_ %1! $ca %z6=0:%z5=5! $use ou__ CON_! $use ou__ TST_! $del sto_ ZE__ ZF__! $$endmac! $mac ft2_! $ca %z9=(gr_(5+%z4)/=79)! $ca %z4=%z4+1:%z7=(%z4<5.5)! $skip %z9! $ca %z4=%z4-1:%z7=(%z4<5.5)! $ass i3__=L3__ $ca i3__=%cu(1)! $calc %z8=gr_(%3) $use tpr_! $ca %z2=1:%z3=0 $use ext_ #yv_ $arg ext_ %1! $ca %z9=sc__(2) $units %z9 $yva #yv_! $weig wl__! $fit zo__-1! $ca %z6=1:%z5=6! $use ou__ CON_! $ca %z6=0! $use ou__ TST_! $ca %z9=sc__(7)-(sc__(12)-sc__(3))*%log(%dv)/2! $ca gr_(5+%z4)=%z9! $ca %z9=sc__(7)! $ca %z9=(sc__(12)-sc__(3))*%log(%dv)/2! $ca %z4=%z4+1 :%z7=(%z4<5.5)! $$endmac! $mac ft3_! $ca %z9=(gr_(5+%z4)/=79)! $ca %z4=%z4+1:%z7=(%z4<5.5)! $skip %z9! $ca %z4=%z4-1:%z7=(%z4<5.5)! $ass i3__=L3__ $ca i3__=%cu(1)! $calc %z8=gr_(%3) $use tpr_! $ca sc__(26)=1! $ca %z9=sc__(26)! $swi %z9 oon_! $pri ::! $use oof_! $ca %z2=1:%z3=0 $use ext_ #yv_ $arg ext_ %1! $ca sc__(21)=l3__! $ca %z9=sc__(2) $units %z9 $yva #yv_! $weig wl__! $ca %z9=8 $var %z9 ZE__! $fit zo__-1! $ca ze__(8)=%df! $ca %z6=1:%z5=6! $use ou__ CON_! $ca %z6=1! $ca ZE__(1)=%dv:ZE__(2)=%df! $use ou__ TST_! $ca %z9=sc__(26)! $swi %z9 oon_! $pri ::! $use oof_! $ca sc__(26)=0! $ca %z9=(opt_(6)==1)! $swi %z9 oon_! $pri :: *text 'Below are the parameter estimates from the long regression on '! 'control and test variables. Their standard errors cannot be'! ' trusted. These are good quick approximations to the best estimates'! ' for the test variables. The deviance is also given: the "changes"'! ' should be ignored.'! $pri! $disp ed! $use oof_! $ca %z8=2! $ca %z9=(opt_(22)==1)! $swi %z9 upt_! $ca ZE__(3)=%dv:ZE__(4)=%df! $ca ZE__(5)=ZE__(1)-ZE__(3)! $ca ZE__(6)=ZE__(2)-ZE__(4)! $ca ZE__(7)=((ZE__(5)/ZE__(6)))! /((ZE__(3)/(ZE__(4)-sc__(10))))! $fit zo__-1! $ca %z6=1:%z5=0! $use ou__ CON_! $ca %z9=(opt_(5)==1)! $swi %z9 oon_! $pri :: *text 'Below are the parameter estimates from the long regression on '! 'control variables only. Their standard errors cannot be'! ' trusted.'! ' The deviance is also given: the "changes" should be ignored.'! $pri! $disp ed! $use oof_! $ca %z8=1! $ca %z9=(opt_(21)==1)! $swi %z9 upt_! $ca %z9=sc__(7)-(sc__(12)-sc__(3))*%log(%dv)/2! $ca gr_(5+%z4)=%z9! $ca %z9=sc__(7)! $ca %z9=(sc__(12)-sc__(3))*%log(%dv)/2! $ca %z9=7 $var %z9 ZF__! $use MQ__! $ca %z2=1 $use shr_ %yv! $arg shr_ %1! $weight wsh_! $fit zo__-1! $ca %z6=1:%z5=4! $use ou__ CON_! $CA RCO_=(%YV-%FV)/%sqrt(%df-sc__(10))! $ca ZF__(1)=%dv:ZF__(2)=%df! $ca %z9=(opt_(7)==1)! $swi %z9 oon_! $pri :: *text 'Below are the parameter estimates from the short '! 'regression on control variables only.'! ' Their standard errors cannot be'! ' trusted.'! ' The deviance is also given: the "changes" should be ignored.'! $pri! $disp ed! $use oof_! $ca %z8=3! $ca %z9=(opt_(23)==1)! $swi %z9 upt_! $ca %z6=1:%z5=4! $use ou__ TST_! $CA RCT_=(%YV-%FV)/%sqrt(%df-sc__(10))! $ca dr_=RCO_*RCO_-RCT_*RCT_! $ca ZF__(3)=%dv:ZF__(4)=%df! $ca ZF__(5)=ZF__(1)-ZF__(3)! $ca ZF__(6)=ZF__(2)-ZF__(4)! $ca ZF__(7)=((ZF__(5)/ZF__(6)))! /((ZF__(3)/(ZF__(4)-sc__(10))))! $ca %z9=(opt_(8)==1)! $swi %z9 oon_! $pri :: *text 'Below are the parameter estimates from the short '! 'regression on control and test variables. '! 'Neither the parameter estimates '! 'nor their standard errors can be'! ' trusted.'! ' The deviance is also given: the "changes" should be ignored.'! $pri! $disp ed! $use oof_! $ca %z9=(opt_(9)==1)&(opt_(12)==1)! $swi %z9 oon_! $pri /! $ca %z9=(opt_(9)==1)! $swi %z9 oon_! $pri ::*text 'In the following plot, on the '! 'x-axis is RCT_, which is proportional to '! 'the residuals in the short regression '! 'with control and test variables. '! 'On the y-axis is DR_, '! 'the net difference in squared residuals in the short'! ' regression'! ' between before and after addition of the test '! 'variables, allowing for the change in residual degrees'! ' of freedom. Points badly fitted by control and test'! ' variables have extreme x-values. Influential points '! 'in contributing to'! ' significance have high y-values.'! $pri ::! $ca %re=wsh_ $plot DR_ RCT_! $del %re! $ca %z9=1-(opt_(10)==1)! $swi %z9 oof_! $ca %z9=sc__(3)! $pri :: *text 'The values displayed below are from the short regression.'! ' L3__ is the name of the higher node as given by WHO_. '! 'WSH_=1 for higher nodes '! 'included in the short regression. WSH_=0 for each node that'! ' is excluded because it lacks a phylogenetic degree'! ' of freedom. RCT_ and DR_ are the x and y variables on'! ' the plot just given. INF_ is an influence measure.'! ' RCO_ is proportional to '! 'the residual in the short regression on the '! 'control variables only.'! $ca l3__=on_(%cu(1)+sc__(1))! $ca inf_=RCO_*RCO_-RCT_*RCT_! $ca inf_=%if(inf_>0,inf_,-inf_)! $ca inf_=inf_*wsh_! $ca %z8=inf_(1):%z8=%if(%z8>inf_,%z8,inf_)! $ca inf_=%tr(100.1*(RCO_*RCO_-RCT_*RCT_)/%z8)! $pri! $loo 1 %z9 l3__ wsh_ RCO_ RCT_ dr_ inf_! $use oof_! $ca %z8=4! $ca %z9=(opt_(24)==1)! $swi %z9 upt_! $ca %z4=%z4+1 :%z7=(%z4<5.5)! $del RCO_ RCT_ dr_! $$endmac! $macro fnd_! $use oof_! $var 5 v5_ $var 3 v3_! $ca %z4=1:%z7=1! $ca gr_(1)=sc__(24):gr_(5)=sc__(25)! $ca gr_(3)=%sqrt(gr_(1)*gr_(5)):gr_(2)=%sqrt(gr_(1)*gr_(3))! $ca gr_(4)=%sqrt(gr_(3)*gr_(5))! $ca gr_(6)=gr_(7)=gr_(8)=gr_(9)=gr_(10)=79! $arg ft2_ * * %z4! $arg ft3_ * * %z4! $ca %z7=%z7*(opt_(17)==0)! $while %z7 uft_! $ca %z9=(opt_(4)==1)*(opt_(17)==0)! $swi %z9 oon_! $ca %z9=gr_(3) $pri ;;;'Likelihood maximised by rho = ' %z9! $ca %z9=gr_(8) $pri 'Value of log-likelihood at maximum = ' %z9! $ca gr_(6)=gr_(7)=gr_(9)=gr_(10)=-1:gr_(8)=79! $use oof_! $ca gr_(3)=%if(opt_(17)==0,gr_(3),opt_(17))! $ca %z7=1:%z4=1 $while %z7 ft3_! $ca %z9=(opt_(4)==1)*(opt_(17)/=0)! $swi %z9 oon_! $ca %z9=gr_(3) $pri ;;;'Rho fixed at ' %z9! $ca %z9=gr_(8) $pri 'Value of log-likelihood = ' %z9! $use oof_! $ca %z8=(ZE__(6)-ZF__(6))! $ca %z9=(%z8/=0)! $swi %z9 oon_! $pri ::'PHYLOGENETIC DEGREES OF FREEDOM IN THE NUMERATOR' :! $ca %z9=(%z8>=2)! $swi %z9 oof_! $pri 'One degree of freedom was lost in the numerator':! $ca %z9=(1+(%z8==1))*(%z8>=1)! $swi %z9 oon_ oof_! $pri *i %z8 ' degrees of freedom were lost in the numerator':! $use oof_! $ca %z9=(opt_(14)==1)! $swi %z9 oon_! $ca %z9=sc__(19)+1-sc__(1)! $pri ;;;'Numbers of higher nodes:'! $pri ' Total: ' *i %z9,5,1! $ca %z9=1+sc__(19)-sc__(1)-sc__(3)! $pri! $pri ' Lost through omitted species: ' *i %z9,5,1! $ca %z9=sc__(3)-sc__(13)! $pri ' Lost through lack of variability: ' *i %z9,5,1! $ca %z9=sc__(13)! $pri ' Remainder as total degrees of freedom for short regression: ' *i %z9,5,1! $use oof_! $ca %z9=(opt_(15)==1)! $swi %z9 oon_! $pri ;;; *text ' BREAKDOWN OF DEGREES OF FREEDOM IN THE SHORT REGRESSION'::! $ca %z9=ze__(8)-ze__(2)! $pri 'Control variables. In long regression: ' *i %z9,5,1! $ca %z9=%z9-sc__(13)+zf__(6)+zf__(4)! $pri ' Lost for phylogenetic reasons: ' *i %z9,5,1! $ca %z9=sc__(13)-zf__(6)-zf__(4)! $pri ' Net, by subtraction: ' *i %z9,5,1! $pri! $ca %z9=ze__(6)! $pri 'Test variables. In long regression: ' *i %z9,5,1! $ca %z9=ze__(6)-zf__(6)! $pri ' Lost for phylogenetic reasons: ' *i %z9,5,1! $ca %z9=zf__(6)! $pri ' Net, by subtraction: ' *i %z9,5,1! $pri! $pri *text 'Hence, the total degrees of freedom break down '! 'as follows: '! $ca %z9=sc__(13)! $pri ' Total: ' *i %z9,5,1! $ca %z9=sc__(13)-zf__(6)-zf__(4)! $pri ' Control: ' *i %z9,5,1! $ca %z9=sc__(10)! $pri ' Additional fitted parameters (e.g. rho): ' *i %z9,5,1! $ca %z9=zf__(6)! $pri ' Test: ' *i %z9,5,1! $ca %z9=zf__(4)-sc__(10)! $pri ' Residual, by subtraction: ' *i %z9,5,1! $pri ; *text 'The last two numbers are the numerator and denominator '! 'degrees of freedom in the F-test of the short regression.'! $use oof_! $ca %z9=opt_(11)! $swi %z9 oon_! $pri ::::! $pri ' y-variable: ' yv_! $pri 'Controlling for: ' #CON_! $pri ' Testing for: ' #TST_! $ca %z9=ZF__(7) $pri: 'F = ' *6 *r %z9! $ca %z9=ZF__(6):%z8=ZF__(4)-sc__(10)! $pri ' '*i %z9',' *i %z8 ;! $use oof_! $$endmac! $macro uft_! $ca %z4=1! $while %z7 ft2_! $ca v5_=5+%cu(1)! $ca %z7=1:%z7=%if(gr_(v5_)>gr_(5+%z7),%cu(1),%z7)! $ca %z9=((%z7==1)?(%z7==5))! $while %z9 cr__! $ca %z1=gr_(%z7+1)-gr_(%z7)! $ca sc__(9)=%z1! $ca %z9=(%z1hst_,%z9,hst_): %z9=%z9+1! $ass hst_=hst_,%z9! $ca sc__(16)=%z9! $use uw2_! $ass phy_=tt_! $del tt_ sh__ zo__! $$endmac! $macro cmb_! $ca %z9=%%z2(1): %z9=%if(%z9>%%z2,%z9,%%z2)! $ca %z8=%cu(%%z2/=%cu(1)) $ca %z8=(%z8>0)! $ca %%z2=(%z9+1)*ot_*%z8 + %%z2 $group %%z2! $ca %z9=%%z2(1):%z9=%if(%z9>%%z2,%z9,%%z2)! $var %z9 tp__! $ca %z8=sto_(1) :%z8=%if(%z8ot_,%z9,ot_)! $ca %z9= %z8 - %z9 - 1! $ca tp__(%%z2)=%z9+ot_! $ass htp_=tp__ $ca htp_=%z7! $ass sto_=tp__,sto_! $ass hst_=htp_,hst_! $del tp__ htp_! $ca ot_=%%z2:%z7=%z7+1! $$endmac! $arg cmb_ %1 %2 %3 %4 %5 %6 %7 %8 %9! $macro uw2_! $ass s_=phy_ $ca %z9=%cu(phy_==phy_):%z9=%z9+1! $ca %z8=%cu(phy_==%z9)! $var %z9 tp__ $ca tp__=0:tp__(phy_)=tp__(phy_)+1! $ca s_=tp__(phy_)! $ass s_=s_,%z8! $ass i_=phy_ $ca i_=%z9-%cu(1)! $ca tp2_=phy_! $ca tp2_(i_)=(s_(i_)/=1)*tp2_(i_) + (s_(i_)==1)*! (%if(tp2_(i_)/=%z9,tp2_(tp2_(i_)-(tp2_(i_)==%z9)),0))! $ca tp__=0:tp__(tp2_)=tp__(tp2_)+1! $ass i_=tp2_ $ca i_=%cu(1)! $ca %z9=%cu(phy_==phy_) $var %z9 spc_! $ca %z9=phy_(1) :%z9=%if(%z91.5)?spc_)*tp2_! $ca %z9=%cu(tp2_/=0) $del tt_ $var %z9 tt_! $ca ix_=(tp2_/=0)! $ca tt_(ix_*%cu(ix_))=tp2_! $ass nst_=tt_,1! $ca nst_(ix_*%cu(ix_))=hst_(%cu(1))! $ca %z8=%cu(nst_==nst_):%z9=%cu(hst_==hst_)! $ca nst_(%z8)=hst_(%z9)! $ass hst_=nst_! $ca %z9=phy_(1):%z9=%if(%z9phy_,phy_,%z8):%z8=%z8-0.5! $ca spc_=(%cu(1)<%z8)! $ca %z9=%z9+1 $var %z9 d_ $ca d_=0! $ca d_(%cu(1))=(spn_&spc_):d_(phy_)=d_(phy_)+d_(%cu(1))! $ca %z8=%cu(phy_==%z9)! $var %z9 tp__ $ca tp__=0:tp__(phy_)=tp__(phy_)+(d_(%cu(1))>0.5)! $ca s_=tp__(phy_)*(d_(%cu(1))>0.5)! $ass s_=s_,1! $ass i_=phy_! $ca i_=%z9-%cu(1)! $ca tp2_=phy_! $ca tp2_(i_)=(s_(i_)/=1)*tp2_(i_) + (s_(i_)==1)*! (%if(tp2_(i_)/=%z9,tp2_(tp2_(i_)-(tp2_(i_)==%z9)),-1))! $ca i_=%cu(1)! $ca tp2_=((tp__(i_)>1.5)?spc_)*tp2_! $ca tp2_((phy_*(s_(i_)==1)*(phy_/=%z9)))=0! $ca ix_=((tp2_>0.5)?spc_)! $ca %z8=%cu(ix_) $var %z8 txp_! $ca ixx_=ix_*%cu(ix_)! $ca txp_(ixx_)=ixx_(tp2_*(tp2_/=%z9)*(tp2_/=-1))! $ca txp_=%if(txp_==0,(%z8+1)*(spn_(%cu(1))),txp_) :! $ca txp_(%cu(1))=txp_(%cu(1))*spu_! $del tp__ ix_ tp2_ i_ spn_ spc_! $ass on_=txp_! $ca %z9=0: %z9=%if((%cu(1)>%z9)&(s_>1.5),%cu(1),%z9)! $ca on_(ixx_)=%cu(1)! $ca %z9=%z9+1! $ass on_=on_,%z9! $del s_! $$endmac! $macro who_! $ca %z9=phy_(1):%z9=%if(%z9