Size: 2085
Comment:
|
Size: 1782
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= SPSS Formats = SPSS supports numeric variables and strings, with conversion options and some automatic conversion functionality. There are several formats on top of numerics that impact visualization, not storage. |
= SPSS Data Types = SPSS exposes numeric and string data types. Certain specialized forms of data are handled by formats that impact visualization and export, not storage. The primary example of this is date and time data. <<TableOfContents>> ---- == Numeric Data == Numeric data is stored as double-precision floating point. Data formats adjust the visualized/exported representation of a data point, often only truncating the value. Adjusting these data formats does not destroy precision. Given the literal value 123.45... ||'''General Format''' ||'''Format''' ||'''Representation''' || ||Fw ||F8 ||123 || ||Fw.d ||F8.1 ||123.4 || ||Nw ||N8 ||00000123 || ||Nw.d ||N8.1 ||000123.4 || See [[SPSS/NumericFunctions|here]] for the built-in library of numeric functions. === Date and Time Formats === ||'''Format''' ||'''Representation''' || ||DATETIME20 ||`dd-MMM-yyyy hh:mm:ss` || ||DATETIME17 ||`dd-MMM-yyyy hh:mm` || ||DATE11 ||`dd-MMM-yyyy` || ||DATE9 ||`dd-MMM-yy` || ||TIME8 ||`hh:mm:ss` || ||TIME5 ||`hh:mm` || ||ADATE10 ||`mm/dd/yyyy` || Note that `MMM` appears as `JAN`, not `001`. See [[SPSS/DateTimeFunctions|here]] for the built-in library of date and time functions. |
Line 8: | Line 49: |
== Datetime == | == String Data == |
Line 10: | Line 51: |
=== A warning about data input === | String data is stored at a fixed length. This length is defined and adjusted through the format; `Aw` where `w` is the width. |
Line 12: | Line 53: |
SPSS tries to be clever about reading data. Under the format `TIME`, all of these are read in as `"01:02"`, even though the format is a minimum of 5-wide: * `"1:2"` * `"01 2"` * `"01:02"` Under the format `DATE`, all of these are read in as `"28-OCT-90"`: * `"28-OCT-90"` * `"28/10/1990"` * `"28.OCT.90"` * `"28 October, 1990"` === Datetime formats === ||'''Format''' ||'''Appears as...''' ||'''Note''' || ||DATETIME20 ||`dd-MMM-yyyy hh:mm:ss` ||`MMM` is as JAN, not 001|| ||DATETIME18 ||`dd-MMM-yyyy hh:mm` ||`MMM` is as JAN, not 001|| ||DATE11 ||`dd-MMM-yyyy` ||`MMM` is as JAN, not 001|| ||DATE7 ||`dd-MMM-yy` ||`MMM` is as JAN, not 001|| ||TIME8 ||`hh:mm:ss` || || ||TIME5 ||`hh:mm` || || ||ADATE10 ||`mm/dd/yyyy` || || ||ADATE8 ||`mm/dd/yy` || || ||EDATE10 ||`dd.mm.yyyy` || || ||EDATE8 ||`dd.mm.yy` || || ---- == Numerics == Formats only truncate the displayed value, or the value translated into data files. SPSS always retains data to original precision. Given 123.45... ||'''Format''' ||'''Using...''' ||'''Appears as...''' || ||Fw ||F8 ||123 || ||Fw.d ||F8.1 ||123.4 || ||Nw ||N8 ||00000123 || ||Nw.d ||N8.1 ||000123.4 || ---- == Strings == String variables are only formatted to a length. The format is specified as `AN` where `N` is the width. |
See [[SPSS/StringFunctions|here]] for the built-in library of string functions. |
SPSS Data Types
SPSS exposes numeric and string data types.
Certain specialized forms of data are handled by formats that impact visualization and export, not storage. The primary example of this is date and time data.
Numeric Data
Numeric data is stored as double-precision floating point.
Data formats adjust the visualized/exported representation of a data point, often only truncating the value. Adjusting these data formats does not destroy precision.
Given the literal value 123.45...
General Format |
Format |
Representation |
Fw |
F8 |
123 |
Fw.d |
F8.1 |
123.4 |
Nw |
N8 |
00000123 |
Nw.d |
N8.1 |
000123.4 |
See here for the built-in library of numeric functions.
Date and Time Formats
Format |
Representation |
DATETIME20 |
dd-MMM-yyyy hh:mm:ss |
DATETIME17 |
dd-MMM-yyyy hh:mm |
DATE11 |
dd-MMM-yyyy |
DATE9 |
dd-MMM-yy |
TIME8 |
hh:mm:ss |
TIME5 |
hh:mm |
ADATE10 |
mm/dd/yyyy |
Note that MMM appears as JAN, not 001.
See here for the built-in library of date and time functions.
String Data
String data is stored at a fixed length. This length is defined and adjusted through the format; Aw where w is the width.
See here for the built-in library of string functions.