Hey guys, i want to calculate the continuasly compounded returns for stock prices.
Formula for CCR: R_t = ln(P_t/P_{t-1})*100 With R: First i have to modify the vectors, so that they have the same length and we start at the second observation. log(GOOG1[-1]/GOOG1[1:length(GOOG1)-1])*100 That does work with normal vectors. My Questions: 1) I want to use this for stock prices. so i use: library(quantmod) getSymbols("GOOG",from="2011-11-01") GOOG1<-GOOG[,1] If i use my formula i get only the value "1" for every observation :( Thanks for your time and help! I appreciate it Regards Tonio -- View this message in context: http://r.789695.n4.nabble.com/Continuasly-Compunded-Returns-with-quantmod-data-tp4090014p4090014.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.