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" <[email protected]>
To   <[email protected]>
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:

385002006   13300000  (true: 13250000)
385003041   14600000  (true: 14619224)

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

Why should the display format matter for -outsheet-?  

Thanks for any help you can offer,


Deborah Garvey, Ph.D.
Department of Economics
Kenna Hall
Santa Clara University
Santa Clara, CA  95053
408/554-2331 (FAX)
[email protected]

This message scanned for viruses and SPAM by GWGuardian at SCU (MGW2).
*   For searches and help try:

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