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(AIG_2002_Today[,"Close"])
[1] 48.43713
mean(AIG_2002_2007[,"Close"])
[1] 64.20097
mean(AIG_2009_2012[,"Close"])
[1] 28.68125
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")