# CTABLES

6 messages
Open this post in threaded view
|
Report Content as Inappropriate

## CTABLES

 Will be grateful if  anybody  can help resolve this : Table 1 below was produced using the following syntax : * Custom Tables. CTABLES   /VLABELS VARIABLES=Var1 Var2 Var3 DISPLAY=DEFAULT   /TABLE Var1 > Var2 [COUNT F40.0, LAYERPCT.COUNT PCT40.1] BY Var3 . Table 1 Var1    Var2    Var3                 #       % a       m       10      13.5         f       12      16.2 b       m       23      31.1         f       8       10.8 c       m       9       12.2         f       12      16.2 Total           74      100.0 From the table , we see that  % = (10/74)*100 , (12/74)*100   ................ etc  My question is , what modification to the syntax above is needed to get Table 2 I have a winding way of getting to Table 2 but wondering if it is possible to use CTABLES to achieve same results. Table 2                 Var3 Var1    Var2    #       % a       m       10      23.8         f       12      37.5 b       m       23      54.8         f       8       25.0 c       m       9       21.4         f       12      37.5 Total   m       42      56.8         f       32      43.2 For Table 2 , % m = (10/42)*100 , (23/42)*100 , (9/42)*100  and            %f = (12/32)*100  -------- etc Regards. Edward
Open this post in threaded view
|
Report Content as Inappropriate

## Re: CTABLES

 Nana, your syntax gave me % as listed in column X of the table below , here % of  M & F sum to 100 in each group of Var1. This is not what I want. I want the  output shown in column Y . Here  % of M is  count of M in each group of Var1 divided total count of M in the population.     Table 1                           Var1     Var2    Var3    X (From Your Syntax)    Y(Expected)                  #       %       % a        m       10      =(10/22)*100=45     (10/42)*100=24          f       12      =(12/22)*100=55     (12/32)*100=38                                   b        m       23      74      55          f       8       26      25                                   c        m       9       43      21          f       12      57      38                                   Total   m        42      57      57          f       32      43      43     Thanks     -----Original Message----- From: Nana Nadine [mailto:[hidden email]] Sent: Tuesday, June 20, 2006 12:14 PM To: Edward Boadi Subject: Re: CTABLES Try this and adjust it if you need to. * Custom Tables. CTABLES /VLABELS VARIABLES=VAR00003 VAR00001 VAR00002 DISPLAY=DEFAULT /TABLE VAR00001 > VAR00002 BY VAR00003 [COUNT F40.0, COLPCT.COUNT PCT40.1] /CATEGORIES VARIABLES=VAR00001 ORDER=A KEY=VALUE EMPTY=EXCLUDE TOTAL=YES POSITION=AFTER /CATEGORIES VARIABLES=VAR00002 ORDER=A KEY=VALUE EMPTY=EXCLUDE. Edward Boadi <[hidden email]> wrote: Will be grateful if anybody can help resolve this : Table 1 below was produced using the following syntax : * Custom Tables. CTABLES /VLABELS VARIABLES=Var1 Var2 Var3 DISPLAY=DEFAULT /TABLE Var1 > Var2 [COUNT F40.0, LAYERPCT.COUNT PCT40.1] BY Var3 . Table 1 Var1 Var2 Var3 # % a m 10 13.5 f 12 16.2 b m 23 31.1 f 8 10.8 c m 9 12.2 f 12 16.2 Total 74 100.0 From the table , we see that % = (10/74)*100 , (12/74)*100 ................ etc My question is , what modification to the syntax above is needed to get Table 2 I have a winding way of getting to Table 2 but wondering if it is possible to use CTABLES to achieve same results. Table 2 Var3 Var1 Var2 # % a m 10 23.8 f 12 37.5 b m 23 54.8 f 8 25.0 c m 9 21.4 f 12 37.5 Total m 42 56.8 f 32 43.2 For Table 2 , % m = (10/42)*100 , (23/42)*100 , (9/42)*100 and %f = (12/32)*100 -------- etc Regards. Edward Nadine Nana 404 805 6209   _____   Want to be your own boss? Learn how on Yahoo!   Small Business.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: CTABLES

Open this post in threaded view
|
Report Content as Inappropriate

## Re: CTABLES

Open this post in threaded view
|
Report Content as Inappropriate