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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: "Label define" syntax for "all other values"


From   Eric Booth <ebooth@ppri.tamu.edu>
To   "<statalist@hsphsun2.harvard.edu>" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: "Label define" syntax for "all other values"
Date   Fri, 24 Sep 2010 06:55:12 +0000

<>


lab def rr_jobf 1 "Driver" 2 "Conductor" 3 "Brakeman" 4 "Fireman", modify

levelsof rr_job if rr_job>4, local(lev)
foreach x in `lev' {
	lab def rr_jobf   `x'  "All Other Jobs", modify
	}

lab li
lab val rr_job  rr_jobf

-Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
ebooth@ppri.tamu.edu
Office: +979.845.6754

On Sep 24, 2010, at 1:46 AM, Dan Waldo wrote:

> Dear list members,
> Suppose that variable rr_job takes the values 1,2,3,...,999. Can I construct a format for this variable that specifies some values and lumps the rest into a catchall category? That is, can I write
> 
> label define rr_jobf 1 "Driver" 2 "Conductor" 3 "Brakeman" 4 "Fireman" <other> "All other jobs"
> 
> where <other> represents the syntax I don't know but means any value not elsewhere specified.
> 
> Thanks!
> 
> 
> 
> 
> *
> *   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   |   Site index