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.

908 MATCH FILES<br />

• If the files have unequal numbers of cases, cases are generated from the longest file. Cases<br />

that do not exist in the shorter files have system-missing values for variables that are<br />

unique to those files.<br />

Raw Data Files<br />

To add variables from a raw data file, you must first define the raw data as the working data<br />

file using the DATA LIST command. MATCH FILES can then combine the working data file<br />

with an SPSS-format data file.<br />

Example<br />

DATA LIST FILE=GASDATA/1 OZONE 10-12 CO 20-22 SULFUR 30-32.<br />

VARIABLE LABELS OZONE ’LEVEL OF OZONE’<br />

CO ’LEVEL OF CARBON MONOXIDE’<br />

SULFUR ’LEVEL OF SULFUR DIOXIDE’.<br />

MATCH FILES FILE=PARTICLE /FILE=*.<br />

SAVE OUTFILE=POLLUTE.<br />

• The PARTICLE file is a previously saved SPSS-format data file.<br />

• The GASDATA file is a raw data file and is defined on the DATA LIST command. Variable<br />

labels are assigned on the VARIABLE LABELS command.<br />

• MATCH FILES adds the working data file (*), which now contains the gas data, to SPSSformat<br />

data file PARTICLE.<br />

• SAVE saves the new working file as an SPSS-format data file with the filename POLLUTE.<br />

BY Subcommand<br />

BY specifies one or more identification, or key, variables that determine which cases are to<br />

be combined. When BY is specified, cases from one file are matched only with cases from<br />

other files that have the same values for the key variables. BY is required unless all input files<br />

are to be matched sequentially according to the order of cases.<br />

• BY must follow the FILE and TABLE subcommands and any associated RENAME and IN<br />

subcommands.<br />

• BY specifies the names of one or more key variables. The key variables must exist in all<br />

input files. The key variables can be numeric or long or short strings.<br />

• All input files must be sorted in ascending order of the key variables. If necessary, use<br />

SORT CASES before MATCH FILES.<br />

• Missing values for key variables are handled like any other values.<br />

• Unmatched cases are assigned system-missing values (for numeric variables) or blanks<br />

(for string variables) for variables from files that do not contain a match.

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

Saved successfully!

Ooh no, something went wrong!