1 * Based on the tutorial at http://www.ats.ucla.edu/stat/spss/library/sp_pivot.htm.
2 data list list notable/sex tumor dose statistics (f1) data (f5.1).
4 /sex 0 'Female' 1 'Male'
5 /tumor 0 'Absent' 1 'Present' 2 'Total'
6 /dose 0 'Control' 1 'Low' 2 'Medium' 3 'High' 4 'Total'
7 /statistics 0 'Count' 1 'Tumor%'.
71 format sex tumor dose(f1).
72 *select if tumor=1 and statistics=1.
73 debug pivot /rows=sex tumor statistics/columns=dose/data=data.