Advanced tables and statistics > Other tabulation facilities > Sorting tables > Totals, statistics and manipulated elements in sorted tables > Sorted tables of means
 
Sorted tables of means
You can create a sorted table of means using just n25 and n12 statements. For example:
tab q1 banner;sort
l q1
n25;inc=c120;c=c120'1/7'
n12Mean;dec=2;sort
n25;inc=c121;c=c121'1/7'
n12Mean;dec=2;sort
n25;inc=c122;c=c122'1/7'
n12Mean;dec=2;sort
n25;inc=c123;c=c123'1/7'
n12Mean;dec=2;sort
An alternative is to use the means option on the tab statement. This example also uses op=3 to print the rank numbers under each cell:
tab q1 banner;means;sort;op=123
l q1
n10Base
n01First mean;c=c56'1/5';inc=c56
n01Second mean;c=c57'1/5';inc=c57
n01Third mean;c=c58'1/5';inc=c58
n01Fourth mean;c=c59'1/5';inc=c59
You can also create sorted summary tables of means, standard deviations and standard errors, where the row axis consists of blocks of these three elements for a number of different columns. The table is sorted on the means, but each mean needs to be followed by its own standard deviation. To solve this problem, create an include file with the basic specification and then include it as many times as necessary with the appropriate substitutions defined on the *include element. The specification in the include file might be as follows:
n12;inc=ca00;c=ca00'1/7'
n03&txt;&unl;sort
n12 Mean;dec=2;nodsp;sort
n17 Std. dev;dec=2;nodsp;subsort
n19 Std error;dec=2;nodsp;endsort
Tables produced
Absolutes/col percents
Table 5: What is there about this product
         that you think you would dislike?
 
                                     Total            London             Leeds            Cardiff            Glasgow
Total Respondents                      687               119               182                190                196      
 
FRAGRANCE (Net)                        107                 8                42                 26                 31
===============                       15.6%              6.7%             23.1%              13.7%              15.8%
 
 Dislike Fragrance                      26                 1                13                  3                 31
                                       1.2%              0.8%              7.1%               1.6%               4.6%
 
 Smells Artificial                       8                 -                 4                  2                  2
                                       1.2%                -               2.2%               1.1%               0.5%
 
 Fragrance Name not                      5                 -                 2                  2                  1
 Descriptive Enough                    0.7%                -               1.1%               1.1%               0.5%
 
 Other Fragrance                        10                 2                 3                  3                  2
 Comments                              1.5%              1.7%              1.6%               1.6%               1.0%
 
 Fragrance Intensity                    60                 5                21                 16                 18
 -------------------                   8.7%              4.2%             11.5%               8.4%               9.2%
 (Sub-Net)
 ---------
 
  Strong Overpowering                   44                 3                19                 13                  9
  Smell                                6.4%              2.5%             10.4%               6.8%               4.6%
 
  Weak Fragrance/ Not                    6                 2                 -                  1                  3
  Strong Enough                        0.9%              1.7%                -                0.5%               1.5%
 
  Other Fragrance                       11                 -                10                  3                  7
  Intensity Comments                   1.6%                -               5.5%               1.1%               3.6%
 
EFFICACY (Net)                          19                 -                10                  2                  7
==============                         2.8%                -               5.5%               1.1%               3.6%
 
 Doesn’t Work                           14                 -                 6                  2                  6
                                       0.9%                -               3.3%               1.1%               3.1%
 
 Other Efficacy Comments                 1                 -                 1                  -                  -
                                       0.7%                -               0.5%                 -                  -
 
 Freshening (Sub-Net)                    5                 -                 4                  -                  1
 --------------------                  0.7%                -               2.2%                 -                0.5%
 
  Doesn’t Freshen Room                   4                 -                 3                  -                  1
                                       0.6%                -               1.6%                 -                0.5%
 
  Other Freshening                       1                 -                 1                  -                  -
  Comments                             0.1%                -               0.5%                 -                  -
Absolutes/col percents
 
 
 
                                     Total            London             Leeds            Cardiff            Glasgow
 
 
MISCELLANEOUS
=============
 
  Doesn’t Last Long                    101                16                35                 29                 21
                                      14.7%             13.4%             19.2%              15.3%              10.7%
  Don’t Buy This Type of                79                 -                26                  5                 48
  Product                             11.5%                -              14.3%               2.6%              24.5%
 
  Difficult /                           67                13                16                 20                 18
  Inconvenient to Use                  9.8%             10.9%              8.8%              10.5%               9.2%
 
  Too Expensive                         62                 8                23                 11                 20
                                       9.0%              6.7%              7.1%               5.8%              10.2%
 
  Allergic to This Type                 37                 -                13                  5                 19
  of Product                           5.4%                -               7.1%               2.6%               9.7%
 
  More Expensive Than                   13                 -                 4                  7                  2
  Other Products                       1.9%                -               2.2%               3.7%               1.0%
 
  Prefer Other Types of                 12                 1                 3                  2                  6
  Product                              1.7%              0.8%              1.6%               1.1%               3.1%
 
  Might be Harmful /                     9                 1                 3                  1                  4
  React Chemically                     1.3%              0.8%              1.6%               0.5%               2.0%
 
  Other Miscellaneous                   13                 2                 4                  2                  5
  Comments                             1.9%              1.7%              2.2%               1.1%               2.6%
 
 
Nothing Disliked                       252                75                29                 98                 50
                                      36.7%             63.0%             15.9%              51.6%              25.5%
 
Don’t Know/ No Answer                   23                 2                 9                  7                  5
                                       3.3%              1.7%              4.9%               3.7%              26.3%
See also
Totals, statistics and manipulated elements in sorted tables