* Draw dominance-diversity curve program define domdiver version 2.1 capture drop h_1 mac def _varlist "req ex " mac def _if "optional" mac def _options "*" parse "%_*" parse "%_varlist", parse(" ") macro define a "l1(Abundance [Log Scale])" macro define b "b2(Species Rank)" macro define c "b1(Dominance-Diversity Curve)" mac def x "jk" mac def y "jk" capture confirm number %x capture confirm number %y quietly{ gen h_1=-%_1 sort h_1 replace h_1=_n } mac def n=1 while %_1[%n+1]~=. { mac def n=%n+1 } di " " di " DOMDIVER draws a dominance-diversity curve." di " " di "To control scale of the X-axis, enter a maximum value (must be >" %n ")" di " OR Press to let STATA select X-axis scale." di "Enter X-axis maximum (or press )..." _r(x) di " " di "To control scale of the Y-axis, enter a maximum value (>" %_1[1] ")" di " OR Press to let STATA select Y-axis scale." di "Enter Y-axis maximum (or press )..." _r(y) if "%x"=="" {mac def x=%n } if "%y"=="" {mac def y =%_1[1] } di " " di "Enter a title to label this graph," di " OR press to use " in red " %_1 " in white " as a label." di "Title..." _r(xn) di " " if "%xn"=="" {mac def xn "%_1"} mac def xn "t2(%xn)" gr %_1 h_1, c(l) xscale(1,%x) yscale(1,%y) ylog ylab xlab %a %b %c %xn %_options if "%_options"=="" { di " " di " To print this graph, run domdiver again specifying a filename," di " e.g., domdiver %_1, saving(jt6)"} drop h_1 end