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.

FLIP 591<br />

Example<br />

Using the untransposed file from the previous example, the command<br />

FLIP VARIABLES=A TO C.<br />

transposes only variables A through C. Variable D is not transposed and is discarded from the<br />

working data file. The LIST output for the transposed file is as follows:<br />

CASE_LBL VAR001 VAR002 VAR003<br />

A . . .<br />

B 22.00 34.00 1970.00<br />

C 31.00 29.00 1971.00<br />

NEWNAMES Subcommand<br />

NEWNAMES specifies a variable whose values are used as the new variable names.<br />

• The NEWNAMES subcommand is optional. If it is not used, the new variable names are<br />

either VAR001 to VARn, or the values of CASE_LBL if it exists.<br />

• Only one variable can be specified on NEWNAMES.<br />

• The variable specified on NEWNAMES does not become an observation (case) in the new<br />

working data file, regardless of whether it is specified on the VARIABLES subcommand.<br />

• If the variable specified is numeric, its values become a character string beginning with<br />

the letter V.<br />

• If the variable specified is a long string, only the first eight characters are used.<br />

• Lowercase character values of a string variable are converted to upper case, and any bad<br />

character values, such as blank spaces, are replaced with underscore (_) characters.<br />

• If the variable’s values are not unique, a numeric extension n is added to the end of a value<br />

after its first occurrence, with n increasing by 1 at each subsequent occurrence.<br />

Example<br />

Using the untransposed file from the first example, the command<br />

FLIP NEWNAMES=A.<br />

uses the values for variable A as variable names in the new file. The LIST output for the transposed<br />

file is as follows:<br />

CASE_LBL INCOME PRICE YEAR<br />

B 22.00 34.00 1970.00<br />

C 31.00 29.00 1971.00<br />

D 43.00 50.00 1972.00<br />

• Variable A does not become an observation in the new file. The string values for A are<br />

converted to upper case.<br />

The following command transposes this file back to a form resembling its original structure:<br />

FLIP.

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

Saved successfully!

Ooh no, something went wrong!