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.

1706 Appendix C<br />

Figure C.4 NESTED.DAT file with missing records<br />

Y 1988<br />

P JONES 900<br />

P GREGORY 400<br />

R BATON ROUGE<br />

P RODRIGUEZ 300<br />

P SMITH 333<br />

P GRAU 100<br />

• The order of RECORD TYPE statements defines the hierarchical relationship among<br />

the records. The first RECORD TYPE defines the highest-level record type. The next<br />

RECORD TYPE defines the next highest level, and so forth. The last RECORD TYPE<br />

defines a case in the working data file.<br />

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

• In processing nested data, the program reads each record type you define. Information<br />

on the highest and intermediate-level records is spread to cases to which the information<br />

applies. The output from the LIST command is identical to that in Figure C.2.<br />

Nested Files with Missing Records<br />

In a nested file, some cases may be missing one or more record types defined in<br />

RECORD TYPE commands. For example, in Figure C.4 the region record for salespersons<br />

Jones and Gregory is missing.<br />

The program assigns missing values to variables that are not present for a case. Using<br />

the modified NESTED.DAT file in Figure C.4, the commands in the previous example<br />

produce the output shown in Figure C.5. You can see that the program assigned missing<br />

values to REGION for Jones and Gregory.<br />

Figure C.5 LIST output for nested data with missing records<br />

YEAR REGION SALESPER SALES<br />

1988 JONES 900<br />

1988 GREGORY 400<br />

1988 BATON ROUGE RODRIGUEZ 300<br />

1988 BATON ROUGE SMITH 333<br />

1988 BATON ROUGE GRAU 100<br />

You may want to examine cases with missing records, since these cases may indicate<br />

data errors. If you add the MISSING=WARN subcommand to your FILE TYPE command,<br />

the program prints a warning message when a case is missing a defined record type. For<br />

example, the program would print two warnings when processing data in Figure C.4.<br />

When MISSING is set to WARN, cases are built in the same way as when the default<br />

setting (NOWARN) is in effect.

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

Saved successfully!

Ooh no, something went wrong!