Tips 113:expand扩展样本

标签:
扩展样本财经 |
分类: 数据管理 |
【问题】
有时候不仅需要删数据,还需要按相应规则增加数据。
比如:怎么从左图到右图?
http://s9/middle/629bb758t7a558c792308&690113:expand扩展样本" TITLE="Tips
【方法】
expand
expand replaces each observation in the dataset with n copies of
the observation, where n is equal to the required expression
rounded to the nearest integer.
【例子】
use http://www.stata-press.com/data/r11/expandxmpl
list
expand n
list
*还有其他相关命令:
*expandcl — Duplicate clustered observations