Showing posts with label boxplot. Show all posts
Showing posts with label boxplot. Show all posts

Thursday, April 4, 2013

creating voilin plot / box plot in Excel, using REcel (with KMggplot2 plugins)

See the related posts on RExcel (for basic, Excel 2003 and Excel 2007) for basic information.

We discussed how we can use RExcel in previous posts. By implementing RExcel we generate voilin plots (alternative to box plot in look)

(1) First load R and then R commander to see R menu in Excel (see previous posts)

(2) Following example uses dataset cabages from the R dataset library. Load the data.

(3) KMggplot2 (unlike other menus is not activated as such), you need to go to tools and then click Load Pug-ins and then select RcmdrPlugin.KMggplot2. It will promt you to restart Rcmcdr click OK. Now you can see a menu with KMggplot2 in your RExcel menus.


(4)  Now under KMggplot2 menu click Box plot / Voilin plot / Confidence interval. You can then choose volin or box plot. Pick X and Y variable. X variable can be more than one, if you want to create multi-faceted trallis plot.








So you got your volin plot.


You can produce boxplot instead, just change plot type (perhaps using different grouping structure):



Happy plotting !!

Wednesday, April 3, 2013

Scatter plot matrix in Excel (using RExcel) - plotting histograms or density plot with XY scatter plot

See the related posts on RExcel (for basic, Excel 2003 and Excel 2007) for basic information.

When there are large number of variables we want to see how they are distributed whereas how they are related with each other. Scatter plot matrix is greatway to do it.

(1) We will use the same data we used in previous post, please refere it too see how we can load data and work in RExcel (link is here).

(2) Under graphs menu click scatter plot matrix. Now select the variables you want to plot in scatter plot matrix. You can choose different distribution plots (eg. density, histogram, boxplot, Normal Q-Q plot, one dimensional scatter plot, or even nothing). You have choose whether to plot smoothed line or not. You can accept defaults. Let's say we select 7 variables (V1 to V7).

You can see the plots nicely arranged.

Here are with histogram, boxplot, normal Q-Q plot  in the center.







creating grouped box plot in Excel (using RExcel)

See the related posts on RExcel (for basic, Excel 2003 and Excel 2007) for basic information.

In previous posts we discussed about RExcel getting started, here is one example of implementation - on creating grouped bar plots.

Just for example, we will use already available data in lattice package. This excercise will also demostrate how you can load data from R library and visualized in excel.

Let's use the data barley from R library (lattice package). I put data in excel sheet using Data ->  read data data set in packages, package datasets and clicking barley dataset .


In excel sheet click get active dataframe. The you can see the data embedded in the excel sheet.


In this dataset we different varities grown in different sites in different years. The measured variable is yield. Let's produced plotts in different ways. Let's summarize the data in different way one way is to create boxplot and compare over sites or years etc.

From graphs menu click boxplot and then select variable (yield) and a grouping variable (site in this example).





Here are other grouping outputs (by year, by variety) you want to plot.



Happy plotting !!