SPSS AUTORECODE Command

SPSS AUTORECODE – Minimal Example autorecode str_var1 str_var2 str_var3 /into num_var1 num_var2 num_var3. Introduction This tutorial explains SPSS’ AUTORECODE command and shows how to use it properly on nominal_strings.sav, a screenshot of which is shown below. We recommend downloading this data file and following along with the steps in this tutorial. SPSS AUTORECODE – What Is It? […]

Computing Variables in SPSS – Overview

Computing new variables -often as means or sums over other variables- is usually done with COMPUTE. If you want to do so for only some cases but not others, use IF instead. Some alternatives for creating new variables in SPSS are RECODE, AUTORECODE, AGGREGATE and RANK. Computing Variables Tutorials SPSS Missing Values Functions SPSS COMPUTE – Simple Tutorial

SPSS Python Text Replacement Tutorial

A common task in Python is building strings from other strings, especially if we’re creating SPSS syntax. We could simply concatenate strings into larger strings but there’s a nicer way: string replacements with the % sign. Please note that the examples in this tutorial assume Python2.x* and may not run in Python3.x. Python String Replacement with %s *Replace […]

SPSS Python String Tutorial

The most important Python object we’ll deal with are strings. This tutorial presents a quick overview of Python string methods. However, let’s first learn some very basics. Python Strings – Basic Rules Strings may be enclosed by single or double quotes if they don’t contain any line breaks; Strings may always be enclosed by 3 single […]

Python – The 5 Things You Want to Know

SPSS users who want to speed up their work by using Python will encounter some surprises. This tutorial walks you through the 5 major pitfalls and shows how to avoid them. 1. Python is Fully Case Sensitive SPSS is mostly case insensitive; if we have a variable “gender”, we can address it in syntax as gender or GENDER or anything in between. […]

SPSS with Python IV – How to Use It?

So how does Python for SPSS actually work? First off, a distinction is often made between SPSS Python programmability and SPSS Python scripting. They work similarly in that some Python code is included in SPSS syntax; SPSS passes this Python code on to Python; Python may then look up information in SPSS such as variable names in the dataset or tables in the output window; […]

SPSS – Set Chart Sizes Tool

This handy tool will set the exact sizes for one or many charts in the active output window. SPSS Set Chart Sizes Tool – How to Use it This tool requires SPSS version 18 or higher. For SPSS versions 14 through 17, you can use the syntax version from SPSS Set Chart Sizes with Syntax Tool. Before proceeding, […]

SPSS Clone Variables Tool

In SPSS, I don’t like to recode variables into new variables: the new variables don’t have any dictionary information such as variable/value labels or formats. Second, a recoded variable is appended to the end of the file but I rather have it in its original position. Both problems are avoided by recoding into the same variables. However, […]

SPSS with Python III – How Does It Work?

So how does Python for SPSS actually work? First off, a distinction is often made between SPSS Python programmability and SPSS Python scripting. They work similarly in that some Python code is included in SPSS syntax; SPSS passes this Python code on to Python; Python may then look up information in SPSS such as variable names in the dataset or tables in the output window; […]

SPSS Tools – Overview

All tools on this page can be used from SPSS’ menu via a dialog window or by syntax. Our newest tools come as SPSS extensions and some older tools are SPSS Custom Dialogs.Some of these tools require SPSS version 17 or 18 with the SPSS Python Essentials in order to work. If so, this’ll be clearly indicated. We recently moved […]

SPSS Extension Bundles

Summary SPSS Extension Bundles are extra program features that you can add to SPSS. Like so, you can add data editing routines, statistical procedures or other features that the program does not include by default. Most extensions are freely downloadable. You can also write and distribute your own Extension Bundles but doing so is reasonably […]

Python for SPSS

Python is a programming language that can be integrated with SPSS versions 14 and higher. By using Python in SPSS you can automate basically any SPSS task such as batch processing data files or output tables and charts. Recent SPSS versions allow you to add SPSS extensions similarly to apps on a smartphone. Most extensions can be used from […]

Comparing Metric Variables

Summary This tutorial shows how to create proper tables and means charts for multiple metric variables. If statistical assumptions are satisfied, these may be followed up by a repeated measures ANOVA. We’ll use income 2010 through income_2014 from freelancers.sav throughout this tutorial. SPSS FREQUENCIES for Inspecting Histograms We’ll first inspect the data in income_2010 through income_2014 by running basic histograms. This […]

SPSS VARSTOCASES – What and Why?

SPSS VARSTOCASES is short for “variables to cases”. It restructures data by stacking variables on top of each other as illustrated by the figure above. You can try this simple example for yourself by downloading and opening sav_data018 and running the syntax below on it. SPSS VARSTOCASES Example 1 *Very basic VARSTOCASES example. varstocases /make v from […]

Comparing Dichotomous or Categorical Variables

Summary This tutorial shows how to create nice tables and charts for comparing multiple dichotomous or categorical variables. We recommend following along by downloading and opening freelancers.sav. The question we’ll answer is in which sectors our respondents have been working and to what extent this has been changing over the years 2010 through 2014. Variables sector_2010 through sector_2014 contain the necessary information. SPSS Frequency […]

Comparing Dichotomous Variables

This tutorial shows how to create nice tables and charts for comparing multiple dichotomous variables. If statistical assumptions are satisfied, these may be followed up by a McNemar test (2 variables) or a Cochran Q test (3+ variables). We’ll use the freelancers.sav data throughout. SPSS DESCRIPTIVES Table The simplest way to compare multiple dichotomous variables is simply running DESCRIPTIVES: as long as […]

Analyzing Categorical Variables Separately

When analyzing your data, you sometimes just want to gain some insight into variables separately. The first step in doing so is creating appropriate tables and charts. This tutorial shows how to do so for dichotomous or categorical variables. We recommend you follow along by downloading and opening smartphone_users.sav. SPSS Frequency Tables We’d like to know which smartphone brands were […]

Descriptive Statistics – One Categorical Variable

Introduction When reporting on data, we usually summarize our variables. The most basic way for doing so is presenting their frequency distributions. Visualizing these as histograms tends to give immediate insight into what a variable ‘looks like’, especially when many distinct values are present. However, frequency distributions often provide more detail than we actually need. […]

Descriptive Statistics – One Metric Variable

Introduction A previous tutorial introduced some summary statistics appropriate for both categorical as well as metric variables. Now it’s time to turn to some measures that apply to metric variables exclusively. The most important ones are the mean (or average), variance and standard deviation. Mean Most of us are probably familiar with the mean (or average) but […]

Association between Metric Variables

Summary This tutorial will investigate the association between metric variables with nice tables and charts. As an example, we’ll use income_2010 and income_2011 from freelancers.sav. Quick Data Check Before jumping into analyses, let’s first just inspect whether both variables have plausible values. A fast way for doing so is generating a histogram by running FREQUENCIES. The syntax below does just that. […]