Differences between revisions 2 and 9 (spanning 7 versions)
Revision 2 as of 2019-12-08 07:25:41
Size: 1843
Comment:
Revision 9 as of 2020-07-04 16:47:20
Size: 1567
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Datetime = = SPSS Data Types =
Line 3: Line 3:
== A warning about data input == SPSS supports numeric and [[SPSSStrings|string]] data. There are several formats on top of numeric data that impact visualization, not storage. These include [[SPSSDatetimes|dates and times]].
Line 5: Line 5:
SPSS tries to be clever about reading data. <<TableOfContents>>
Line 7: Line 7:
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"`
----
Line 12: Line 9:
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"`

== Numeric Data ==

Numeric data is stored as double-precision floating point. Data formats adjust the printed/ exported representation of a data point, often only truncating the value. Adjusting these data formats does not destroy precision.

Given 123.45...

||'''General Format''' ||'''Format''' ||'''Representation''' ||
||Fw ||F8 ||123 ||
||Fw.d ||F8.1 ||123.4 ||
||Nw ||N8 ||00000123 ||
||Nw.d ||N8.1 ||000123.4 ||
Line 20: Line 24:
== Datetime formats == === Date and Time Formats ===
Line 22: Line 26:
||'''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` || ||
See [[SPSSDatetimes|here]] for more details on date, time, and datetime data.

||'''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`.

----
Line 36: Line 43:
---- == String Data ==
Line 38: Line 45:
= 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.
String data is stored at a fixed length. This length is defined and adjusted through the format; `Aw` where `w` is the width.

SPSS Data Types

SPSS supports numeric and string data. There are several formats on top of numeric data that impact visualization, not storage. These include dates and times.


Numeric Data

Numeric data is stored as double-precision floating point. Data formats adjust the printed/ exported representation of a data point, often only truncating the value. Adjusting these data formats does not destroy precision.

Given 123.45...

General Format

Format

Representation

Fw

F8

123

Fw.d

F8.1

123.4

Nw

N8

00000123

Nw.d

N8.1

000123.4

Date and Time Formats

See here for more details on date, time, and datetime data.

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.


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.


CategoryRicottone

SPSS/DataTypes (last edited 2023-06-13 05:00:25 by DominicRicottone)