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.

ADD FILES 85<br />

• DROP cannot be used with variables created by the IN, FIRST, or LAST subcommands.<br />

• KEEP can be used to change the order of variables in the resulting file. With KEEP,<br />

variables are kept in the order they are listed on the subcommand. If a variable is named<br />

more than once on KEEP, only the first mention of the variable is in effect; all subsequent<br />

references to that variable name are ignored.<br />

• The keyword ALL can be specified on KEEP. ALL must be the last specification on KEEP,<br />

and it refers to all variables not previously named on that subcommand. It is useful when<br />

you want to arrange the first few variables in a specific order.<br />

Example<br />

ADD FILES FILE=PARTICLE /RENAME=(PARTIC=POLLUTE1)<br />

/FILE=GAS /RENAME=(OZONE TO SULFUR=POLLUTE2 TO POLLUTE4)<br />

/KEEP=POLLUTE1 POLLUTE2 POLLUTE3 POLLUTE4.<br />

• The renamed variables are retained in the resulting file. KEEP is specified after all the FILE<br />

and RENAME subcommands, and it refers to the variables by their new names.<br />

IN Subcommand<br />

IN creates a new variable in the resulting file that indicates whether a case came from the input<br />

file named on the preceding FILE subcommand. IN applies only to the file specified on the<br />

immediately preceding FILE subcommand.<br />

• IN has only one specification, the name of the flag variable.<br />

• The variable created by IN has value 1 for every case that came from the associated input<br />

file and value 0 for every case that came from a different input file.<br />

• Variables created by IN are automatically attached to the end of the resulting file and cannot<br />

be dropped. If FIRST or LAST are used, the variable created by IN precedes the variables<br />

created by FIRST or LAST.<br />

Example<br />

ADD FILES FILE=WEEK10 /FILE=WEEK11 /IN=INWEEK11 /BY=EMPID.<br />

• IN creates the variable INWEEK11, which has value 1 for all cases in the resulting file that<br />

came from the input file WEEK11 and value 0 for those cases that were not in the file<br />

WEEK11.<br />

Example<br />

ADD FILES FILE=WEEK10 /FILE=WEEK11 /IN=INWEEK11 /BY=EMPID.<br />

IF (NOT INWEEK11) SALARY1=0.<br />

• The variable created by IN is used to screen partially missing cases for subsequent analyses.<br />

• Since IN variables have either value 1 or 0, they can be used as logical expressions, where<br />

1=true and 0=false. The IF command sets variable SALARY1 equal to 0 for all cases that<br />

came from the file INWEEK11.

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

Saved successfully!

Ooh no, something went wrong!