Thursday 13 January 2011

a very simple table using CTables


group Universe vs sample

1 Universe

2 Sample

Total Respondents

Column N %

Count

Column N %

Count

Column N %

Count

1 Female

53.0%

904

61.0%

153

54.0%

1057

2 Male

46.3%

789

39.0%

98

45.3%

887

Not specified

.7%

12

.0%

0

.6%

12


To get the above table use the following syntex:


CTABLES /TABLE gender2 by group [colpct count]
/CATEGORIES VARIABLES=group TOTAL=YES LABEL='Total Respondents'.

&


Main groups

Our big univ

our sample

Total

Column N %

Count

Column N %

Count

Column N %

Count


1 Female

53.0%

904

61.0%

153

54.0%

1057

2 Male

46.3%

789

39.0%

98

45.3%

887

3 Not specified

.7%

12

.0%

0

.6%

12

Total

100.0%

1705

100.0%

251

100.0%

1956


For the above, here is the syntax (notice the columns also have totals now):
CTABLES /TABLE gender2 by group [colpct count]
/CATEGORIES VARIABLES=group TOTAL=YES LABEL='Total Respondents'
/CATEGORIES VARIABLES= gender2 TOTAL=YES POSITION=AFTER.