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.

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

• BEGIN DATA and END DATA indicate that data are inline.<br />

• The output from LIST is identical to the output in Figure C.6.<br />

Defining Complex Files 1709<br />

FILE TYPE GROUPED is most useful when record order varies across cases and when<br />

cases have missing or duplicate records. In the modified data shown in Table C.2, only<br />

case 1 has all three record types. Also, record order varies across cases. For example, the<br />

first record for case 1 is a science record, whereas the first record for cases 2 and 3 is a<br />

reading record.<br />

Table C.2 Modified grouped data file<br />

Student Subject Score<br />

1 S 97<br />

1 R 58<br />

1 M 59<br />

2 R 43<br />

3 R 67<br />

3 M 75<br />

You can use the same FILE TYPE commands as above to read the modified file. As<br />

shown in the output from LIST in Figure C.7, the program assigns missing values to variables<br />

that are missing for a case.<br />

Figure C.7 LIST output for modified GROUPED.DAT file<br />

STUDENT READING MATH SCIENCE<br />

1 58 59 97<br />

2 43 . .<br />

3 67 75 .<br />

By default, the program generates a warning message when a case is missing a defined<br />

record type in a grouped file or when a record is not in the same order as in RECORD<br />

TYPE commands. Thus, four warnings are generated when the commands for the<br />

previous example are used to read the modified GROUPED.DAT file. You can suppress<br />

these warnings if you add the optional specifications MISSING=NOWARN and<br />

ORDERED=NO on your FILE TYPE command.<br />

In the modified GROUPED.DAT file, the case identifier STUDENT appears in the<br />

same column position in each record. When the location of the case identifier varies for<br />

different types of records, you can use the CASE option of the RECORD TYPE command<br />

to specify different column positions for different records. For example, suppose the<br />

case identifier appears in first column position on reading and science records and in column<br />

2 in math records. You could use the following commands to define the data:

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

Saved successfully!

Ooh no, something went wrong!