Speaking Stata: Ordering or ranking groups of observations
Nicholas Cox
Stata Journal, 2021, vol. 21, issue 3, 818-837
Abstract:
Results for categorical variables may often be clearer if those variables are reordered or reranked, say, according to some measure of absolute or relative frequency or according to summaries of some other variable. Some graphical and tabulation commands have dedicated options serving that end. Otherwise, in practice a new order is often best achieved by creating a new variable holding the desired order using one or another egen function. There is usually a need to preserve the information in existing values or value labels and to watch out for ties. There may be a desire to reverse the direction of ranking from the default. I discuss procedures for datasets based on aggregate frequencies and for datasets based on individuals and introduce a new convenience command, myaxis, that handles many cases directly.
Keywords: myaxis; ordering; ranking; graphics; tabulation; categorical data; geometric means; confidence intervals; egen (search for similar items in EconPapers)
Date: 2021
Note: to access software from within Stata, net describe http://www.stata-journal.com/software/sj21-3/st0654/
References: Add references at CitEc
Citations:
Downloads: (external link)
http://www.stata-journal.com/article.html?article=st0654 link to article purchase
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:tsj:stataj:v:21:y:2021:i:3:p:818-837
Ordering information: This journal article can be ordered from
http://www.stata-journal.com/subscription.html
DOI: 10.1177/1536867X211045582
Access Statistics for this article
Stata Journal is currently edited by Nicholas J. Cox and Stephen P. Jenkins
More articles in Stata Journal from StataCorp LLC
Bibliographic data for series maintained by Christopher F. Baum () and Lisa Gilmore ().