Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Label variable


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Label variable
Date   Thu, 23 Feb 2006 12:17:44 -0000

Value labels in Stata are associations between 
numeric values and text labels. 

You can get what you want in Stata only by
generating another string variable. 

gen grade = "Excellent" if GRADE == "a"
replace grade = "Very good" if GRADE == "b" 

etc. 

Nick 
[email protected] 

Mosca, Ilaria
 
> I would like to assign labels to a variable. This variable, 
> however, has
> no numeric values but letters. So I have something like:
> GRADE
> A
> A
> B
> B
> C
> D
> I would like to label "A" as "excellent", "B" as "very good", etc.
> So far I tried the following command, but unsuccesfully:
> Label define grade a "excellent", add
> 
> Is the problem due to the fact that Stata does not recognize letters?

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index