general zoo tutorial available?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

general zoo tutorial available?

Stephen J. Barr-2
Hello,

I am working on a dataset of some intraday data. I haven't used R for this
too much, so I have a few general questions.

1) What is the best way to structure the data? The CSV is from WRDS, ordered
by symbol and then by datetime. Should I dump this into 1 zoo object, or
have one zoo object per symbol?

2) The questions I would initially like to look at are:
for a given [minute, 2 minute interval, hour, etc], what was the total
volume, average volume, average price, etc. What is a good reference for
learning how to do these kinds of things?

3) What is the best way to plot these time series?

Thanks,
-stephen

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: general zoo tutorial available?

Gabor Grothendieck
On Wed, Dec 23, 2009 at 7:50 PM, Stephen J. Barr <[hidden email]> wrote:
> Hello,
>
> I am working on a dataset of some intraday data. I haven't used R for this
> too much, so I have a few general questions.
>
> 1) What is the best way to structure the data? The CSV is from WRDS, ordered
> by symbol and then by datetime. Should I dump this into 1 zoo object, or
> have one zoo object per symbol?

read.zoo can read such files creating a multivariate time series.
Note the aggregate argument.

>
> 2) The questions I would initially like to look at are:
> for a given [minute, 2 minute interval, hour, etc], what was the total
> volume, average volume, average price, etc. What is a good reference for
> learning how to do these kinds of things?

See the aggregation examples in the zoo-quickref vignette (and the
other two vignettes).

The xts package may also be of interest.

>
> 3) What is the best way to plot these time series?
>

See ?plot.zoo and and ?xyplot.zoo

The quantmod package may also be of interest.

> Thanks,
> -stephen
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: general zoo tutorial available?

Eric Zivot
In reply to this post by Stephen J. Barr-2
I would like to mention the nice free tutorial on time series objects in R
by the Rmetrics folks, available here

http://www.rmetrics.org/ebooks

There's lots of good stuff in this tutorial on both zoo, xts, timeSeries and
timeDate objects.

ez
-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Stephen J.
Barr
Sent: Wednesday, December 23, 2009 4:51 PM
To: [hidden email]
Subject: [R-SIG-Finance] general zoo tutorial available?

Hello,

I am working on a dataset of some intraday data. I haven't used R for this
too much, so I have a few general questions.

1) What is the best way to structure the data? The CSV is from WRDS, ordered
by symbol and then by datetime. Should I dump this into 1 zoo object, or
have one zoo object per symbol?

2) The questions I would initially like to look at are:
for a given [minute, 2 minute interval, hour, etc], what was the total
volume, average volume, average price, etc. What is a good reference for
learning how to do these kinds of things?

3) What is the best way to plot these time series?

Thanks,
-stephen

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: general zoo tutorial available?

Jeffrey Ryan
In reply to this post by Stephen J. Barr-2
The xts (a subclass of zoo) package has a comprehensive vignette as well:

http://cran.r-project.org/web/packages/xts/vignettes/xts.pdf

For general data manipulation and plotting of time-series in finance,
there are many examples on the quantmod site (of the package quantmod
and xts).

http://www.quantmod.com/examples/
http://www.quantmod.com/examples/data/
http://www.quantmod.com/examples/charting/

This list is quite an excellent way to see how people use the
zoo/xts/timeSeries/ etc.

Make some time to browse though some results on Nabble's archive:

http://n4.nabble.com/Rmetrics-f925806.html

HTH
Jeff


On Wed, Dec 23, 2009 at 6:50 PM, Stephen J. Barr <[hidden email]> wrote:

> Hello,
>
> I am working on a dataset of some intraday data. I haven't used R for this
> too much, so I have a few general questions.
>
> 1) What is the best way to structure the data? The CSV is from WRDS, ordered
> by symbol and then by datetime. Should I dump this into 1 zoo object, or
> have one zoo object per symbol?
>
> 2) The questions I would initially like to look at are:
> for a given [minute, 2 minute interval, hour, etc], what was the total
> volume, average volume, average price, etc. What is a good reference for
> learning how to do these kinds of things?
>
> 3) What is the best way to plot these time series?
>
> Thanks,
> -stephen
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



--
Jeffrey Ryan
[hidden email]

ia: insight algorithmics
www.insightalgo.com

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.
Reply | Threaded
Open this post in threaded view
|

Re: general zoo tutorial available?

Stephen J. Barr-2
These are all great suggestions. Thank you.

On Dec 23, 2009 6:51 PM, "Jeff Ryan" <[hidden email]> wrote:

The xts (a subclass of zoo) package has a comprehensive vignette as well:

http://cran.r-project.org/web/packages/xts/vignettes/xts.pdf

For general data manipulation and plotting of time-series in finance,
there are many examples on the quantmod site (of the package quantmod
and xts).

http://www.quantmod.com/examples/
http://www.quantmod.com/examples/data/
http://www.quantmod.com/examples/charting/

This list is quite an excellent way to see how people use the
zoo/xts/timeSeries/ etc.

Make some time to browse though some results on Nabble's archive:

http://n4.nabble.com/Rmetrics-f925806.html

HTH
Jeff

On Wed, Dec 23, 2009 at 6:50 PM, Stephen J. Barr <[hidden email]>
wrote:

> Hello, > > I am working on a dataset of some intraday data. I haven't used
R for this > too much, ...

>        [[alternative HTML version deleted]] > >
_______________________________________________ > ...
--
Jeffrey Ryan
[hidden email]

ia: insight algorithmics
www.insightalgo.com

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.