加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Tips 113:expand扩展样本

(2012-08-16 08:52:59)
标签:

扩展样本

财经

分类: 数据管理

【问题】

有时候不仅需要删数据,还需要按相应规则增加数据。

比如:怎么从左图到右图?
http://s9/middle/629bb758t7a558c792308&690113:expand扩展样本" TITLE="Tips 113:expand扩展样本" />

【方法】

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.  If the expression is less than 1 or equal to missing, it is interpreted as if it were 1, and the observation is retained but not duplicated.

【例子】

use http://www.stata-press.com/data/r11/expandxmpl

list

expand n

list

 

*还有其他相关命令:

*expandcl — Duplicate clustered observations

 

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有