EconPapers    
Economics at your fingertips  
 

Speaking Stata: Rowwise

Nicholas Cox

Stata Journal, 2009, vol. 9, issue 1, 137-157

Abstract: Stata’s main data model treats observations in rows and variables in columns quite differently, but rowwise problems also arise that require working against the grain. This column shows how to exploit existing functions and egen functions when they exist and apply to such problems. It offers advice on how to build your own loops, egen functions, or programs when needed. Mata provides especially convenient tools for constructing many such functions and programs, centered on putting selected data into matrices and then processing each observation as a separate vector. Two programs, rowsort and rowranks, are formally published with this column.

Keywords: rowsort; rowranks; rows; functions; loops; egen; Mata; minimum; maximum; median; any; all; distinct values; sorting; ranking (search for similar items in EconPapers)
Date: 2009
References: View references in EconPapers View complete reference list from CitEc
Citations: View citations in EconPapers (3)

Downloads: (external link)
http://www.stata-journal.com/article.html?article=pr0046
http://www.stata-journal.com/software/sj9-1/pr0046/ (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:9:y:2009:i:1:p:137-157

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

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:9:y:2009:i:1:p:137-157