[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: missing data
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.
> 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?
> 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: