SPSS Tutorials

BASICS REGRESSION T-TEST ANOVA CORRELATION

Disaggregate Data

Introduction

Sometimes, one may start a project with aggregated data, weighted by a frequency variable. In some cases, though, disaggregating such data (creating n rows for a row with frequency n) may be desired.

SPSS Syntax Example

*1. Create test data.

data list free/gender employed frequency.
begin data
0 0 5 1 0 2 0 1 8 1 1 5
end data.

value labels gender 0 'Female' 1 'Male' / employed 0 'Unemployed' 1 'Employed'.

*2. Write disaggregated data file.

loop # = 1 to frequency.
xsave outfile = 'd:/temp/disaggregated.sav' / drop frequency.
end loop.

*3. Open disaggregated data file.

get file = 'd:/temp/disaggregated.sav'.

Notes

Previous tutorial: SPSS AGGREGATE Command

Next tutorial: SPSS Date Variables Basics

Let me know what you think!

*Required field. Your comment will show up after approval from a moderator.

This tutorial has 2 comments