ctables putting statistics as rows

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ctables putting statistics as rows

Art Kendall
I have
 4 scale (pct) variables   read2000 read2002 math2000 math2002
 a 2 value nominal variable schooltype

several nominal variables, school_size, region, urbanicity, etc.

I would like to get a table with 12 columns  6 variables under 2 schooltypes

and the statistics as additional rows.
(this is clearer if see in a fixed pitch font)
                            Type1                               Type2
                     read2000 read2002  math2000 math2002  read2000
read2002  math2000 math2002
size
   >= 300 total n         100      100       100      100       200
200       200      200
          valid n          90       95        91       89       190
185       188      193
          median          10%       11%       10%       9%
8%      7%        7%       8%
          min              0%        1%        0%       0%
0%      1%        0%       0%
          max             45%       43%        95%     43%        50%
50%       50%      51%

   <  300 total n
          valid n          90       95        91       89       190
185       188      193
          median          10%       11%       10%       9%
8%      7%        7%       8%
          min              0%        1%        0%       0%
0%      1%        0%       0%
          max             45%       43%        95%     43%        50%
50%       50%      51%

Region
   East   total n        150       150       150      150      210
210        210      210
          valid n          90       95        91       89       190
185       188      193
          median          10%       11%       10%       9%
8%      7%        7%       8%
          min              0%        1%        0%       0%
0%      1%        0%       0%
          max             45%       43%        95%     43%        50%
50%       50%      51%

   West   total n        140       140        140      140      204
204        204      204
          valid n          90       95        91       89       190
185       188      193
          median          10%       11%       10%       9%
8%      7%        7%       8%
          min              0%        1%        0%       0%
0%      1%        0%       0%
          max             45%       43%        95%     43%        50%
50%       50%      51%

Thanks in advance.

Art
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: ctables putting statistics as rows

Peck, Jon
If I understand what you are looking for, it is quite easy to do with Ctables.

Using the gui, drag your type variable to the columns and the size, region etc variables to the rows (you need to have the measurement level set correctly for this to work.  You can also change that on the fly by right-clicking in the variable list).

Now drag your scale variables to the columns and put them underneath the type variable(s).

In the Summary Statistics group box choose Rows as the Position.

Select the statistics you want from the Summary Stats subdialog.

You are done.

The gui would generate syntax something like this.  Notice that SLABELS POSITION=ROW moves the statistics into the rows.

CTABLES
  /VLABELS VARIABLES=cylinder mpg accel origin year DISPLAY=DEFAULT
  /TABLE origin + year BY cylinder > (mpg [MEAN, MEDIAN, MINIMUM, MAXIMUM, VALIDN F40.0] + accel [MEAN, MEDIAN, MINIMUM, MAXIMUM,
  VALIDN F40.0])
  /SLABELS POSITION=ROW
  /CATEGORIES VARIABLES=cylinder origin year ORDER=A KEY=VALUE EMPTY=INCLUDE.

HTH,
Jon Peck


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall
Sent: Samstag, 29. Juli 2006 15:41
To: [hidden email]
Subject: [SPSSX-L] ctables putting statistics as rows

I have
 4 scale (pct) variables   read2000 read2002 math2000 math2002
 a 2 value nominal variable schooltype

several nominal variables, school_size, region, urbanicity, etc.

I would like to get a table with 12 columns  6 variables under 2 schooltypes

and the statistics as additional rows.
(this is clearer if see in a fixed pitch font)
                            Type1                               Type2
                     read2000 read2002  math2000 math2002  read2000
read2002  math2000 math2002
size
   >= 300 total n         100      100       100      100       200
200       200      200
          valid n          90       95        91       89       190
185       188      193
          median          10%       11%       10%       9%
8%      7%        7%       8%
          min              0%        1%        0%       0%
0%      1%        0%       0%
          max             45%       43%        95%     43%        50%
50%       50%      51%

   <  300 total n
          valid n          90       95        91       89       190
185       188      193
          median          10%       11%       10%       9%
8%      7%        7%       8%
          min              0%        1%        0%       0%
0%      1%        0%       0%
          max             45%       43%        95%     43%        50%
50%       50%      51%

Region
   East   total n        150       150       150      150      210
