.
We recommend that when you write new Quantum specifications, you handle hierarchical data by using analysis levels. When you do that you do not need to use clear=. However clear= is retained in Quantum for backwards compatibility.Quick Reference
To reset cells in Quantum’s intermediate file when the data contains trailer cards which are not analyzed with levels, type:
clear=logical expression on the l statement.
When we talked about tabulating data using levels, we said that cells are normally reset in the intermediate file when a new respondent is read in or between reads when the data contains trailer cards. If you are using analysis levels, the time at which these cells are updated can be altered using
anlev and uplev. If you are not using levels, you can achieve the same effect using the option: clear=logical expression
on the l statement. This causes the cells in the intermediate table to be reset only when the given logical expression is true. If you want to reset these cells for each new respondent, rather than for each record or read, enter the option as:
clear=firstread
If we take the axis Sex as we did when we explained analysis levels, you can see that both clear= and anlev produce the same results. If we write our axis as:
l sex;clear=firstread col 10;Base;Male;Female
and take a household of three men and a woman, the intermediate table would read: Record 1, Person 1 – Male 10
Person 3 – Female 11 Person 4 – Male 11
Record 2, Person 1 – Female 01
Quantum User’s Guide Volume 3
Dealing with hierarchical data – Chapter 3 / 65
The first cell of Sex is switched on when a household containing a man is found. It remains on until
all data for that household has been processed. If a household also contains a woman, the cell for Female is switched on and is not reset until the next record’s data is read in. If a household contains
both men and women, both cells are switched on.
Once the first card of the next record is read, the reserved variable firstread is 1 (true), so both cells
will be reset to zero ready for the next household.
When axes which use clear are tabulated, the reserved variable lastread may be used in a condition
on the tab statement so that the cells in the final table are only incremented when all cards for a respondent have been read.
A major use of this facility is in the production of Penetration or Profile tables on trailer card data.
As the trailer cards are read, the intermediate table is updated to build a profile of the respondent. Cells in the printed table are incremented only when all trailer cards for a respondent have been processed.
In the example below two tables are being produced: the first shows the number of products bought,
the second shows the number of products bought per respondent. Card 1 contains demographic data
and card 2 (a trailer card) gives details of the items bought.
tab items brk
ttlBase = Number of Products Bought by Respondent tab resps brk;c=lastread
ttlBrands of Product Bought ttlBase = All Respondents l brk col 108;Base;hd=Class;AB;C1;C2;DE l items col 210;Base;hd=Brand;A;B;C;D l resps;clear=firstread.eq.1 col 210;Base;hd=Brand;A;B;C;D
As you can see, the elements of items and resps are exactly the same — they are the brands bought.
The difference is in the l statement which names the axis and defines its conditions. Items is just a straightforward axis whose cells in the intermediate table will be reset to zero between reads. Any tables produced with this axis will be a count of the number of times each brand was bought by respondents in each class. If the cell created by the intersection of Brand B and Class DE contained
the number 52, this would mean that Brand B was bought 52 times by class DE respondents. This may mean that 52 respondents bought that brand once each or that 20 respondents bought it, with some buying it more than once.
Quantum User’s Guide Volume 3
66 / Dealing with hierarchical data – Chapter 3
intermediate table should only be reset to zero when a new respondent is reached. This means that these cells will contain respondent profiles — that is, they will tell us whether or not a respondent bought a particular brand at any time; they will not show the number of times he or she bought each
one.
The tab statement using this axis has the condition c=lastread.eq.1 meaning that the table itself is not to be updated until all data for a respondent has been read. The cells in this table will tell us how many respondents in each class bought each brand. This time, if the cell created by the intersection of Brand B and Class DE contains the value 52 it will be because 52 class DE
respondents bought brand B at least once.
Descriptive statistics – Chapter 4 / 67
4 Descriptive statistics
Quantum provides facilities for calculation of a set of basic statistics from the figures produced in Quantum tabulations. They include the statistics most commonly used for testing hypotheses about
the values of proportions (percentages) and the locations (average values) of variables, and about differences in these between two or more subsets of the data. There are also chi-squared statistics for testing hypotheses about a single distribution or about differences between two or more distributions.
The statistical tests available are:
• One-dimensional, two-dimensional and single classification chi-squared tests. • Four tests of differences between proportions (Z-tests).
• Two tests of differences between means (T-tests).
• Friedman’s test of differences in location between a set of related samples (sometimes known as ‘Friedman’s two-way analysis of variance’).
• Kolmogorov-Smirnov test of differences between two samples. • McNemar’s test of the significance of changes.
• F Test for testing differences between a set of means (one-way analysis of variance (ANOVA)). • Newman Keuls test of differences between means.
For each statistic, Quantum also calculates and prints an associated significance level so that you can readily see the results of the tests you have performed.
.
In addition to the statistical tests described in this chapter, Quantum provides a number of other statistical functions.+
For further information, see chapter 5, ‘Statistical functions and totals’ in the Quantum User’s Guide Volume 2, and chapter 5, ‘Z, T and F tests’ and chapter 7, ‘Special T statistics’ in this volume.Quantum User’s Guide Volume 3 68 / Descriptive statistics – Chapter 4