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

st: -outsheet- outputs display rather than true values


From   "Deborah Garvey" <DGarvey@scu.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: -outsheet- outputs display rather than true values
Date   Fri, 20 Aug 2004 16:47:37 -0700

Hi, listers.

I used -outsheet- to output a couple of variables from a Stata dataset
to a raw datafile for manipulation in Excel.  The variable "tbase" is
stored in the Stata dataset as:

tbase           float  %9.0g                  SD Tax Base 1981-82 (OR)

and ranges in value from 0 to 36535420 (plus missing).

In the source dataset, tbase is displayed in scientific notation for
large values (above 10m):

id                   tbase
385002006   1.33e+07 
385003041   1.46e+07 
385015015   1.41e+07 
385020019   3.65e+07 
385020046   1.69e+07 
385026018   9.24e+07 
385034005   4.68e+07 
385034045   1.41e+07 

Strangely, these formatted display values, rather than the true data
values, were output to the tab-delimited ASCII file "ortbase":

outsheet sd_id sd_name tbase tbpassyr using ortbase

and the values were inappropriately rounded:

e.g.,
385002006   13300000  (true: 13250000)
385003041   14600000  (true: 14619224)

If I format tbase  to %12.0g before -outsheet-ing, the problem
disappears. 

Why should the display format matter for -outsheet-?  

Thanks for any help you can offer,

Deborah

******************************
Deborah Garvey, Ph.D.
Department of Economics
Kenna Hall
Santa Clara University
Santa Clara, CA  95053
408/554-5580
408/554-2331 (FAX)
dgarvey@scu.edu    
http://lsb.scu.edu/~dgarvey
**********************************

This message scanned for viruses and SPAM by GWGuardian at SCU (MGW2).
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index