Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: changing the name of cases


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
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 <chongminyang@gmail.com> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index