Hi
Use the aggregate function (it's my new favorite function this month).
It will do just what you need. See ?aggregate and it explains the
arguments to use. Alternatively, parse out the year and month (as one
thing) into a new variable and use tapply. I think that since your data
is missing weekends, you may need to parse out the year and month anyway
even to use aggregate.
Cheers,
On Mon, 2006-04-24 at 03:38 +0800, Chen,Sichong wrote:
> Dear Users
>
> I have a 30 year time series daily return dataset, which excludes
> weekends but includes public holidays (from datastream). How can I
> easily get monthly average return from this time series dataset?
>
> Anyone has some good suggestions?
>
> Many thanks,
>
> Sichong
>
> SPlus 7.0 & FinMetrics 2.0 User
>
> Windows XP
>
--
======================================
Neil Hepburn, PhD Candidate
Department of Economics
University of Alberta
Edmonton, Alberta
email nhepburn@ualberta.ca
|