当前位置: X-MOL 学术Stata J. Promot. Commun. Stat. Stata › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Speaking Stata: Concatenating values over observations
The Stata Journal: Promoting communications on statistics and Stata ( IF 3.2 ) Pub Date : 2020-03-24 , DOI: 10.1177/1536867x20909698
Nicholas J. Cox 1
Affiliation  

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.



中文翻译:

讲故事的状态:将值连接到观察值

在Stata中,通过添加字符串和egen函数concat()可以将字符串或其他值(可能带有多余的标点符号)连接或连接在一起,或将其连接到观察值中。在本专栏中,我讨论了将变量的值连接到观察值上的基本技术,强调了可以根据需要进行调整以适合变体的简单循环。通常,这种串联的字符串报告面板或纵向数据中每个人的资料或历史。这样的历史可以进一步分析。

更新日期:2020-03-24
down
wechat
bug