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.

Example<br />

* A grouped file of student test scores.<br />

FILE TYPE GROUPED RECORD=#TEST 6 CASE=STUDENT 1-4.<br />

RECORD TYPE 1.<br />

DATA LIST /ENGLISH 8-9 (A).<br />

RECORD TYPE 2.<br />

DATA LIST /READING 8-10.<br />

RECORD TYPE 3.<br />

DATA LIST /MATH 8-10.<br />

END FILE TYPE.<br />

FILE TYPE—END FILE TYPE 571<br />

BEGIN DATA<br />

0001 1 B+<br />

0001 2 74<br />

0001 3 83<br />

0002 1 A<br />

0002 2 100<br />

0002 3 71<br />

0003 1 B-<br />

0003 2 88<br />

0003 3 81<br />

0004 1 C<br />

0004 2 94<br />

0004 3 91<br />

END DATA.<br />

• FILE TYPE identifies the file as a grouped file. As required for grouped files, all records<br />

for a single case are together in the data. The record identification variable #TEST is<br />

located in column 6. A scratch variable is specified so it won’t be saved in the working<br />

data file. The case identification variable STUDENT is located in columns 1–4.<br />

• Because there are three record types, there are three RECORD TYPE commands. For each<br />

RECORD TYPE, there is a DATA LIST to define variables on that record type.<br />

• END FILE TYPE signals the end of file definition.<br />

• The program builds four cases—one for each student. Each case includes the case identification<br />

variable plus the variables defined for each record type (the test scores). The<br />

values for #TEST are not saved in the working data file. Thus, each case in the working<br />

file has four variables: STUDENT, ENGLISH, READING, and MATH.

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

Saved successfully!

Ooh no, something went wrong!