我已经弄出来这个了。找了半天,,最后用了"proc surveyselect". Bootstrap从来没在sas里面做过。。所以从来没用过这个。<div><br/><div>我目前在做event study 的工作,学econometrics的人应该知道。</div><div>我的真实数据是market index 和 stock price 两个file, market index是每天都有的,而stock price则是,如果哪天没有trading,则data不记录在file里。所以在merge这个两个data的时候一般的方法只会选择存在于stock price file里的日子,而不是"everyday match"。如果stock price里面只有一个stock还好说,问题是一个stock price file 里面有几十个不同的stock。 </div><div><br/></div><div>so i used "proc surveyselect". maybe not that efficient, but jst got the results anyways.. So if anyone knows anything about merge these two better, please let me know. </div><div><br/></div><div>So the "everyday match" problem resovled, the new problem coming along</div><div>Once i got the new file with everyday match, the days originally not recorded in the file appear missing values such as. </div><div>day $</div><div>0 2</div><div>1 3</div><div>2 .</div><div>3 .</div><div>4 5</div><div>5 .</div><div>6 4</div><div><div><br/></div><div>the stock return is calculated by ln(P(t)/P(t-n)). </div><div>If you know about trade-to-trade return calculation procedure, then u know I have to count each return interval n. </div><div>so from day 1 to day 4, the return interval is n=3, and from day4 to day6, the return interval n=2. </div><div><br/></div><div>Missing Value 的问题也解决了。。我的方法是 n = _n_; if missing($) then missing = 1; if missing = . then lagn = lag(n);</div><div><div>day $ n missing lagn n-lagn</div><div>0 2 1 . . .</div><div>1 3 2 . 1 1</div><div>2 . 3 1 . .</div><div>3 . 4 1 . .</div><div>4 5 5 . 2 3</div><div>5 . 6 1 . .</div><div>6 4 7 . 5 2</div><div><br/></div><div>感觉上是对的。。不过还请大家帮忙看看。。谢谢。 </div></div><div><br/></div><div><br/></div></div></div>
[此贴子已经被作者于2009-1-19 15:59:33编辑过]