Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dabest/_effsize_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ def plot(
group_summaries : ['mean_sd', 'median_quartiles', 'None'], default "mean_sd".
Plots the summary statistics for each group. If 'mean_sd', then
the mean and standard deviation of each group is plotted as a
notched line beside each group. If 'median_quantiles', then the
notched line beside each group. For proportion and Sankey plots, this error is the binomial standard error (BSE), sqrt(p(1-p)/n), not the SD. If 'median_quantiles', then the
median and 25th and 75th percentiles of each group is plotted
instead. If 'None', the summaries are not shown.
fig_size : tuple, default None
Expand Down
7 changes: 3 additions & 4 deletions dabest/plot_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def error_bar(
data: pd.DataFrame, # This DataFrame should be in 'long' format.
x: str, # x column to be plotted.
y: str, # y column to be plotted.
type: str = "mean_sd", # Choose from ['mean_sd', 'median_quartiles']. Plots the summary statistics for each group. If 'mean_sd', then the mean and standard deviation of each group is plotted as a gapped line. If 'median_quantiles', then the median and 25th and 75th percentiles of each group is plotted instead.
type: str = "mean_sd", # Choose from ['mean_sd', 'median_quartiles']. Plots the summary statistics for each group. If 'mean_sd', then the mean and standard deviation of each group is plotted as a gapped line. For proportion and Sankey plots, the error shown is the binomial standard error (BSE), sqrt(p(1-p)/n), rather than the SD. If 'median_quantiles', then the median and 25th and 75th percentiles of each group is plotted instead.
offset: float = 0.2, # Give a single float (that will be used as the x-offset of all gapped lines), or an iterable containing the list of x-offsets.
ax=None, # If a matplotlib Axes object is specified, the gapped lines will be plotted in order on this axes. If None, the current axes (plt.gca()) is used.
line_color="black", # The color of the gapped lines.
Expand All @@ -85,11 +85,10 @@ def error_bar(
):
"""
Function to plot the standard deviations as vertical errorbars.
For proportion and Sankey plots, the vertical bars instead show the
BSE of the proportion.
The mean is a gap defined by negative space.

This function combines the functionality of gapped_lines(),
proportional_error_bar(), and sankey_error_bar().

"""

if gap_width_percent < 0 or gap_width_percent > 100:
Expand Down
2 changes: 1 addition & 1 deletion nbs/02-about.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"\n",
"- Statistics supervision by Hyungwon Choi\n",
"\n",
"- Alpha testers from the Claridge-Chang lab: [Sangyu Xu](https://github.com/sangyu), [Xianyuan Zhang](https://github.com/XYZfar), [Farhan Mohammad](https://github.com/farhan8igib), Jurga Mituzaitė, Stanislav Ott, Tayfun Tumkaya, Jonathan Anns, Nicole Lee and Yishan Mai.\n",
"- Alpha testers from the Claridge-Chang lab: [Sangyu Xu](https://github.com/sangyu), [Xianyuan Zhang](https://github.com/XYZfar), [Farhan Mohammad](https://github.com/farhan8igib), Jurga Mituzaitė, Stanislav Ott, [Tayfun Tumkaya](https://github.com/ttumkaya), [Jonathan Anns](https://github.com/JAnns98), [Nicole Lee](https://github.com/mnicolee) and [Yishan Mai](https://github.com/maiyishan).\n",
"\n",
"- DizietAsahi ([DizietAsahi](https://github.com/DizietAsahi)) with [PR #86](https://github.com/ACCLAB/DABEST-python/pull/86): Fix bugs in slopegraph and reference line keyword parsing.\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/API/effsize_objects.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@
" group_summaries : ['mean_sd', 'median_quartiles', 'None'], default \"mean_sd\".\n",
" Plots the summary statistics for each group. If 'mean_sd', then\n",
" the mean and standard deviation of each group is plotted as a\n",
" notched line beside each group. If 'median_quantiles', then the\n",
" notched line beside each group. For proportion and Sankey plots, this error is the binomial standard error (BSE), sqrt(p(1-p)/n), not the SD. If 'median_quantiles', then the\n",
" median and 25th and 75th percentiles of each group is plotted\n",
" instead. If 'None', the summaries are not shown.\n",
" fig_size : tuple, default None\n",
Expand Down
7 changes: 3 additions & 4 deletions nbs/API/plot_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
" data: pd.DataFrame, # This DataFrame should be in 'long' format.\n",
" x: str, # x column to be plotted.\n",
" y: str, # y column to be plotted.\n",
" type: str = \"mean_sd\", # Choose from ['mean_sd', 'median_quartiles']. Plots the summary statistics for each group. If 'mean_sd', then the mean and standard deviation of each group is plotted as a gapped line. If 'median_quantiles', then the median and 25th and 75th percentiles of each group is plotted instead.\n",
" type: str = \"mean_sd\", # Choose from ['mean_sd', 'median_quartiles']. Plots the summary statistics for each group. If 'mean_sd', then the mean and standard deviation of each group is plotted as a gapped line. For proportion and Sankey plots, the error shown is the binomial standard error (BSE), sqrt(p(1-p)/n), rather than the SD. If 'median_quantiles', then the median and 25th and 75th percentiles of each group is plotted instead.\n",
" offset: float = 0.2, # Give a single float (that will be used as the x-offset of all gapped lines), or an iterable containing the list of x-offsets.\n",
" ax=None, # If a matplotlib Axes object is specified, the gapped lines will be plotted in order on this axes. If None, the current axes (plt.gca()) is used.\n",
" line_color=\"black\", # The color of the gapped lines.\n",
Expand All @@ -136,11 +136,10 @@
"):\n",
" \"\"\"\n",
" Function to plot the standard deviations as vertical errorbars.\n",
" For proportion and Sankey plots, the vertical bars instead show the\n",
" BSE of the proportion.\n",
" The mean is a gap defined by negative space.\n",
"\n",
" This function combines the functionality of gapped_lines(),\n",
" proportional_error_bar(), and sankey_error_bar().\n",
"\n",
" \"\"\"\n",
"\n",
" if gap_width_percent < 0 or gap_width_percent > 100:\n",
Expand Down
10 changes: 7 additions & 3 deletions nbs/tutorials/04-proportion_plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@
"id": "243a1a0b",
"metadata": {},
"source": [
"Instead of a Gardner-Altman plot, you can generate a **Cumming estimation plot** by setting ``float_contrast=False`` in the ``.plot()`` method. This will plot the bootstrap effect sizes below the raw data."
"Instead of a Gardner-Altman plot, you can generate a **Cumming estimation plot** by setting ``float_contrast=False`` in the ``.plot()`` method. This will plot the bootstrap effect sizes below the raw data. The gapped lines show the mean (gap) and the binomial standard error (BSE) of each group."
]
},
{
Expand Down Expand Up @@ -1098,7 +1098,7 @@
"id": "17832542",
"metadata": {},
"source": [
"The Sankey plots for paired proportions also supports the ``float_contrast`` parameter, which can be set to ``False`` to produce a **Cumming estimation plot**.\n"
"The Sankey plots for paired proportions also supports the ``float_contrast`` parameter, which can be set to ``False`` to produce a **Cumming estimation plot**. The gapped lines show the mean and the BSE of each group.\n"
]
},
{
Expand Down Expand Up @@ -1687,7 +1687,11 @@
}
],
"source": [
"two_groups_unpaired.mean_diff.plot(barplot_kwargs={\"alpha\":0.5, \"edgecolor\":\"red\", \"linewidth\":2, 'errorbar': ('sd', 0.1)});"
"# Note on error bars for proportion plots: you can pass a seaborn `errorbar`\n",
"# argument through barplot_kwargs, such as 'errorbar': ('sd', 1) for the standard\n",
"# deviation. DABEST's proportion plots instead show the BSE,\n",
"# √(p(1-p)/n).\n",
"two_groups_unpaired.mean_diff.plot(barplot_kwargs={\"alpha\":0.5, \"edgecolor\":\"red\", \"linewidth\":2});"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion nbs/tutorials/08-plot_aesthetics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@
"source": [
"The type of group summary can be specified via `group_summaries` in the `.plot()` method and must be one of these: `'median_quartiles'`, `'mean_sd'`, `None`.\n",
"\n",
"By default, the group summary is set to `'mean_sd'`."
"By default, the group summary is set to `'mean_sd'`. For proportion and Sankey plots, the `'mean_sd'` gapped line shows the BSE, not the standard deviation."
]
},
{
Expand Down
Loading