Bookmark and Share

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

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

Re: st: changing the name of cases

From   Nick Cox <>
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-


On Mon, Oct 3, 2011 at 1:16 PM, Yang, Chongmin <> 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:

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