Hi, I would like to make a box and whisker plot but use a sample weight for each observation. I've searched around a bit and have not found a method of doing this. Anyone have any advice? Thanks much, Sean Parks -- View this message in context: http://www.nabble.com/sample-weight-for-box-plot--tp26104205p26104205.html Sent from the R help mailing list archive at Nabble.com.
On Oct 28, 2009, at 8:00 PM, Sean Parks wrote:> > Hi, > > I would like to make a box and whisker plot but use a sample weight > for each > observation. I've searched around a bit and have not found a method > of > doing this. > > Anyone have any advice?There are a variety of ways to get weighted quantiles. Two that have come up in recent r-help postings are the facilities in the quantreg package and wtd.quantile in Hmisc. Once you have calculated the five numbers that define a box-whisker plot they can be passed to bxp. ?bxp>-- David Winsemius, MD Heritage Laboratories West Hartford, CT
David Winsemius wrote:> > On Jan 6, 2010, at 5:42 PM, sean_parks wrote: > >> bxp.data <- c(0,0.9,3.5,9.4,30.6) >> boxplot(bxp.data) > > Try: > > boxplot(bxp.data, range=5)or range=0 to draw whiskers to the data extremes (as mentioned in ?boxplot!) -Peter Ehlers> > > David Winsemius, MD > Heritage Laboratories > West Hartford, CT > > ______________________________________________ > R-help at 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. > >-- Peter Ehlers University of Calgary 403.202.3921