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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

590 FLIP<br />

Example<br />

• FLIP discards any previous VARIABLE LABELS, VALUE LABELS, and WEIGHT settings.<br />

Values defined as user-missing in the original file are translated to system-missing in the<br />

transposed file.<br />

• FLIP obeys any SELECT IF, N, and SAMPLE commands in effect.<br />

• FLIP does not obey the TEMPORARY command. Any transformations become permanent<br />

when followed by FLIP.<br />

• String variables in the original file are assigned system-missing values after transposition.<br />

• Numeric variables are assigned a default format of F8.2 after transposition (with the exceptions<br />

of CASE_LBL and the variable specified on NEWNAMES).<br />

• The variable CASE_LBL is created and added to the working data file each time FLIP is<br />

executed.<br />

• If CASE_LBL already exists as the result of a previous FLIP, its current values are used as<br />

the names of variables in the new file (if NEWNAMES is not specified).<br />

The following is the LIST output for a data file arranged in a typical spreadsheet format, with<br />

variables in rows and observations in columns:<br />

A B C D<br />

Income 22.00 31.00 43.00<br />

Price 34.00 29.00 50.00<br />

Year 1970.00 1971.00 1972.00<br />

The command<br />

FLIP.<br />

transposes all variables in the 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 />

D 43.00 50.00 1972.00<br />

• The values for the new variable CASE_LBL are the variable names from the original file.<br />

• Case A has system-missing values, since variable A had the string values Income, Price,<br />

and Year.<br />

• The names of the variables in the new file are CASE_LBL, VAR001, VAR002, and VAR003.<br />

VARIABLES Subcommand<br />

VARIABLES names one or more variables (columns) to be transposed. The specified variables<br />

become observations (rows) in the new working file.<br />

• The VARIABLES subcommand is optional. If it is not used, all variables are transposed.<br />

• The actual keyword VARIABLES can be omitted.<br />

• If the VARIABLES subcommand is specified, variables that are not named are discarded.

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

Saved successfully!

Ooh no, something went wrong!