This route is likely to be problematic. Often this will
only work with the extra call to -float()-.
replace varname = . if float(varname) == -0.001
-mvdecode- is better in this respect.
See my previous posting.
Nick
[email protected]
Dev Vencappa
> 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
*
* 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/