Wednesday 28 March 2012

Using R to compare FTSE 100 bank share price performance


Click picture for bigger image. I think R Function of the Day is a great blog for people learning R and I wanted to use the stockPortfolio package to compare share price performance. In particular I wanted to see how the Chancellor is protecting our public investments in RBS and Lloyds especially compared to other banks in the FTSE 100. As it turns out the worst performaning banks are RBS and Lloyds since Mr Osborne took office are the one's he's nominally responsible for. Code below:

 
> require(stockPortfolio)
> ticker<-c("RBS.L","STAN.L","LLOY.L","HSBA.L", "BARC.L")
> returns<-getReturns(ticker, "week", start="2010-05-12") 
> plot(returns, main="FTSE 100 Bank share price performance since Osborne became Chancellor")

No comments:

Post a Comment