Open snotskie opened 7 months ago
a snippet for how to implement this:
using KernelDensity
plot!(p,
kde((xvalues, yvalues)),
levels=[1], # this can be floats; by sending an array, its a list of which levels to show, not how many to show
color=groupColor,
cbar=false
)
maybe try 1/0.95
for the level value, trial and error it seems like a good amount to start with
some test images:
In https://github.com/snotskie/EpistemicNetworkAnalysis.jl/issues/58, I tested out ellipse confidence intervals.
Ellipses (and boxes) work best to give a sense of "where" the "stuff" of a normal distribution is.
However, ENA plotted points are commonly non-normal. (This is why we use non-parametric tests by default.) Moreover, the plotted points can come from multi-modal distributions. This makes finding the "where" of the distribution tricky when you want to go beyond the box around the mean.
For example, here is a KDE plot showing how, for one group in the data (High Chal.), the data could be illustrated by an ellipse fairly well, but the other group (Low Chal.) might be better described by multiple ellipses.
This can be done by using KDEs to draw a single level to approximate a non-normal 95% CI
https://stackoverflow.com/questions/35225307/set-confidence-levels-in-seaborn-kdeplot