27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Basic Specification<br />

RECODE 1335<br />

The basic specification is a variable name and, within parentheses, the original values followed<br />

by a required equals sign and a new value. RECODE changes the values on the left of<br />

the equals sign into the single value on the right of the equals sign.<br />

<strong>Syntax</strong> Rules<br />

• The variables to be recoded must already exist and must be specified before the value<br />

specifications.<br />

• Value specifications are enclosed in parentheses. The original value or values must be<br />

specified to the left of an equals sign. A single new value is specified to the right of the<br />

equals sign.<br />

• Multiple values can be consolidated into a single recoded value by specifying, to the left<br />

of the equals sign, a list of values separated by blanks or commas. Only one recoded value<br />

per set is allowed to the right of the equals sign.<br />

• Multiple sets of value specifications are permitted. Each set must be enclosed in parentheses<br />

and can result in only one new value.<br />

• To recode multiple variables using the same set of value specifications, specify a variable<br />

list before the value specifications. Each variable in the list is recoded identically.<br />

• To recode variables using different value specifications, separate each variable (or variable<br />

list) and its specifications from the others by a slash.<br />

• Original values that are not specified remain unchanged unless keyword ELSE is used or<br />

INTO is used to recode into a new variable. ELSE refers to all original values not previously<br />

mentioned, including the system-missing value. ELSE should be the last specification<br />

for the variable. When recoding INTO another variable, unspecified values are set to<br />

system-missing or blank for strings.<br />

• COPY replicates original values without recoding them.<br />

• INTO is required to recode a string variable into a numeric variable or a numeric variable<br />

into a string variable (see the INTO keyword on p. 1337).<br />

Numeric Variables<br />

• Keywords that can be used in the list of original values are LO (or LOWEST), HI (or<br />

HIGHEST), THRU, MISSING, SYSMIS, and ELSE. Keywords that can be used in place of<br />

a new value are COPY and SYSMIS.<br />

• THRU specifies a value range and includes the specified end values.<br />

• LOWEST and HIGHEST (LO and HI) specify the lowest and highest values encountered in<br />

the data. LOWEST and HIGHEST include user-missing values but not the system-missing<br />

value.<br />

• MISSING specifies user-missing and system-missing values for recoding. MISSING can be<br />

used in the list of original values only.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!