*! version 1.0 11-09-98 (STB-53: sg128) program define bhataplt version 5.0 *Last uptdate: 13-09-98 *This program calculate logaritmic differences and draw the Bhathacharya's *plot using the observation's numbers as plotting symbols in order to *define the points definning negatively sloped lines, which represent *individual gaussian components. *This routine is a new version integrating two previous simple programs *diflogen.ado and bhatplot.ado. * local varlist "req ex min(2) max(2)" local if "opt" local in "opt" #delimit ; local options "Gen(string) noGraph T1title(string) Symbol(string) Connect(string) *"; #delimit cr parse "`*'" parse "`varlist'", parse(" ") * *Logarithmic differences routine quietly { tempvar logfreq laglog diflog gen `logfreq'=log(`1') gen `laglog'=`logfreq'[_n+1] gen `diflog'=`laglog'-`logfreq' * *Bhathacharya´s plot routine *prelimanarly calculations tempvar touse gen byte `touse'=0 replace `touse'=1 `in' } * graphic routine if "`graph'" ~= "nograph" { if "`t1title'" ==""{ local t1title "Bhattacharya´s plot" } if "`symbol'"=="" { local symbol "[_n]" } if "`connect'"=="" { local connect "." } label var `diflog' "Logarithmic differences" graph `diflog' `2' if `touse', `options' /* */ t1("`t1title'") /* */ s(`symbol') c(`connect') } if "`gen'"~="" { rename `diflog' `gen' } end