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 […]

Chi-Square Independence Test – What and Why?

What and Why? Chi-Square Independence Test – What Is It? Null Hypothesis Assumptions Test Statistic Effect Size Reporting Chi-Square Independence Test – What Is It? The chi-square independence test is a procedure for testing if two categorical variables are related in some population.Example: a scientist wants to know if education level and marital status are […]

SPSS Chi-Square Test Tutorials

SPSS Chi-Square Test Tutorials Chi-Square Independence Test – What and Why? SPSS Chi-Square Independence Test SPSS One Sample Chi-Square TesT

SPSS LOOP – Quick Tutorial & Examples

LOOP is a command for running one or many SPSS transformation commands repetitively. SPSS LOOP is often used together with VECTOR. An (often) easier alternative is DO REPEAT. There are several ways for looping in SPSS. It depends on the specifics of the situation which one(s) you can use. Note that these options are only available in syntax. An […]

SPSS RTRIM Function

Summary By default, SPSS right pads string values with spaces up to the length of their containing string variables. You don’t usually see this but it may complicate concatenating strings. Such complications are avoided by trimming off trailing spaces using RTRIM (right trim). In Unicode mode, RTRIM is applied automatically but it’s fine to use it anyway. Results of steps 6 and 7 of the […]

SPSS LTRIM Function

Summary SPSS LTRIM (left trim) removes leading spaces from string values. These occur especially when converting numbers to strings by using the string function.* For removing trailing rather than leading spaces, see RTRIM. Results of CONCAT with and without LTRIM SPSS Ltrim Example The syntax below demonstrates a situation where you’ll like to use LTRIM. Running step 1 simply creates a mini dataset. Step 3 uses CONCAT without LTRIM and […]

SPSS REPLACE Function

Definition SPSS REPLACE replaces a substring in a string by a different (possibly empty) substring. SPSS Replace – Removing Spaces URLs are created from “title” by using REPLACE. The syntax below demonstrates how to do this. We have a dataset holding the titles of web pages and we’d like to convert these to URLs. For one thing, we don’t like spaces in […]

SPSS INDEX Function

Summary The SPSS INDEX function returns the position of the first occurrence of a given expression within a string. If the expression does not occur in the string, it returns a zero. As a rule of thumb, always use it as CHAR.INDEX. The reason for this is explained SPSS Unicode Mode. Note that string values are case sensitive. SPSS Index […]

SPSS Unicode Mode

SPSS Unicode mode is a setting which implies that all text is encoded as UTF-8 (Unicode Tranformation Format – 8 bit). Note that this tutorial leans substantively on Unicode. SPSS Unicode Mode – What and Why Up to version 15, all character encoding in SPSS was based on code pages. SPSS using code pages is now […]

SPSS – Set Missing Values with Syntax

When working with SPSS, specifying missing values correctly is often an essential step in analyzing data. This tutorial demonstrates how to set missing values the right way. Setting Missing Values in SPSS Perhaps unsurprisingly, missing values can be specified with the MISSING VALUES command. A thing to note, however, is that missing values can be specified for multiple variables at […]

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 […]

Create Dictionary Dataset

An often requested feature is to export variable and value labels to Excel. This handy tool creates an SPSS Dataset containing these labels. It can either be be saved as an Excel sheet or further edited in SPSS. SPSS Create Dictionary Dataset Tool – How To Use Make sure you have the SPSS Python Essentials installed. Next, download and […]

Changing Variable Properties 1 – Introduction

A great way to start working from syntax is using “Paste” instead of “Ok”. However, there’s no “Paste” option for modifying most variable properties. This tutorial shows how handle that properly. Changing Variable Properties Note that all variable properties (such as variable labels and value labels) are part of the SPSS dictionary. It is strongly recommended you use syntax in […]

SPSS CD Command

A best practice in SPSS is to open and save all files with syntax. Like so, it can be easily seen which syntax was run on which data. One could use the syntax generated by Paste for this but there’s a much shorter and better option. Disadvantages of the Default Syntax Each time you open a data file from […]

Customizing SPSS

One of the many things we love about SPSS is how easily it’s customized and extended with powerful new features. For instance, creating your own toolbar is utterly simple and may save a lot of time and effort. With SPSS version 18, SPSS Extension Bundles were introduced: create completely new SPSS commands, build a menu dialog for them and easily share your […]

SPSS – Quick Overview Statistical Functions

This tutorial walks you through SPSS’ main statistical functions. They are mainly used with COMPUTE and IF. Note that these are all within-subjects (or “horizontal”) functions. For between-subjects (or “vertical”) functions, see AGGREGATE. All examples in this tutorial use hospital.sav, which is freely downloadable. Within-subjects versus between-subjects functions. SPSS Statistical Functions – Missing Values SPSS statistical functions only return system missing values if all their input values […]

SPSS Missing Values Functions

Most real world data contain some (or many) missing values. It’s always a good idea to inspect the amount of missingness for avoiding unpleasant surprises later on. In order to do so, SPSS has some missing values functions that are mostly used with COMPUTE, IF AND DO IF. This tutorial demonstrates how to use them effectively. We’ll do so […]