Scott,
> sysuse auto,clear
> qui {
> reg price disp length
> betacoef
> matrix A = r(beta)
>
> gen b_disp = A[1,1]
> gen b_length = A[1,2]
> scalar t_disp = _b[disp] / _se[disp]
> scalar t_length = _b[length] / _se[length]
>
> if abs(t_disp) > 1.96 {
> local bar1 "1, bfcolor(red) blcolor(red)"
> }
> else {
> local bar1 "1, bfcolor(blue) blcolor(blue)"
> }
> if abs(t_length) > 1.96 {
> local bar2 "2, bfcolor(red) blcolor(red)"
> }
> else {
> local bar2 "2, bfcolor(blue) blcolor(blue)"
> }
> }
> graph hbar (mean) b_* , outergap(100) bargap(250) ///
> bar(`bar1') bar(`bar2') ytitle("Beta Coefficients") ///
> blabel(bar, position(outside))
For me, this code is a definite improvement on before. It produces some
very effective -hbar- graphs and act as an aid to presenting regressions
in a more accessible way. Thanks for this.
CLIVE NICHOLAS |t: 0(044)191 222 5969
Politics |e: [email protected]
Newcastle University |http://www.ncl.ac.uk/geps
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/