Abstract
Five methods for forming empirical frequency distributions are outlined. A specific implementation of each is described, and theoretical comparison of their speed and storage is supplemented by simulation data to give a series of recommendations about the appropriateness of each for different situations. The index method is the fastest of those considered, but often uses excessive space. A method based on height-balanced trees is economical of space, and still has good speed. A method based on Quicksort is faster than the tree method, but uses more space.
Similar content being viewed by others
References
Agresti, A. and Wackerly, D. (1977) Some exact conditional tests of independence forR×C cross classification tables.Psychometrika,42, 111–125.
Baker, R. J. (1977) Exact distributions derived from two way tables.Applied Statistics,26, 199–206.
Dewey, M. E. (1986) Height balanced trees.Applied Statistics,35, 220–226.
Dewey, M. E. (1989) A remark on AS131: Tabulating frequency distributions for variables with structured code sets.Applied Statistics,38, 582.
Freeman, P. R. (1970) Ranking an array of numbers.Applied Statistics,19, 111–113.
Kernighan, B. W. and Plauger, P. J. (1976)Software Tools, Addison-Wesley, Reading, MA.
Knuth, D. E. (1973)The Art of Computer Programming: Volume 3: Sorting and Searching, Addison-Wesley, Reading, MA.
Leathers, B. L. (1977) Tabulating sparse frequency distributions.Applied Statistics,26, 364–368.
Leathers, B. L. (1978) Tabulating frequency distributions for variables with structured code sets.Applied Statistics,27, 359–362.
Royston, J. P. and Altman, D. G. (1988) Number tally.Applied Statistics,37, 285–290.
Wichman, B. A. and Hill, I. D. (1982) An efficient and portable pseudo-random number generator.Applied Statistics,31, 188–190.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Dewey, M.E. Algorithms for frequency distributions: efficiency and generality comparisons. Stat Comput 2, 213–220 (1992). https://doi.org/10.1007/BF01889681
Received:
Accepted:
Issue Date:
DOI: https://doi.org/10.1007/BF01889681