tabulation multiple

Discussions about tabulating data in the designer or in batch mode
Post Reply
maria

tabulation multiple

Post by maria »

Hello everyone:
I'm not able to do 3-dimensional tables, for example I need sex by marital status by age in line and not get that example:
I want: Sex
Maritalstatus
age
What is CSPro allows me
sex
Maritalstatus
age
I hope your help,
Thanks
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: tabulation multiple

Post by Gregory Martin »

Right now you can only cross a maximum of two dimensions. You have two ways to work around this limitation.

1) Add the third dimension as an "area" and enable area processing. For example you could add Sex as the area break and then create a Marital Status X Age table. Then, when you run this program (with a properly constructed area names file), you would get one table for each Sex.

2) Create a composite variable in the working storage dictionary. You could create a Sex X Marital Status variable, and then create a two-dimensional table, crossing that against Age. In the tabulation logic you would have to write logic to assign the correct values to the variable. For example, if Sex is 1 or Male, 2 for Female, and Marital Status is 1 for Not Married, 2 for Married, your working storage variable, SEX_MARST might have a value set like this:

Male, 1 - 2
Not Married, 1
Married, 2
Female, 3 - 4
Not Married, 3
Married, 4

Then your tabulation logic would be like this:
recode  SEX :   MARST   =>  SEX_MARST;
        
1   :   1       =>  1;
        
1   :   2       =>  2;
        
2   :   1       =>  3;
        
2   :   2       =>  4;
endrecode;
Post Reply