EconPapers    
Economics at your fingertips  
 

Speaking Stata: More ways for rowwise

Nicholas Cox

Stata Journal, 2020, vol. 20, issue 2, 481-488

Abstract: A previous column (Cox, 2009, Stata Journal 9: 137–157) gave a review of methods for working rowwise in Stata. Here rows means observations in a dataset, and the concern is calculations in each observation with a bundle of variables. For example, a row mean variable can be generated as the mean of some numeric variables in each observation. This column is an update. It is briefly flagged that official Stata now has rowmedian() and rowpctile() functions for egen. The main focus is on returning which variable or variables are equal to the maximum or minimum in a row. The twist that requires care is that two or more variables can tie for minimum or maximum. That may entail a decision on what is to be recorded, such as all of them or just the first or last occurrence of an extreme.

Keywords: rows; functions; minimum; maximum; median; loops; egen (search for similar items in EconPapers)
Date: 2020
References: Add references at CitEc
Citations:

Downloads: (external link)
http://www.stata-journal.com/article.html?article=pr0046_1 link to article purchase
http://www.stata-journal.com/software/sj20-2/pr0046_1/ (text/html)

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:20:y:2019:i:2:p:481-488

Ordering information: This journal article can be ordered from
http://www.stata-journal.com/subscription.html

DOI: 10.1177/1536867X20931007

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 ().

 
Page updated 2025-03-29
Handle: RePEc:tsj:stataj:v:20:y:2019:i:2:p:481-488