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

Re: st: missing data


From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   Re: st: missing data
Date   Sun, 14 Mar 2004 18:44:37 +0000

Here's a dum question from a beginner. I have data from a source that uses -0.001 as a flag for missing information. How do I make Stata treat all such variables as missing? Is there an easy way to replace all -0.001s with dots?
Thanks!

A very easy command (if your variables is numeric)  is:

replace varname=. if varname==-0.001

Otherwise if your variable is a string variable, then you can destring it first as follows:

destring varname, force replace gen(newvar1)

replace newvar1=. if newvar1==-0.001

Dev



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