Data editing > Examining records > Frequency distributions > Creating a frequency distribution
 
Creating a frequency distribution
Quick reference
To create a frequency distribution sorted in alphabetic and rank orders, type:
list variable [$text$]
variable is a column range, an integer, or a real value.
text is the heading to be printed at the top of each page. If no heading text is given, the heading ‘Frequency Distribution’ is used instead.
To produce a frequency distribution sorted in alphabetic order only, type lista instead of list. For a distribution sorted in rank order only, type listr instead of list.
More information
The list statement produces both the alphabetic and numerically-sorted distributions. To request an alphabetic distribution only, type:
lista c(m,n) [$text$]
and for a ranked distribution only, type:
listr c(m,n) [$text$]
Here are some examples:
listr c(107,108) $Contents of cols 7 and 8$
lista c(t1,t1+4) $First Set of Car Brands$
The first example produces a frequency distribution of the contents of c(107,108) sorted in numeric order; the second example generates a list of car brands which will be sorted in alphabetic order. Additionally, the example uses subscripts to represent the column numbers. If t1 has a value of 36, Quantum lists the values found in columns 36 to 40.
The rules for double quotes in the text are the same as for holecounts, that is, you must precede them with a backslash.
The list in the diagram below shows a frequency distribution for the column field c(123,125). It was created by the statement:
list c(123,125) $PRICE PAID$
Since it was run on a data file containing 200 respondents, the total is 200.
Start with the first table (the alphabetical sort). The figures in the column headed ‘string’ are the values found in columns 123 to 125, in this case, the price paid for a bottle of mineral water. The next column (item) shows how many times each code occurred in those columns; that is, how many people paid each price. You can see the actual number of people and also what percentage of the total sample that is. For example, 31 respondents paid 111p which is 15.5% of the total (200).
The columns labeled cumulative show accumulated totals and percentages for each value found. There are 86 respondents who paid between 111p and 114p, and these are 43.0% of the total respondents.
The second table shows exactly the same information presented in rank order, with the most frequently occurring value first. The example shows that this is 212, and that 41 respondents or 20.5% of all the respondents paid 212p for a bottle of mineral water.
Unlike count, if list is part of a loop, it will be executed once for each pass through the loop. All values found will be entered in the same list: Quantum does not create a separate listing for each pass through the loop.
PRICE PAID
Total = 200 Alphabetical Sort

string item cumulative

111 31 15.5% 31 15.5%
112 29 14.5% 60 30.0%
113 17 8.5% 77 38.5%
114 9 4.5% 86 43.0%
121 17 8.5% 103 51.5%
122 21 10.5% 124 62.0%
123 4 2.0% 128 64.0%
124 1 .5% 129 64.5%
211 3 1.5% 132 66.0%
212 41 20.5% 173 86.5%
213 1 .5% 174 87.0%
214 3 1.5% 177 88.5%
311 9 4.5% 186 93.0%
312 14 7.0% 200 100.0%

Number of categories = 14
Number of numeric items = 200
Sum of factors = 32218.00
Mean Value = 161.09
Std deviation = 67.97
PRICE PAID
Total = 200 Rank Sort

string  item  cumulative

212 41 20.5% 41 20.5%
111 31 15.5% 72 36.0%
112 29 14.5% 101 50.5%
122 21 10.5% 122 61.0%
113 17 8.5% 139 69.5%
121 17 8.5% 156 78.0%
312 14 7.0% 170 89.5%
311 9 4.5% 188 94.0%
123 4 2.0% 192 96.0%
211 3 1.5% 195 97.5%
214 3 1.5% 198 99.0%
124 1 .5% 199 99.5%
213 1 .5% 200 100.0%
See also
Frequency distributions