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

Re: st: missing data

From   "Dev Vencappa" <>
To   <>
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?

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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index