Recodes a set of variables according to a set of rules
Definition of the recoding rules. See details
recodes contains a set of recoding rules separated by ";".
There are three different types of recoding rules:
1. The simplest codes one value to another. If we wish to recode 1 into 2, we could use the rule
2. A range of values can be coded to a single value using
This rule would code all values between 1 and 3 inclusive into 4. For factors, a value is
between two levels if it is between them in the factor ordering.
One sided ranges can be specified using the Lo and Hi key words (e.g.
3. Default conditions can be coded using "else." For example, if we wish to recode all
values >=0 to 1 and all values <0 to missing, we could use (
returns a recoded
Ian Fellows adapted from code by John Fox
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.