Re: How to calculate mean score in summary tables

Posted by Jon Peck on
URL: http://spssx-discussion.165.s1.nabble.com/How-to-calculate-mean-score-in-summary-tables-tp5740461p5740462.html

Here's a start on this.  I didn't worry about the post computes.  I generated this from the CTABLES canvas, so it isn't as compact as it could be.
The trick is in the SLABELS and CLABELS subcommands.

CTABLES
  /TABLE BY T_Q32_1 [C][COUNT F40.0, TOTALS[COUNT F40.0, MEAN F40.2]] + T_Q32_2 [C][COUNT F40.0, 
    TOTALS[COUNT F40.0, MEAN F40.2]] + T_Q32_3 [C][COUNT F40.0, TOTALS[COUNT F40.0, MEAN F40.2]] + 
    T_Q32_4 [C][COUNT F40.0, TOTALS[COUNT F40.0, MEAN F40.2]] + T_Q32_5 [C][COUNT F40.0, TOTALS[COUNT 
    F40.0, MEAN F40.2]] + T_Q32_6 [C][COUNT F40.0, TOTALS[COUNT F40.0, MEAN F40.2]]
  /SLABELS POSITION=ROW
  /CLABELS COLLABELS=OPPOSITE
  /CATEGORIES VARIABLES=T_Q32_1 T_Q32_2 T_Q32_3 T_Q32_4 T_Q32_5 T_Q32_6 ORDER=A KEY=VALUE 
    EMPTY=INCLUDE TOTAL=YES POSITION=BEFORE.

On Mon, Apr 19, 2021 at 12:09 PM Satish <[hidden email]> wrote:
Hi There

Can someone help me to calculate mean score for attached table named "Mean
score placement" cell highlighted in yellow. I am able to calculate %
successfully but not able to calculate means. Here is syntax for your
reference.

Thanks in advance

Test.sav
<http://spssx-discussion.1045642.n5.nabble.com/file/t341630/Test.sav

Mean_score_placement.xlsx
<http://spssx-discussion.1045642.n5.nabble.com/file/t341630/Mean_score_placement.xlsx


CTABLES
    /VLABELS VARIABLES=T_Q32_1 T_Q32_2 T_Q32_3 T_Q32_4 T_Q32_5 T_Q32_6
DISPLAY=DEFAULT
    /PCOMPUTE &T2B= EXPR([4]+[5])
    /PCOMPUTE &B2B= EXPR([1]+[2])
    /PCOMPUTE &M3B= EXPR([3])
    /PPROPERTIES &T2B LABEL = "T2B"
    /PPROPERTIES &B2B LABEL = "B2B"
    /PPROPERTIES &M3B LABEL = "Rest Scale"
    /TABLE BY
(T_Q32_1[C]+T_Q32_2[C]+T_Q32_3[C]+T_Q32_4[C]+T_Q32_5[C]+T_Q32_6[C])
[COLPCT.COUNT F4.0 "%",TOTALS[COUNT"Base" F40.0]]
    /CLABELS COLLABELS=OPPOSITE
    /SLABELS POSITION=ROW
    /CATEGORIES VARIABLES=T_Q32_1 T_Q32_2 T_Q32_3 T_Q32_4 T_Q32_5 T_Q32_6
[1,2,3,4,5,&T2B,&B2B,&M3B] TOTAL=YES LABEL='Total' POSITION=BEFORE
    /TITLES
   TITLES="Summary Tables".





--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
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


--
Jon K Peck
[hidden email]

===================== 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