Statalist The Stata Listserver


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

st: RE: RE: missing values nightmare?


From   "Diego Bassani" <Diego_Bassani@camh.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: missing values nightmare?
Date   Tue, 3 Oct 2006 19:00:43 -0400

Thank you very much. I assumed missing values were a separate entity... not positive infinity. Good to learn this. And better late than never.
D

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Peter J. Burke
Sent: October 3, 2006 6:53 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: missing values nightmare?


Diego,
	See FAQ on this http://www.stata.com/support/faqs/data/values.html
Peter 


Peter J. Burke
Professor
Department of Sociology
University of California
Riverside, CA 92521-0419
Phone: 951/827-7004
Fax: 951/827-3330
peter.burke@ucr.edu 
http://wat2146.ucr.edu


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Diego Bassani
Sent: Tuesday, October 03, 2006 3:47 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: missing values nightmare?

I had no clue this could happen and I am horrified it does...

When I write a simple line in stata 9.0

recode x 0=1 if z>2

I get all values of x that equal 0 recoded into 1 when z equals . or .a or
.b

this means Stata understands missing values as large numbers... 

I have tried a couple of times and it consistently recodes considering
missing values as larger than life numbers 

see the example of the dataset

var1	var2	var3	var4
1	0	1	0
1	0	1	0
1	0	1	0
10	0	1	0
10	0	1	0
10	0	1	0
100	0	1	0
100	0	1	0
100	0	1	0
1000	0	1	0
1000	0	1	0
1000	0	1	0
.	0	1	0
.	0	1	0
.	0	1	0
.	0	1	0
.	0	1	0
.	0	1	0
.	0	1	0
.	0	1	0


after running the following line, which should recode only 9 values, what I
get is the dataset below.

recode var2 0=1 if var1>1

var1	var2	var3	var4
1	0	1	0
1	0	1	0
1	0	1	0
10	1	1	0
10	1	1	0
10	1	1	0
100	1	1	0
100	1	1	0
100	1	1	0
1000	1	1	0
1000	1	1	0
1000	1	1	0
.	1	1	0
.	1	1	0
.	1	1	0
.	1	1	0
.	1	1	0
.	1	1	0
.	1	1	0
.	1	1	0

Is it possible that no one noticed this? And if yes, why did stata not fix
it yet?

The way around it was tricking the system by recoding the missing values
into some very small or negative value, temporarily, so we can make the
transformations without the giant missing value bug playing its tricks...

I am astonished.

Diego

Diego G. Bassani, M.Sc., Ph.D. 
Epidemiologist - Post-Doctoral Fellow
Centre for Addiction and Mental Health 
Health Systems Research & Consulting Unit 
33 Russell Street, Tower - T308
Toronto, ON - M5S 2S1 
diego_bassani@camh.net 
http://www.camh.net/hsrcu
Phone: +01 (416) 535 8501 # 6465
Fax: +01 (416) 979 4703
  

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


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

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