Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: possible bug in outsheet?


From   Adrian Mander <[email protected]>
To   [email protected]
Subject   st: possible bug in outsheet?
Date   Mon, 16 Apr 2007 11:13:11 +0100

Is outsheet meant to recast a variable?
See output below.

I think outsheet is looking at the number type of the first cell and in this
case decides that this variable is an integer and hence is truncating values.

Personally I think Stata should be picking up the format from the variable because
this behaviour is a little unsound.

cheers
Ade



. d falc825

storage display value
variable name type format label variable label
-------------------------------------------------------------------------------
falc825 float %2.0f Other alcoholic beverages 5 day
1982

. su

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
falc825 | 100 6.458667 27.12486 0 185.6

. outsheet using ade.csv,comma replace

. insheet using ade.csv,clear
(1 var, 100 obs)

. su

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
falc825 | 100 6.47 27.17227 0 186

. d

Contains data
obs: 100
vars: 1
size: 600 (99.9% of memory free)
-------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-------------------------------------------------------------------------------
falc825 int %8.0g
-------------------------------------------------------------------------------
Sorted by:
Note: dataset has changed since last saved


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