Dear everyone, Would like to know how to add asterisks and arcs that indicate a subgroup comparison above box plots to denote statistical diference. Thank you. Andre [[alternative HTML version deleted]]
Hi Andre, You can do it manually like this: testmat<-matrix(rnorm(90),ncol=3) boxplot(testmat,ylim=c(-3,4)) library(plotrix) draw.arc(1.5,2,0.5,0,pi,col=1) draw.arc(2.5,2,0.5,0,pi,col=1) boxed.labels(c(1.5,2.5),c(3.3,3.3),c("**","***"),border=NA) Obviously you would have to nudge the arcs and labels around to match your plot. I don't know of a function that does this automatically. Also if your aspect ratio is far from 1, the arcs won't be circular. It is possible to write a function that will use the return values from boxplot to display rectangular brackets above the boxplots and then put the asterisks or whatever else you want on the top lines. Jim On Sat, Aug 15, 2015 at 5:46 AM, Andr? Luis Neves <andrluis at ualberta.ca> wrote:> Dear everyone, > > Would like to know how to add asterisks and arcs that indicate a subgroup > comparison above box plots to denote statistical diference. > > Thank you. > > Andre > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
Hi Andr?, You have not told us how you are creating the boxplots. See http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and http://adv-r.had.co.nz/Reproducibility.html for some suggestions on how to ask a question for the R-help list. John Kane Kingston ON Canada> -----Original Message----- > From: andrluis at ualberta.ca > Sent: Fri, 14 Aug 2015 13:46:38 -0600 > To: r-help at r-project.org > Subject: [R] Help > > Dear everyone, > > Would like to know how to add asterisks and arcs that indicate a subgroup > comparison above box plots to denote statistical diference. > > Thank you. > > Andre > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.____________________________________________________________ FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family! Visit http://www.inbox.com/photosharing to find out more!