Data editing > Examining records > Holecounts > Multiplied holecounts
 
Multiplied holecounts
Quick reference
To create a multiplied or weighted holecount, type:
count c(start_col, end_col) [$text$] c(m_start, m_end)
text is the holecount title and c(m_start,m_end) is the field in the C array containing the multiplier or weight for each record.
More information
In ordinary holecounts, the cells are counts of records: each time a record is read with a specific code in a given column, the relevant cell in the holecount is incremented by one. If 231 records have a 7 in column 79, the figure in that cell will be 231.
Holecounts can also be created by incrementing each cell by the value found in a column field in the record. This value is the record’s ‘multiplier’. If the multiplier is 15, and the record has a 6 in column 152, the count for c152’6’ is incremented by 15 rather than by 1 for this record. This type of holecount is sometimes referred to as a weighted holecount, because multiplying a record by a given value is the equivalent of weighting it.
Note If the multiplier is being calculated during the run, it must be placed in the C array using wttran before the holecount is requested. For further details on weighting and wttran, see Copying weights into the data.
A multiplied holecount is created using the count statement as shown below:
count c(m,n) [$text$] c(x,y)
c(m,n) is the field to be counted, text is the optional heading to be printed at the top of each page, and c(x,y) is the field containing the multiplier for the record. If this field contains a real number, it must be referenced as cx(x,y) otherwise the decimal point will be ignored (for example, 1.5 will be read as 15).
The number labeled TOTAL at the top of each page of output is no longer the total number of records in the data file, rather it is the number of records after each record has been multiplied by its multiplier. This is best illustrated by an example. If you are producing a holecount for c(20,30), and of the 50 respondents, 20 have a multiplier of 2.5, 15 have a multiplier of 2.6 and 15 have a multiplier of 3.0, the total at the top of the page will be 134 respondents, calculated as follows:
(20 ´ 2.5) + (15 ´ 2.6) + (15 ´ 3.0) = 134
Multipliers can be part of the original data file or they can be calculated during the edit. Both real and integer values are valid, even though the cell counts in the output will always be shown as whole numbers. This does not mean that you lose accuracy with real multipliers. Quantum stores the cell counts with as many decimal places as are necessary until the count is complete, whereupon it rounds all values ending in .49 or less down and all values ending in .5 or more up.
For example, you might write:
/* House owners have multiplier of 22.4
if (c104'2') cx(177,180):1=22.4; go to 10
/* Tenants have multiplier of 12.7;
/* Others have multiplier of 11.9
if (c104'3') cx(177,180):1=12.7; else; cx(177,180):1=11.9
10 continue
– - other statements – -
count c(101,180) $Multiplied Holecount – Card 1$ cx(177,180)
The figures used to create the multiplied holecount would then be 22.4, 12.7, or 11.9, depending upon the contents of c104 in each record. Suppose there are 27 home owners (that is, 27 people have c104’2’), the count for a ‘2’ in column 4 of card 1 would be 612.9 (that is, 27 x 22.4), which would appear in the output file as 613.
Other points to notice are:
Since you are copying a real number into a field of columns, use the notation cx to refer to the columns and follow them with the number of decimal places required.
Because the word count is written in lowercase, it may start in column 1. If it was written in uppercase, it would need to start in a column other than 1 to prevent it being read as a comment.
See also
Holecounts