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.

Variable Formats<br />

Variables 25<br />

SPSS accepts two variable types: numeric and string (also referred to as alphanumeric).<br />

Numeric values are stored internally as double-precision floating-point numbers and string<br />

values as codes listed in the SPSS character set (see Appendix B). Variable formats<br />

determine how SPSS reads raw data into storage and how it displays and writes values out.<br />

Input and Output Formats<br />

Values are read according to their input format and displayed on your terminal or written to<br />

a file according to their output format. The input and output formats differ in several ways.<br />

• The input format is either specified or implied on the DATA LIST, KEYED DATA LIST, or<br />

other data definition commands. It is in effect only when SPSS builds cases in a working<br />

data file. Figure 8 shows the command printback for DATA LIST, which includes<br />

input format specifications.<br />

Figure 8 Output showing input formats<br />

1 0 DATA LIST /ID 1-4 SCORE 6-9 (F,2).<br />

This command will read 1 records from the command file<br />

Variable Rec Start End Format<br />

ID 1 1 4 F4.0<br />

SCORE 1 6 9 F4.2<br />

• DATA LIST or any other data definition command automatically generates an output format<br />

from the input format and expands the output format to include punctuation characters<br />

such as decimal points, commas, dollar signs, and percent signs. To see the current output<br />

formats of variables in the working data file, use DISPLAY VARIABLES. The variables<br />

defined by the above DATA LIST command are displayed in Figure 9. Note that the output<br />

format for SCORE has been expanded one space to allow the display of the decimal point<br />

(the F4.2 input format indicates a four-character variable with two implied decimal places;<br />

the F5.2 output format includes one space for the decimal point).<br />

Figure 9 Output showing output formats<br />

List of variables on the active file<br />

Name Pos Print Fmt Write Fmt Missing Values<br />

ID 1 F4 F4<br />

SCORE 2 F5.2 F5.2<br />

• The formats (specified or default) on NUMERIC, COMPUTE, or other commands that<br />

create new variables are output formats. You must specify adequate widths to<br />

accommodate all punctuation characters.<br />

• The output format is in effect during the entire working session (unless explicitly<br />

changed) and is saved in the dictionary of an SPSS-format data file.<br />

• Output formats for numeric variables can be changed with the FORMATS, PRINT FORMATS,<br />

or WRITE FORMATS command.

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

Saved successfully!

Ooh no, something went wrong!