Statalist


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

Re: st: Data Corruption?


From   wgould@stata.com (William Gould, StataCorp LP)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Data Corruption?
Date   Thu, 25 Oct 2007 11:28:57 -0500

Yesterday Ed Blackburne <blackburne@shsu.edu> reported some odd results that
suggested data corruption in Stata.  That problem is resolved.  The data were
not corrupted.

The point of this posting is not to embarrass Ed, but to reassure anyone 
who was worried.

It was human error, but certainly an unexpected one.  The problem was that
Ed was using labels, so the listed data looked different from how they 
actually were.  Here's the idea:

Say I have the following dataset:

        . list

             +---+
             | a |
             |---|
          1. | 1 |
          2. | 2 |
             +---+

Now say I do the following: 

        . label define mylab 1 1000 2 2000

        . label values a mylab 

With that done, here is what I see whan I list the data:

. list

             +------+
             |    a |
             |------|
          1. | 1000 |
          2. | 2000 |
             +------+

So now I type 

        . gen new = a*10

        . list
             +------------+
             |    a   new |
             |------------|
          1. | 1000    10 |
          2. | 2000    20 |
             +------------+

and it looks to me as if Stata is broken or the data are corrupted or, 
at the very least, as if Stata doesn't know how to multiply.

I don't know the exact details in Ed's case, but I gather than Ed infile'd his
data using the automatic label generation option, and so the looked fine to
him, but it fact contained 1, 2, ... 

-- Bill
wgould@stata.com
*
*   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