Statalist


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

Re: st: replace observation values


From   Nikolaos Pandis <npandis@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: replace observation values
Date   Sun, 12 Jul 2009 12:27:15 -0700 (PDT)

Thank you very much Uli.
Best wishes,
Nick

--- On Sun, 7/12/09, Ulrich Kohler <kohler@wzb.eu> wrote:

> From: Ulrich Kohler <kohler@wzb.eu>
> Subject: Re: st: replace observation values
> To: statalist@hsphsun2.harvard.edu
> Date: Sunday, July 12, 2009, 2:56 PM
> Am Sonntag, den 12.07.2009, 03:58
> -0700 schrieb Nikolaos Pandis:
> > Hi to all.
> > 
> > Would you please help me with the following question:
> > 
> > In a dataset under one variable I have two names for
> the same type of observation (ie CASE-CONTROL AND
> CASE_CONTROL). 
> > How would I change all in CASE_CONTROL without having
> to do each one individually?
> 
> If your variable is a string variable type
> 
> . replace varname = "CASE_CONTROL" if varname ==
> "CASE-CONTROL"
> 
> where varname ist the name of your variable. 
> 
> If it is a numeric variable with value labels attached to
> it use the
> respective numerical numbers instead of the strings, or
> type
> 
> . replace varname = "CASE_CONTROL":varnamelabel ///
>        if varname ==
> "CASE-CONTROL":varnamelabel
> 
> where varname is the name of your variable and varnamelabel
> is the name
> of the value label attached to it. 
> 
> 
> Many regards
> Uli
> 
> 
> 
> -- 
> kohler@wzb.eu
> +49 (0)30 25491-361
> 
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index