Differences between revisions 2 and 3
Revision 2 as of 2023-01-13 23:10:58
Size: 1711
Comment:
Revision 3 as of 2023-01-13 23:15:20
Size: 1711
Comment:
Deletions are marked like this. Additions are marked like this.
Line 32: Line 32:
If the active dataset is included in a join and referenced by a star (`*`), that dataset will be replaced in-place by the join. If the active dataset is included in a join and referenced by a star (`*`), that dataset will be modified in-place by the join.

SPSS Match Files


Usage

To join two datasets, try:

match files
  /file=LEFT
  /file=RIGHT
  /by KEYVARLIST.

The final dataset contains all rows and variables from all datasets. Variables are taken in order from the datasets in order. For variables originating from more than one dataset, values are taken from the first dataset they appear in and metadata is taken from the first dataset with any (i.e. variable label, value labels, or missing values) metadata set.

File

Each /FILE subcommand takes one of:

  • a star (*) indicating the active data set

  • the name of a data set
  • a filename or file handle

If the active dataset is included in a join and referenced by a star (*), that dataset will be modified in-place by the join.

By

The /BY subcommand specified how cases can be uniquely identified. The KEYVARLIST can be one ore more variables.

The folowing are required of key variables:

  • They must be defined and have the same format in each file (including length for string variables)
  • They must uniquely identify a case in each file
  • Each file must be pre-sorted by them

If the /TABLE subcommand is used, the key variables specified on the /BY subcommand only need to uniquely identify a case across in each table.

Table

The MATCH FILES command has an extension through the /TABLE subcommand. It can be used to join lookup tables.

match files
  /file=LEFT
  /table=LOOKUP
  /by ID.

Each /TABLE subcommand takes one of:

  • the name of a data set
  • a filename or file handle


CategoryRicottone

SPSS/MatchFiles (last edited 2024-01-02 17:09:03 by DominicRicottone)