金田耕助 发表于 2013-10-2 22:54
劳烦大神再看一个程序
clear
set obs 10
这里可能至少两条命令有问题:
1.postfile pe a b c d e f using d:\data\my_post,replace
你电脑D盘中data文件夹里面是否有“my_post”这个数据文件?
2.qui repalce u=uniform()
这里用replace不妥,可以试着改为:
qui gen u=runiform()
金田耕助 发表于 2013-10-2 22:54
劳烦大神再看一个程序
clear
set obs 10
clear
set obs 10
postfile pe a b c d e f using e:\post,replace
forval i=1(1)100 {
qui gen u`i'=uniform()
qui egen x`i'=rank(u`i')
replace x`i'=x`i'-1
}
post pe (x1) (x2) (x3) (x4) (x5) (x6)
drop x*
postclose pe
use e:\post,clear