Overview (FLIP command)
The program requires a file structure in which
the variables are the columns and observations (cases) are the rows.
If a file is organized such that variables are in rows and observations
are in columns, you need to use FLIP to reorganize it. FLIP transposes
the rows and columns of the data in the active dataset so that, for
example, row 1, column 2 becomes row 2, column 1, and so forth.
Options
Variable Subsets. You can transpose specific
variables (columns) from the original file using the VARIABLES subcommand.
Variable Names. You can
use the values of one of the variables from the original file as the
variable names in the new file, using the NEWNAMES subcommand.
Basic Specification
The basic specification
is the command keyword FLIP,
which transposes all rows and columns.
- By default,
FLIPassigns variable names VAR001 to VARn to the variables in the new file. It also creates the new variable CASE_LBL, whose values are the variable names that existed before transposition.
Subcommand Order
VARIABLES must precede NEWNAMES.
Operations
-
FLIPreplaces the active dataset with the transposed file and displays a list of variable names in the transposed file. -
FLIPdiscards any previousVARIABLE LABELS,VALUE LABELS, andWEIGHTsettings. Values defined as user-missing in the original file are translated to system-missing in the transposed file. -
FLIPobeys anySELECT IF,N, andSAMPLEcommands in effect. -
FLIPdoes not obey theTEMPORARYcommand. Any transformations become permanent when followed byFLIP. - String variables in the original file are assigned system-missing values after transposition.
- Numeric variables are assigned a default format
of
F8.2after transposition (with the exceptions of CASE_LBL and the variable specified onNEWNAMES). - The variable CASE_LBL is created and added to the active dataset each time
FLIPis executed. - If CASE_LBL already exists as the result of a
previous
FLIP, its current values are used as the names of variables in the new file (ifNEWNAMESis not specified).