Date of a maximum/minimum
Posted: Fri May 21, 2010 1:10 am
Hi,
I think there was a post about this before but I can't find it. I want to find the date a maximum and minimum occur in a series for a given sample period, the only code I can come up with is
which seems a bit cumbersome. Do you have any better suggestions?
Thanks,
Javier
I think there was a post about this before but I can't find it. I want to find the date a maximum and minimum occur in a series for a given sample period, the only code I can come up with is
Code: Select all
smpl 1/1/2000 1/1/2002
%subsmpl=@pagesmpl
series max_abs=@max({%ser},%subsmpl)
series temp=@recode({%ser}=max_abs,max_abs,na)
string max_dt=@otod(@ifirst(temp))
Thanks,
Javier