Sorting of Results in an MRSet using CTables

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

Sorting of Results in an MRSet using CTables

Georg Maubach-2
Hi All,

I need to sort the results from an CTABLES command containng an MRSet.
My command looks like this:

CTABLES
 /TABLE $MRSet [COLPCT.COUNT "Col. N %" F4.2, COUNT "Count" F8.0]
  BY Split1
 /CATEGORIES
  VARIABLES=$MRSet ORDER=D KEY=VALUE TOTAL=YES
 /CATEGORIES
  VARIABLES=Split1 [1,HSUBTOTAL='1 Cut1', 3,HSUBTOTAL='3 Cut3'] .

My result table looks like this:
                                                                Split1
                                        1 Cut1                  3 Cut3
                                        Col. N %        Count
Col. N %        Count
$MRSet  101 Item1               25              5               15
5
                103 Item2               25              7
23              7
                104 Item3               30              3
17              19
                201 Item4               10              9
25              3
                202 Item5               10              10
20              8
                Total                   100             34
100             42
(I hope the format of this table is kept by the mailing system! I made
the figures up. Table is only for illustration purposes!)

The question is: How can I tell SPSS that it shall sort the hole table
descending after the Col. N % of the data cut "3 Cut3"?

Bsst regards

Georg Maubach
Research Manager

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Sorting of Results in an MRSet using CTables

Albert-Jan Roskam
Hi Georg,

Did you try using OMS already? You could generate an OMS command that grabs the Ctable and puts it into a new dataset, then use SORT cases by col (d). ['col' will probably have another name in the 'OMSed' dataset].
Don't forget to put OMSEND after the CTABLES command.

Cheers!!
Albert-Jan

--- On Wed, 9/9/09, Georg Maubach <[hidden email]> wrote:

> From: Georg Maubach <[hidden email]>
> Subject: [SPSSX-L] Sorting of Results in an MRSet using CTables
> To: [hidden email]
> Date: Wednesday, September 9, 2009, 11:10 AM
> Hi All,
>
> I need to sort the results from an CTABLES command
> containng an MRSet.
> My command looks like this:
>
> CTABLES
>  /TABLE $MRSet [COLPCT.COUNT "Col. N %" F4.2, COUNT "Count"
> F8.0]
>   BY Split1
>  /CATEGORIES
>   VARIABLES=$MRSet ORDER=D KEY=VALUE TOTAL=YES
>  /CATEGORIES
>   VARIABLES=Split1 [1,HSUBTOTAL='1 Cut1',
> 3,HSUBTOTAL='3 Cut3'] .
>
> My result table looks like this:
>
>
>
>
> Split1
>
>
>         1 Cut1
>             3 Cut3
>
>
>         Col. N %
>   Count
> Col. N %        Count
> $MRSet  101 Item1
>      25
>       5
>      15
> 5
>                 103
> Item2
>    25
>     7
> 23              7
>                 104
> Item3
>    30
>     3
> 17              19
>                 201
> Item4
>    10
>     9
> 25              3
>                 202
> Item5
>    10
>     10
> 20              8
>
> Total
>    100
>    34
> 100             42
> (I hope the format of this table is kept by the mailing
> system! I made
> the figures up. Table is only for illustration purposes!)
>
> The question is: How can I tell SPSS that it shall sort the
> hole table
> descending after the Col. N % of the data cut "3 Cut3"?
>
> Bsst regards
>
> Georg Maubach
> Research Manager
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email]
> (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the
> command
> INFO REFCARD
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD