Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Formatting and variable problem

From   Fred Wolfe <>
Subject   st: Formatting and variable problem
Date   Wed, 03 Jul 2002 07:24:57 -0500

I have a program which does various calculation and then ends with the following line:

di as text "{ralign `startcol' : `outname'}" " {c |}" as result "{ralign 9: `N' `mean' `sd' `se' `median' `min' `max' `lci' `uci'}"

If any of the macros are empty (`N' `mean' `sd' `se' `median' `min' `max' `lci' `uci'), as would often be expected, then no result for the missing macro is displayed. However, each missing macro uses exactly 1 character space. Therefore the output is not uniform as to spacing, and it is hard to line up titles above the output.

Solutions that have been tried are putting -`N' `mean' `sd' `se' `median' `min' `max' `lci' `uci'- into a macro or string of its own, where it can be operated on. Doesn't work, Stata doesn't allow.

Is there anyway to make Stata not take 1 character for empty macros? Does anyone have an alternative solution for displaying the data uniformly"


Fred Wolfe

---------------------------------------------------------------------------- ------------------------
Fred Wolfe Tel (316) 263-2125
National Data Bank for Rheumatic Diseases Fax (316) 263-0761
Wichita, Kansas
---------------------------------------------------------------------------- -------------------------
* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index