SPSS Scratch Variables

Definition Scratch variables are temporary helper variables that don’t show up in your data. A variable is a scratch variable if (and only if) its name starts with “#”. SPSS Scratch Variable – Introduction Say we have a data file holding phone numbers. Now we’d like to extract the area codes into a separate variable. […]

SPSS DO REPEAT – Simple Tutorial & Examples

DO REPEAT is a command for running other commands repetitively.SPSS DO REPEAT is often used for looping over (possibly new) variables. VECTOR with LOOP is an alternative way for doing so. Introduction Suppose we have a variable containing values 1 through 4 and we’d like to dichotomize it for a regression analysis. (For some more background, see Creating Dummy Variables in SPSS.) […]

SPSS Looping Tutorials

SPSS DO REPEAT – Simple Tutorial & Examples SPSS LOOP – Quick Tutorial & Examples SPSS VECTOR – Quick Tutorial  

Remove Value Label from Multiple Variables

Question “I’d like to completely remove the value label from a value for many variables at once. Is there an easy way to accomplish that?” SPSS Python Syntax Example begin program. variables = ‘v1 to v5‘ # Specify variables here. value = 3 # Specify value to unlabel here. import spss,spssaux vDict = spssaux.VariableDict(caseless = True) varList […]

SPSS – Splitting a String Variable

After importing some data into SPSS, some answers ended up in a single string variable. The data are in splitstrings.sav, part of which is shown below. Excel has a nice “text to columns” function to split it but SPSS hasn’t…So you think you can syntax?Then let’s go and split this string into the original answers. Step 1 – New […]

SPSS Datasets Tutorial 1 – Basics

Introduction SPSS dataset logic is not always logical. However, for working proficiently with datasets, just a handful of basics is sufficient. These are explained in this tutorial. This tutorial focuses on working with SPSS datasets. For a definition and some background on datasets, see SPSS Datasets. Working with SPSS Datasets It is recommended you follow along with the […]

SPSS INSERT Command

Definition SPSS Insert is a command for running syntax files from within another syntax file. This may help keeping your syntax organized. SPSS Insert Command – Why Use It? Executing all of your commands from syntax may be the single best practice for working with SPSS. One of the reasons is that you can correct steps early […]

SPSS FORMATS – Set Display Format for Variables

SPSS FORMATS sets formats -decimal places, dates, percent signs and more- for numeric variables. Setting variable formats in SPSS does not change your actual data values. However, formats determine how your data are displayed -in the data viewer as well as the output-window. Two main uses of FORMATS are increasing or decreasing the decimal places of standard numeric variables; displaying date, time and datetime values (consisting […]

Creating Tables in SPSS

Tables with statistics (means, sums and many more) for metric variables are easily created with DESCRIPTIVES. For reporting such descriptives for groups of cases separately, try MEANS. Frequency distributions and statistics (median, percentiles and more) for categorical variables are generated with FREQUENCIES. Frequencies or percentages for combinations of two or more categorical variables are created with CROSSTABS, which can also run chi-square tests. […]

SPSS – Analyzing Subsets of Cases

SPSS offers three ways for analyzing subsets of cases. After running SPLIT FILE, output tables and charts will show results for subsets of cases separately. Second, you can temporarily FILTER out cases you’d like to exclude from analysis as shown in the screenshot.  Third, you can permanently remove cases from your data with SELECT IF. Analyzing Subsets of Cases SPSS FILTER […]

SPSS with Python – Looping over Scatterplots

The right way for looping over tables, charts and other procedures in SPSS is with Python. We’ll show how to do so on some real world examples. We’ll use alcotest.sav throughout, part of which is shown below. Note that you need to have the SPSS Python Essentials properly installed for running these examples on your own computer. Example 1: Simple Loop over Bar […]

SPSS – Kendall’s Concordance Coefficient W

We had 5 judges taste and rank 6 different beers. The data -shown above- are in beertest.sav. For answering which beer was rated best, a Friedman test would be appropriate because our rankings are ordinal variables. A second question, however, is to what extent do all 5 judges agree on their beer rankings? If our judges don’t agree at […]

SPSS Confidence Intervals for Correlations Tool

Summary What’s the easiest way to obtain confidence intervals for Pearson correlations? Sadly, we couldn’t find these often requested statistics anywhere in SPSS. The best we encountered on the web were some ancient macros that, well… how to say this delicately… didn’t excel in user friendliness. This tutorial therefore proposes a freely downloadable, menu based tool […]

SPSS – Create All Scatterplots Tool

Creating a scatterplot in SPSS is pretty straightforward. However, I sometimes like to take a quick look at all scatterplots among a set of variables. So I created a simple tool that creates all of them in one click. All Scatterplots Tool – Download and Install First off, make sure you have SPSS version 18 or higher with the SPSS Python Essentials properly installed […]

SPSS Correlation Analysis Tutorial

Correlation Test – What Is It? Null Hypothesis Assumptions Correlation Test in SPSS Reporting Correlation Test – What Is It? A (Pearson) correlation is a number between -1 and +1 that indicates to what extent 2 metric variables are linearly related. It’s best understood by looking at some scatterplots. In short, a correlation of -1 indicates a perfect linear descending relation: higher scores on […]

Cramér’s V – What and Why?

Cramér’s V is a number between 0 and 1 that indicates how strongly two categorical variables are associated.If we’d like to know if 2 categorical variables are associated, our first option is the chi-square independence test. A significance level close to zero means that our variables are very unlikely to be completely unassociated in some population. However, this does not […]

SPSS – Stacked Bar Charts Percentages

Creating SPSS stacked bar charts with percentages -as shown above- is pretty easy. However, figuring out the right steps may take quite some effort and frustration. This tutorial therefore shows how to do it properly in one go. We encourage you to follow along on course_evaluation.sav. Part of these data are shown in the screenshot below. Example: Course Rating […]

Changing Variable Properties 3 – Type

SPSS offers several ways to change a variable’s type. This tutorial will walk you through some examples. SPSS Variable Type – Why Change it in the First Place? What you can do with a variable may depend on its type and – to a lesser extent – on its format. For example, you can extract substrings from string variables but not from numeric variables. […]

Changing Variable Properties 2 – Names

The right way for changing variable names in SPSS is using RENAME VARIABLES. Changing variable names manually in variable view is a bad idea because you can’t keep track of what you did. This tutorial shows a better alternative. Changing Variable Names in SPSS Changing variable names with syntax is straightforward with the RENAME VARIABLES command. The main thing to keep in mind is […]

Changing Variable Properties 4 – Width and Decimals

Changing a variable’s width is rarely necessary. Nevertheless, it’s good to know how when it’s needed and how it’s done. Changing Variable Width in SPSS For string variables, width refers to how many characters a value can hold. An exception are multibyte characters as explained in SPSS Unicode Mode. Somewhat confusingly, “width” is not the width of a variable’s column […]