library(Quandl)
AIG_2002_Today <- Quandl("GOOG/NYSE_AIG", start_date="2002-01-01", collapse="monthly", type="xts")
AIG_2002_2007 <- Quandl("GOOG/NYSE_AIG", start_date="2002-01-01", end_date="2007-12-31", collapse="monthly", type="xts")
AIG_2009_2012 <- Quandl("GOOG/NYSE_AIG", start_date="2009-01-01", end_date="2012-12-31", collapse="monthly", type="xts")
mean(AIG_2002_Today[,"Close"])
[1] 620.6963
mean(AIG_2002_2007[,"Close"])
[1] 1284.019
mean(AIG_2009_2012[,"Close"])
[1] 31.42438
plot(AIG_2002_Today[,"Close"], xlab = "Time", ylab = "Price", main = "AIG 2002 to today")
plot(AIG_2002_2007[,"Close"], xlab = "Time", ylab = "Price", main = "AIG 2002 to 2007")
hist(AIG_2002_2007[, "Close"], breaks = 7, xlab = "Price", ylab = "# of Months", main = "AIG 2002 to 2007")
hist(AIG_2009_2012[, "Close"], breaks = 7, xlab = "Price", ylab = "# of Months", main = "AIG 2009 to 2012")