[R] Weighted box or violin plots in Lattice?

Thomas Lumley tlumley at uw.edu
Sun May 8 22:50:21 CEST 2011


On Mon, May 9, 2011 at 6:35 AM, Deepayan Sarkar
<deepayan.sarkar at gmail.com> wrote:
> On Sat, May 7, 2011 at 1:55 AM, Raphael Mazor <raphaelm at sccwrp.org> wrote:
>> Is it possible to create weighted boxplots or violin plots in lattice?
>>
>> It seems that you can specify weights for panel.histogram() and
>> panel.densityplot(), but not for panel.bwplot or panel.violin().
>
> Not for panel.histogram() either.
>
> It's not immediately obvious how you would get weighted boxplots.

The way the survey world does it is to get weighted quantiles and work
from them, as in survey:::svyboxplot().  The only tricky decision is
what to do with outliers, since I haven't been able to think of any
good way of indicating weights on them.

   -thomas

-- 
Thomas Lumley
Professor of Biostatistics
University of Auckland



More information about the R-help mailing list