Market return for a day t-1
Posted: 25 September 2014 07:58 PM   [ Ignore ]
Newbie
Rank
Total Posts:  4
Joined  2014-06-14

Hi,

I am trying to calculate value weighed market returns for a previous day (t-1). I assume that I need to use a LAG function, however, I am not sure how to make sure that it picks up a value of a previous date and not the value from previous line as I have multiple observation for the same day.

This is what i think it should look like

date     vretx Lag(vretx)
2 04 2000     -5     .
2 04 2000     -5     .
4 04 2000     3     -5
4 04 2000     3     -5
5 04 2000     1       3

Thank you so much for your help!

Profile
 
 
Posted: 25 September 2014 08:07 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi snowflake,

check out this post; I think that will solve your problem: http://www.wrds.us/index.php/forum_wrds/viewthread/164/

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile