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

Re: st: display format


From   Roger Newson <[email protected]>
To   [email protected]
Subject   Re: st: display format
Date   Thu, 23 Jan 2003 14:53:41 +0000

At 20:47 22/01/03 -0600, Jun Xu wrote:
Dear stata listers:

One question about the display format.  I was trying to have a covariance
matrix:
*************************************************************
. corr  popden hsnggrow rent, cov
(obs=50)

            |   popden hsnggrow     rent
-------------+---------------------------
     popden |  4.9e+06
   hsnggrow | -17692.8  372.679
       rent |  14278.8  329.134  1249.86


*************************************************************
What I really like to see is specifying out exactly what var(popden) equal
to such as 4912345.2 instead of 4.9e+06.  How can I control the numeric
format in tables (output) like this (as well as decimal points)?  I tried to
change the format of popden (using format), but not working.  ANy input?
Really appreciate.
The -correlate- command stores the covariance between the first and second variables in the returned scalars r(cov_12). You might therefore type

corr popden hsnggrow,cov
display %8.2f r(cov_12)
corr popden rent,cov
display %8.2f r(cov_12)
corr hsnggrow rent,cov
display %8.2f r(cov_12)

and Stata will display all 3 correlations to 2 decimal places. You can, of course, choose more decimal places than 2 by specifying a different format.

To find more about the -display- command, type -help display-. To find more about the -correlate- command, type -help correlate-. To find more about returned results, type -help return-. These on-line helps will refer you to the manuals, which usually give a list of all returned results for all programs.

In the case of estimation commands (eg -regress-), you can get the results printed in a format of your choice using the -parmest- package, downloadable from SSC. Type -ssc describe parmest- to find out more.

I hope this helps.

Roger


--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]

Opinions expressed are those of the author, not the institution.

*
* 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/




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