Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I also think chart.Boxplot is the best option, it gives you the position of the mean but if you have a matrix with returns all you need is one line of code to get all the boxplots in one graph. </p> <p>Here is a small ETF portfolio example.</p> <pre><code>library(zoo) library(PerformanceAnalytics) library(tseries) library(xts) VTI.prices = get.hist.quote(instrument = "VTI", start= "2007-03-01", end="2013-03-01", quote = c("AdjClose"),provider = "yahoo",origin ="1970-01-01", compression = "m", retclass = c("zoo")) VEU.prices = get.hist.quote(instrument = "VEU", start= "2007-03-01", end="2013-03-01", quote = c("AdjClose"),provider = "yahoo",origin ="1970-01-01", compression = "m", retclass = c("zoo")) VWO.prices = get.hist.quote(instrument = "VWO", start= "2007-03-01", end="2013-03-01", quote = c("AdjClose"),provider = "yahoo",origin ="1970-01-01", compression = "m", retclass = c("zoo")) VNQ.prices = get.hist.quote(instrument = "VNQ", start= "2007-03-01", end="2013-03-01", quote = c("AdjClose"),provider = "yahoo",origin ="1970-01-01", compression = "m", retclass = c("zoo")) TLT.prices = get.hist.quote(instrument = "TLT", start= "2007-03-01", end="2013-03-01", quote = c("AdjClose"),provider = "yahoo",origin ="1970-01-01", compression = "m", retclass = c("zoo")) TIP.prices = get.hist.quote(instrument = "TIP", start= "2007-03-01", end="2013-03-01", quote = c("AdjClose"),provider = "yahoo",origin ="1970-01-01", compression = "m", retclass = c("zoo")) index(VTI.prices) = as.yearmon(index(VTI.prices)) index(VEU.prices) = as.yearmon(index(VEU.prices)) index(VWO.prices) = as.yearmon(index(VWO.prices)) index(VNQ.prices) = as.yearmon(index(VNQ.prices)) index(TLT.prices) = as.yearmon(index(TLT.prices)) index(TIP.prices) = as.yearmon(index(TIP.prices)) Prices.z=merge(VTI.prices, VEU.prices, VWO.prices, VNQ.prices, TLT.prices, TIP.prices) colnames(Prices.z) = c("VTI", "VEU", "VWO" , "VNQ", "TLT", "TIP") returnscc.z = diff(log(Prices.z)) start(returnscc.z) end(returnscc.z) colnames(returnscc.z) head(returnscc.z) </code></pre> <p>Return Matrix</p> <pre><code>ret.mat = coredata(returnscc.z) class(ret.mat) colnames(ret.mat) head(ret.mat) </code></pre> <p>Box Plot of Return Matrix </p> <pre><code>chart.Boxplot(returnscc.z, names=T, horizontal=TRUE, colorset="darkgreen", as.Tufte =F, mean.symbol = 20, median.symbol="|", main="Return Distributions Comparison", element.color = "darkgray", outlier.symbol = 20, xlab="Continuously Compounded Returns", sort.ascending=F) </code></pre> <p>You can try changing the mean.symbol, and remove or change the median.symbol. Hope it helped. :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload