Ch 5 - AIG source yahoo

Load data AIG

library(Quandl)
AIG_2002_Today <- Quandl("YAHOO/AIG", start_date="2002-01-01", collapse="monthly", type="xts")

AIG_2002_2007 <- Quandl("YAHOO/AIG", start_date="2002-01-01", end_date="2007-12-31", collapse="monthly", type="xts")

AIG_2009_2012 <- Quandl("YAHOO/AIG", start_date="2009-01-01", end_date="2012-12-31", collapse="monthly", type="xts")

mean series

mean(AIG_2002_Today[,"Close"])
[1] 48.43713
mean(AIG_2002_2007[,"Close"])
[1] 64.20097
mean(AIG_2009_2012[,"Close"])
[1] 28.68125

Time Series 2002 to today source yahoo

plot(AIG_2002_Today[,"Close"], xlab = "Time", ylab = "Price", main = "AIG 2002 to today")

plot of chunk unnamed-chunk-5

Time Series 2002 to 2007 source yahoo

plot(AIG_2002_2007[,"Close"], xlab = "Time", ylab = "Price", main = "AIG 2002 to 2007")

plot of chunk unnamed-chunk-6

Histogram 2002 to 2007

hist(AIG_2002_2007[, "Close"], breaks = 7, xlab = "Price", ylab = "# of Months", main = "AIG 2002 to 2007")

plot of chunk unnamed-chunk-7

Histogram 2002 to 2007 from book

alt text

Histogram 2009 to 2012

hist(AIG_2009_2012[, "Close"], breaks = 7, xlab = "Price", ylab = "# of Months", main = "AIG 2009 to 2012")

plot of chunk unnamed-chunk-8