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: changing the name of cases


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: changing the name of cases
Date   Mon, 3 Oct 2011 13:26:57 +0100

Cases, meaning observations, don't have names as such. What you want
to do seems to be to change the value of a string variable, for which
-replace- is the best command.

You can go

replace country = "South Korea" if country == "Republic of Korea"

and that will change all such observations. However, you also talk of
labels; if you want to change value labels, use the -label define-
command,

Nick

On Mon, Oct 3, 2011 at 1:16 PM, Yang, Chongmin <[email protected]> wrote:
> I want to know how I can change the name of cases.
> For example, one of the cases included in "country" variable is "China
> version1" and I want to change it into "China."
>
> I have another question.
> I have to combine two datasets but some labels of cases are different
> such as "South Korea" in one dataset and "Republic of Korea" in the
> other.
> If I would like to make both of the name of cases same, do I have
> change them case by case?
> Do you have any easier way to change them?
*
*   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