Redefining a base
Tables can contain several base elements. The most common occurrence of a second or redefined base is in preference tables as in the example above. Percentages for the products themselves are calculated using the number of respondents eligible for inclusion in the table, while percentages for the reasons for preference are generated using the number of people preferring that product as a base.
You can also have the reasons for preference percentaged against the table base. This is done with the option
op=6 on the
a,
flt or
tab statement. For more information about output types, see
Output options.
When the two sets of percentages are printed, the percentage against the redefined base (for example, all preferring product A) will be printed on the line immediately beneath the absolute figures, with the percentages against the table base on the line below.
The table below provides an example. The table is created by the statement:
tab pref region;op=126
pref is as follows:
l pref
col 145;Base;hd=Product Preferred;Brand A;Brand B;Brand C
n00;c=c145'1'
col 146;Base=All Preferring A;Cleans Better;Pleasant Smelling;
+Lots of Bubbles; ...
n00;c=c145'2'
col 146;Base=All Preferring B; ....
Detergent Survey Page 13 Absolutes/Col Percentages Base: All Respondents Region Base North South East West ---- ----- ----- ---- ---- Base 282 78 81 57 66 Product Preferred Brand A 110 37 42 21 10 39.0% 47.4% 51.9% 36.8% 15.2%
Brand B 95 15 28 15 37 33.7% 19.2% 34.6% 26.4% 56.1%
Brand C 77 26 11 21 19 27.3% 33.4% 13.5% 36.8% 28.7%
All Preferring A 110 37 42 21 10
Cleans Better 50 13 20 11 6 45.5% 35.1% 47.6% 52.4% 60.0% 17.7% 16.7% 24.7% 19.3% 9.1%
Pleasant Smelling 27 9 12 5 1 54.0% 24.3% 28.6% 23.8% 10.0% 9.6% 11.5% 14.8% 8.8% 1.5%
Lots of Bubbles 33 15 10 5 3 30.0% 40.6% 23.8% 23.8% 30.0% 11.7% 19.2% 12.4% 8.8% 4.5%
All Preferring B 95 15 28 15 37 . |
There are several minor variations which would work just as well: for example, in place of the
n00s and the Base parameters on the
col statements you could use
n10s with conditions on them. However, this would mean replacing the
cols with separate
n01s for each element and adding the condition to each of those statements as well. Alternatively, since the same
col statement applies to all brands and the
n00 is almost the same, you could put them in a separate file and include it in the relevant places with an
*include statement. For more information about the inclusion of files in this way, see
Include and substitution.
See also