210        210      210
          valid n          90       95        91       89       190
185       188      193
          median          10%       11%       10%       9%
8%      7%        7%       8%
          min              0%        1%        0%       0%
0%      1%        0%       0%
          max             45%       43%        95%     43%        50%
50%       50%      51%

   West   total n        140       140        140      140      204
204        204      204
          valid n          90       95        91       89       190
185       188      193
          median          10%       11%       10%       9%
8%      7%        7%       8%
          min              0%        1%        0%       0%
0%      1%        0%       0%
          max             45%       43%        95%     43%        50%
50%       50%      51%

Thanks in advance.

Art
Reply | Threaded
Open this post in threaded view
|

Re: ctables putting statistics as rows

Art Kendall
Thank you, that did it using the visual table builder

 /SLABELS POSITION=ROW

was all I had to add to the syntax.

Art



Peck, Jon wrote:

>If I understand what you are looking for, it is quite easy to do with Ctables.
>
>Using the gui, drag your type variable to the columns and the size, region etc variables to the rows (you need to have the measurement level set correctly for this to work.  You can also change that on the fly by right-clicking in the variable list).
>
>Now drag your scale variables to the columns and put them underneath the type variable(s).
>
>In the Summary Statistics group box choose Rows as the Position.
>
>Select the statistics you want from the Summary Stats subdialog.
>
>You are done.
>
>The gui would generate syntax something like this.  Notice that SLABELS POSITION=ROW moves the statistics into the rows.
>
>CTABLES
>  /VLABELS VARIABLES=cylinder mpg accel origin year DISPLAY=DEFAULT
>  /TABLE origin + year BY cylinder > (mpg [MEAN, MEDIAN, MINIMUM, MAXIMUM, VALIDN F40.0] + accel [MEAN, MEDIAN, MINIMUM, MAXIMUM,
>  VALIDN F40.0])
>  /SLABELS POSITION=ROW
>  /CATEGORIES VARIABLES=cylinder origin year ORDER=A KEY=VALUE EMPTY=INCLUDE.
>
>HTH,
>Jon Peck
>
>
>-----Original Message-----
>From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall
>Sent: Samstag, 29. Juli 2006 15:41
>To: [hidden email]
>Subject: [SPSSX-L] ctables putting statistics as rows
>
>I have
> 4 scale (pct) variables   read2000 read2002 math2000 math2002
> a 2 value nominal variable schooltype
>
>several nominal variables, school_size, region, urbanicity, etc.
>
>I would like to get a table with 12 columns  6 variables under 2 schooltypes
>
>and the statistics as additional rows.
>(this is clearer if see in a fixed pitch font)
>                            Type1                               Type2
>                     read2000 read2002  math2000 math2002  read2000
>read2002  math2000 math2002
>size
>   >= 300 total n         100      100       100      100       200
>200       200      200
>          valid n          90       95        91       89       190
>185       188      193
>          median          10%       11%       10%       9%
>8%      7%        7%       8%
>          min              0%        1%        0%       0%
>0%      1%        0%       0%
>          max             45%       43%        95%     43%        50%
>50%       50%      51%
>
>   <  300 total n
>          valid n          90       95        91       89       190
>185       188      193
>          median          10%       11%       10%       9%
>8%      7%        7%       8%
>          min              0%        1%        0%       0%
>0%      1%        0%       0%
>          max             45%       43%        95%     43%        50%
>50%       50%      51%
>
>Region
>   East   total n        150       150       150      150      210
>210        210      210
>          valid n          90       95        91       89       190
>185       188      193
>          median          10%       11%       10%       9%
>8%      7%        7%       8%
>          min              0%        1%        0%       0%
>0%      1%        0%       0%
>          max             45%       43%        95%     43%        50%
>50%       50%      51%
>
>   West   total n        140       140        140      140      204
>204        204      204
>          valid n          90       95        91       89       190
>185       188      193
>          median          10%       11%       10%       9%
>8%      7%        7%       8%
>          min              0%        1%        0%       0%
>0%      1%        0%       0%
>          max             45%       43%        95%     43%        50%
>50%       50%      51%
>
>Thanks in advance.
>
>Art
>
>
Art Kendall
Social Research Consultants