Abstract
Concatenation, or joining together, of strings or other values, possibly with extra punctuation such as spaces, is supported in Stata by addition of strings and by the egen function concat(), which concatenates values of variables within observations. In this column, I discuss basic techniques for concatenating values of variables over observations, emphasizing simple loops that can be tuned to suit variants as desired. Commonly, such concatenated strings report a profile or history of each individual within panel or longitudinal data. Such histories can then be analyzed further.
Author supplied keywords
Cite
CITATION STYLE
Cox, N. J. (2020). Speaking Stata: Concatenating values over observations. Stata Journal, 20(1), 236–243. https://doi.org/10.1177/1536867X20909698
Register to see more suggestions
Mendeley helps you to discover research relevant for your work.