SPSS Main Numeric Functions

This tutorial covers some obvious and some less obvious functions for editing numeric variables. You can follow along with this tutorial by downloading and opening hospital.sav. They syntax we’ll use can be copy-pasted or downloaded here. Specifying User Missing Values This tutorial will only use the last 2 variables in the data.* Before doing anything else, we first specify […]

SPSS Command Types

Summary SPSS commands come in three basic types: procedures, transformations and other commands. Understanding this distinction will allow you to get things done in SPSS faster and more efficiently. SPSS Command Types Diagram SPSS Transformations As shown in the figure, the first question is when a command is executed. Some SPSS commands are not carried out […]

SPSS Transformation Commands

Summary SPSS transformation commands (or simply “transformations”) can be loosely defined as commands that are not immediately carried out when you run them. Instead, they are kept in mind by SPSS and executed only when necessary. The table below gives an overview of SPSS’ main tranformation commands. Main SPSS Tranformation Commands COMMAND NAME GOAL TYPICAL USAGE […]

Extract a Year from a Date

Introduction Extracting the year (or any component) from a date is straightforward with the XDATE (“EXtract DATE“) function. Copy-paste-run the syntax presented below for a demonstration of XDATE. SPSS Xdate Syntax Example *1. Create mini test data. data list free/date(edate10). begin data ’01/01/01′ ’12/12/12′ end data. *2. Extract the year. compute year_from_date = xdate.year(date). exe. *3. Hide decimals for […]

Convert Numeric to Date Variable

Summary For time calculations (such as the number of days between two dates) proper date variables are needed. In some cases, the digits of a numeric variable may represent year, month and day. This tutorial shows how to convert this format into an actual date variable. Convert Numbers to SPSS Date Variables In some cases, […]

SPSS Numeric Variables Basics

Introduction Having a basic understanding of SPSS numeric variables allows you to work fast and with a sense of confidence. This tutorial aims at accomplishing just that by pointing out some essential basics. You may follow along with this tutorial by downloading and opening hospital.sav. SPSS Numeric Variables – What Are They? Numeric variables are one of […]

SPSS Main Numeric Functions

This tutorial covers some obvious and some less obvious functions for editing numeric variables. You can follow along with this tutorial by downloading and opening hospital.sav. They syntax we’ll use can be copy-pasted or downloaded here. Specifying User Missing Values This tutorial will only use the last 2 variables in the data.* Before doing anything else, we first specify […]