{smcl}
{* version 1.0.4 08jun2012}{...}
{cmd:help labrec}
{hline}

{p 5 8 8}
{cmd:labrec} has been superseded by {helpb labrecode} which is also 
part of {help labutil2} package. {cmd:labrec} will not be removed 
from the package, but there will be no further updates. See 
{help labrec##r:Remarks}.


{title:Title}

{p 5}
{cmd:labrec} {hline 2} Modify value labels and recode variables they 
are attached to


{title:Syntax}

{p 8}
{cmd:labrec} {it:namelist} {cmd:(}{it:rule}{cmd:)} 
[{cmd:(}{it:rule}{cmd:)} {it:...}] [{cmd:,} {it:options}]


{p 5}
where {it:namelist} is a list of value label names, a {varlist}, or a 
combination of the two

{p 5}
{it:rule} is 

{p 8}
{it:{help numlist}} {cmd:=} {it:#} [{cmd:"}{it:label}{cmd:"}]


{title:Description}

{pstd}
{cmd:labrec} modifies value labels and recodes all variables they are 
attached to accordingly. In value labels, values specified in 
{it:numlist} are changed to {it:#} and any text associated with 
values in {it:numlist} is deleted from the value label. A user defined 
{it:label} is associated with {it:#}. If no {it:label} is specified 
{cmd:labrec} combines text associated with values in {it:numlist} and 
attaches it to {it:#}.

{pstd}
{hi:Caution:} Modifications affect all variables that have the same 
value label as one variables in {it:namelist} attached. The program 
alters existing variables. See {help labrec##r:Remarks}.


{title:Options}

{phang}
{opt noch:ange} recode value labels but not variables.

{phang}
{opt nol:abel} prevents {cmd:labrec} from creating labels if the user 
does not provide them. Default is to combine text associated with 
values in {it:numlist} and attach it to {it:#}. Note that specifying 
{opt nolabel} does not detach text from {it:#}. To do this specify 
{hi:""} as {it:label} in {it:rules}. 

{phang}
{opt a:dd} adds text associated with values in {it:numlist} to text 
associated with {it:#} if no user defined {it:label} is provided. May 
not be combined with {opt nolabel}.

{phang}
{opt sep:arate(chars)} specifies the separator between labels. Default 
is to use space ({hi:" "}). May not be specified with {opt nolabel}.

{phang}
{opt nodel:ete} does not delete text associated with values in 
{it:numlist} from value labels. This option is seldom used.

{marker r}
{title:Remarks}

{pstd}
{cmd:labrec} violates Stata conventions. Specifying variable {hi:foo} 
in {it:namelist}, changes variable {hi:foo}. It also changes variable 
{hi:bar}, if {hi:bar} has the same value label, say {hi:foobar}, 
attached. In fact, any variable that has value label {hi:foobar} 
attached will be recoded, even though neither variable {hi:bar}  
nor value label name {hi:foobar} is ever specified. I thank Daniel 
Possenriede for bringing this to may attention again. {cmd:labrec} 
will continue to work the way it did, but is superseded by 
{helpb labrecode}. Specifying variable names in {it:namelist} is 
allowed with {cmd:labrecode}, but this feature has to be requested by 
the user.


{title:Examples}

{pstd}
In the {hi:nlsw88} dataset, change value 2 in {hi:racelbl} and 
{hi:race} to value 3. Attach text "black" to value 3. Delete the 
association between value 2 and text "black" from {hi:racelbl}.

{phang2}{cmd:. labrec racelbl (2 = 3)}{p_end}

{pstd}
Do the same as above, but keep text "other" attached to value 3.

{phang2}{cmd:. labrec racelbl (2 = 3) ,nolabel}{p_end}

{pstd}
Do the same as above, but attach text "other black" to value 3.

{phang2}{cmd:. labrec racelbl (2 = 3) ,add}{p_end}

{pstd}
Do the same as above, but delete value 3 from {hi:racelbl}.

{phang2}{cmd:. labrec racelbl (2 = 3 "")}{p_end}

{pstd}
In value label {hi:occlbl} change values 1 and 2 to value 14 and 
attach text "Prof./Managers". Also change value 9 to value 10. 
Attach text "Farmers Farm laborers" to value 10. 

{phang2}{cmd:. labrec occupation (1 2 = 14 "Prof./Managers")}
{cmd:(9/10 = 10)}{p_end}

{pstd}
Note that option {opt add} is not needed here, because value 10 is 
part of {it:numlist}. Variable {hi:occupation} is recoded accordingly 
as would be any other variable using value label {hi:occlbl}.

{pstd}
Reverses value label {hi:racelbl} and recode variable {hi:race} 
accordingly.

{phang2}{cmd:. labrec race (1=3)(3=1)}{p_end}


{title:Author}

{pstd}Daniel Klein, University of Bamberg, klein.daniel.81@gmail.com


{title:Also see}

{psee}
Online: {help label}{p_end}

{psee}
if installed: {help labvalch}, {help rev}, {help strrec}, 
{help labutil2}
{p_end}
