Survey Sampling – How Does It Work?

Survey Sampling – Introduction When it’s not feasible to study an entire target population, a simple random sample is the next best option; with sufficient sample size, it satisfies the assumption of independent and identically distributed variables. And perhaps even more important, it will tend to be nicely representative for the population with regard to […]

SPSS Sampling Basics

Summary How to draw one or many samples from your data in SPSS? This tutorial demonstrates some simple ways for doing so. We’ll point out some tips, tricks and pitfalls along the way. Let’s get started and create some test data by running the syntax below. SPSS Syntax for Creating Test Data *Create test data with […]

SPSS RV Function

Basic Use COMPUTE v1 = RV.NORMAL(0,1). Summary In SPSS, RV is short for random variable. It draws random values from a given probability distribution.* The latter is specified as a period separated suffix as in RV.BERNOULLI(.5).RV is mostly but not necessarily used with COMPUTE. Random Sample (N = 10,000) from a Standard Normal Distribution SPSS Rv Examples A nice way to get […]

Combine Categorical Variables

Many easy options have been proposed for combining the values of categorical variables in SPSS. However, the real information is usually in the value labels instead of the values. This tutorial proposes a simple trick for combining categorical variables and automatically applying correct value labels to the result. SPSS Combine Categorical Variables Example You may follow along by downloading and opening hospital.sav. Now say […]

Draw a Stratified Random Sample

“I have 5 groups of 10 cases in my data. How can I draw a stratified random sample from these cases? That is, from groups 1 through 5 I’d like to draw exactly 5, 4, 5, 6 and 3 cases at random. What’s an efficient way to do this?” Before and after drawing our stratified […]

Sampling in SPSS

Sampling is at the very core of statistical tests: drawing conclusions on research populations based on (small) samples from those populations. Basically all statistical tests quietly assume that the data you’re analyzing are a simple random sample from your population. This assumption being ignored is the very reason why political polls are often widely off and research findings can’t be […]

Set Decimals for Output

Setting decimal places in SPSS output is not straightforward. A great option, however, is our Set Decimals for Output Tables Tool. An alternative is changing your variable formats. Finally, for full control, one needs Python Scripting or SaxBasic. 1. Changing Variable Formats The number of decimals in SPSS output basically depends on the combination of statistic, procedure and variable format. […]

Include Empty Categories in Output

Question “I have some empty categories in my data. For example, none of my respondents filled out “politician” as their job. Therefore, “politician” is completely absent from crosstabs. How can I include it with a zero frequency?” How to include an empty category in a crosstab? Solution The basic solution here is to add one […]

SPSS OMS Tutorial – Creating Data from Output

SPSS OMS (short for Output Management System) can convert your output to SPSS datasets. As we’ll demonstrate in a minute, this can save you huge amounts of time, effort and frustration. We recommend you follow along by downloading and opening course_evaluation.sav, part of which is shown below. Today’s Challenge Some client wants to see charts holding correlations of […]

SPSS Table Templates

Summary SPSS table templates are files that tell SPSS how to style one, many or all tables that appear in the output viewer window. Some examples of such styling are the colors and sizes of fonts and borders. The figure below shows a DESCRIPTIVES table with and without a table template applied to it. Just like SPSS data […]

SPSS Output Tricks

SPSS output usually looks terrible. However, it doesn’t have to: you can manually style your tables and charts in the output window. The styles you apply such as colors, borders and fonts can be saved as SPSS chart templates and SPSS table templates. These can easily be reapplied to future output. A little known trick -but a real life saver […]

SPSS – Opening Data with Syntax

There’s several ways to open SPSS data files. The right way, however, is by syntax. The way we typically do so in practice may differ somewhat from what you’re used to. But give it a shot. It keeps things nicely organized and this eventually saves time and effort. We’ll use employees.sav throughout. Creating a Project Folder […]

SPSS – Combining Data with Syntax and Output

SPSS Syntax, Data and Output The previous tutorials explored SPSS’ three main windows. These are SPSS Data Editor window ; SPSS Syntax Editor window ; SPSS output viewer window . Now that we have a basic understanding of what they’re for, let’s take a look at the big picture: the figure below proposes a typical flowchart for proceeding through a research […]

Five Reasons for Not Relying on the Journal File

Summary Some SPSS users argue that it’s not really necessary to work from syntax. If something goes wrong or a client doesn’t believe your results, you can always recover what you did from your journal file. However, the journal file is no reasonable substitute for syntax. This tutorial explains why. 1. Essential Modifications May be Missing Manual […]

SPSS Syntax Tutorials

You can use SPSS without using any syntax. However, this often results in users having to do their entire data analysis all over again at some point. Just don’t do it. The good news is that routinely using Paste instead of Ok gets you a long way. Do keep in mind that the syntax pasted by SPSS is usually unnecessarily long and complex. If you want to […]

SPSS Datetime Variables Tutorial

Introduction This tutorial shows how to work proficiently with SPSS datetime variables. You can follow along with it by downloading and opening hospital.sav. SPSS Main Datetime Functions This tutorial will cover the datetime functions outlined in the table below. Most of them apply to SPSS date variables and time variables as well because their values are stored in numbers of […]

SPSS Time Variables Tutorial

Having a solid understanding of what SPSS time variables are, you may find calculations on them surprisingly easy. This tutorial will demonstrate SPSS’ main time functions. However, we’ll also show that we often don’t even need them for getting things done. Throughout this tutorial, keep in mind that SPSS time variables contain time spans in numbers of […]

Time and Datetime Variables

SPSS date, time and datetime variables are shown in a nice and readable format such as “8-Jan-2013 16:56:10”. However, they all contain just numbers of seconds. This may sound daunting at first but soon turns out to make all sorts of time manipulations surprisingly easy. It also implies that most SPSS date functions can be used on date, time and datetime […]

Convert String Date to SPSS Date Variable

“I’ve a string variable in my data holding dates formatted as ‘01JAN2016’ without separators between the day, month and year components. To make things worse, the month abbreviations are in Dutch and 3 of those differ from their English counterparts. How can I change this string into an SPSS date variable?” Step 1: Add Separators […]

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