Open jo-fleck opened 5 years ago
It should be easy to add - see https://github.com/JuliaPlots/StatsPlots.jl/pull/232
Is this already implemented?
I just updated StatsPlots and tried
@df df boxplot(:var1, :var2, weights(:varweights))
No effect (also no error).
No it's not implemented yet, but take a look at the implementation in the PR.
The syntax, when it works, would be @df df boxplot(:var1, :var2, weights = :varweights)
, as we're using the Plots convention of using a keyword, rather than the StatsBase convention of dispatching on the weight vector.
Ah got it now. I'll have a look.
@mkborregaard I'll try to modify the boxplot code and submit a PR. Can I contact you if I have questions? (I haven't contributed to StatsPlots yet.)
Yes for sure, the easiest thing is to tag me here
I have household income data in each US state with household weights so that the income distribution is representative at the state level.
Is there a way to use weights with boxplot?
(I cannot multiply each income with the household weight before plotting because this would affect the value of the max and min.)
Thanks for hints and suggestions!