I am trying to write a loop to format my regression coefficients and
p-values so that I have 2 significant figures for my p-values and a
reasonable format for the betas (these span considerably different
scales...). I want to do it in a loop as I have hundreds of these
coefficients and p-values.
I was thinking of some loop as follows, but foreach doesn't seem
appropriate here...
Any clues would be of great help!
foreach num of numlist 1.367456 0.0000925 0.5623 13.5678 {
if `num' < 0 { /* store number in macro as string rounded to two
significant figures */
}
if `num' > 1 { /* store number in macro as string rounded to two
decimal places */
}
}
I use Stata 10 btw.
Many thanks!
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/