[R-SIG-Finance] quantmod yearlyReturns differ in 2008 for google, yahoo?

Joshua Ulrich josh.m.ulrich at gmail.com
Sun Dec 5 21:48:55 CET 2010


Hi Dave,

On Sun, Dec 5, 2010 at 12:36 PM, David L. Van Brunt, Ph.D.
<dlvanbrunt at gmail.com> wrote:
> Hi.. I was just trying to familiarize myself with the quantmod package, and
> I didn't find any explanation for the following after searching:
>
quantmod provides a means to access the data.  It does not attempt to
understand or explain the differences between data sources.

>> getSymbols("VTI",src="google")
> [1] "VTI"
>> yearlyReturn(VTI)
>           yearly.returns
> 2007-12-31     0.02833664
> 2008-12-31    -0.38357674
> 2009-12-31     0.25994636
> 2010-12-03     0.12364733
>> getSymbols("VTI",src="yahoo")
> [1] "VTI"
>> yearlyReturn(VTI)
>           yearly.returns
> 2007-12-31     0.02833865
> 2008-12-31    -0.69176714
> 2009-12-31     0.25994636
> 2010-12-03     0.12364733
>
>
> Any idea why 2008 is so different?  I saw in the documentation that there
> were issues with Google data for 2003-- but I couldn't find a mention of an
> issue with 2008 there or in searches.
>
>From a cursory look at the data, it seems Google is adjusting the data
(for splits and/or dividends) while Yahoo does not.  Yahoo does
provide an adjusted close column though.

vtig  <- getSymbols("VTI",src="google",auto.assign=FALSE)
vtiy  <- getSymbols("VTI",src="yahoo", auto.assign=FALSE)
vtiya <- adjustOHLC(vtiy, use.Adjusted=TRUE)
head(vtig)
head(vtiy)
head(vtiya)

> Also, the Google Finance web page (http://www.google.com/finance?q=vti)
> shows the 2008 return to be -40.31%.. Closer to the Google data's return, to
> be sure, but still off.
>
> Is there something going on there that didn't make the docs (or at least my
> search of them)?
>
As I mentioned, quantmod doesn't attempt to explain the data.  I would
recommend you search the data provider's websites (Google and Yahoo).

> many thanks,
> -Dave
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
>



More information about the R-SIG-Finance mailing list