Hi,

I am unable to find a command that will give me the lag variable but will ignore the weekends or public holidays.

In short, what I have is

Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input double(id date price dayofweek)
1 16114 39 5
1 16115  . 6
1 16116  . 0
1 16117  . 1
1 16118 50 2
1 16119 17 3
end
format %tdMon_DD,_CCYY date
label values dayofweek dow
label def dow 0 "Sunday", modify
label def dow 1 "Monday", modify
label def dow 2 "Tuesday", modify
label def dow 3 "Wednesday", modify
label def dow 5 "Friday", modify
label def dow 6 "Saturday", modify


and what I want is the 1st lag of price as follows

Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input double(id date price dayofweek lag_price)
1 16114 39 5  .
1 16115  . 6  .
1 16116  . 0  .
1 16117  . 1  .
1 16118 50 2 39
1 16119 17 3 50
end
format %tdMon_DD,_CCYY date
label values dayofweek dow
label def dow 0 "Sunday", modify
label def dow 1 "Monday", modify
label def dow 2 "Tuesday", modify
label def dow 3 "Wednesday", modify
label def dow 5 "Friday", modify
label def dow 6 "Saturday", modify



Any help would be greatly appreciated. Thanks