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

st: A strange data problem


From   "Maoyong Fan" <[email protected]>
To   "statalist" <[email protected]>
Subject   st: A strange data problem
Date   Sat, 15 Jan 2005 22:07:55 -0800

Dear Stata User,

	I met a strange problem in dealing with my scanner data.  I use stata transfer to transger the original data to dta files.  One of my variables is UPC whose storage type is double.  I found that when I generate a new variable equal to UPC, the new variable is totally different from UPC.

Like this:
gen UPC1 = UPC
gen diff = UPC1 - UPC
sum
des

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
         UPC |   1780770    3.76e+10    1.96e+11   1.00e+10   2.72e+12
        UPC1 |   1780770    3.76e+10    1.96e+11   1.00e+10   2.72e+12
        diff |   1780770    144.9445    4290.722    -105114     116086

. des

Contains data from D:\temp\dairyHH1.dta
  obs:     1,780,770
 vars:             3                          18 Jun 2003 13:27
 size:    35,615,400 (66.0% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
UPC             double %15.0g                 UPC -
                                                system/generation/vendor/item
UPC1            float  %9.0g
diff            float  %9.0g
-------------------------------------------------------------------------------
Sorted by:
     Note:  dataset has changed since last saved

Anyone know what's wrong with this?

Warm regards,

Maoyong Fan



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