Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Replacing all values


From   Eric Booth <[email protected]>
To   "<[email protected]>" <[email protected]>
Subject   Re: st: Replacing all values
Date   Sun, 16 Jan 2011 03:59:23 +0000

<>

Use -mvdecode- :

************
mvdecode * , mv(99)
************
**more generally, you can use -ds- to help avoid typing out varlists**
ds, has(type numeric)
foreach v in `r(varlist)' {
	replace `v' = . if `v'==99
	**or**
	recode `v' (99=.)
	}
************

- Eric

__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754



On Jan 15, 2011, at 9:36 PM, Jonathan Brown wrote:

> I have a dataset in which missing data has been coded as 99. I would like to replace all 99 values with "."
> 
> I know how to replace values for each variable but typing the command for each variable is time consuming.
> 
> Is there a command that can replace values for all variables without having
> to type in each variable name?
>  
> Thanks,
> Jonathan 
> 
> 
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index