Skip to content

maiyishan/DABEST-python-mmddocs

 
 

Repository files navigation

DABEST-Python

Travis CI build status minimal Python version PyPI version Downloads Free-to-view citation License

Contents

About

DABEST is a package for Data Analysis using Bootstrap-Coupled ESTimation.

Estimation statistics is a simple framework that avoids the pitfalls of significance testing. It uses familiar statistical concepts: means, mean differences, and error bars. More importantly, it focuses on the effect size of one's experiment/intervention, as opposed to a false dichotomy engendered by P values.

An estimation plot has two key features.

  1. It presents all datapoints as a swarmplot, which orders each point to display the underlying distribution.

  2. It presents the effect size as a bootstrap 95% confidence interval on a separate but aligned axes.

The five kinds of estimation plots

DABEST powers estimationstats.com, allowing everyone access to high-quality estimation plots.

Installation

This package is tested on Python 3.6, 3.7, and 3.8. It is highly recommended to download the Anaconda distribution of Python in order to obtain the dependencies easily.

You can install this package via pip.

To install, at the command line run

pip install --upgrade dabest

You can also clone this repo locally.

Then, navigate to the cloned repo in the command line and run

pip install .

Usage

import pandas as pd
import dabest

# Load the iris dataset. Requires internet access.
iris = pd.read_csv("https://github.com/mwaskom/seaborn-data/raw/master/iris.csv")

# Load the above data into `dabest`.
iris_dabest = dabest.load(data=iris, x="species", y="petal_width",
                          idx=("setosa", "versicolor", "virginica"))

# Produce a Cumming estimation plot.
iris_dabest.mean_diff.plot();

A Cumming estimation plot of petal width from the iris dataset

Please refer to the official tutorial for more useful code snippets.

How to cite

Moving beyond P values: Everyday data analysis with estimation plots

Joses Ho, Tayfun Tumkaya, Sameer Aryal, Hyungwon Choi, Adam Claridge-Chang

Nature Methods 2019, 1548-7105. 10.1038/s41592-019-0470-3

Paywalled publisher site; Free-to-view PDF

Bugs

Please report any bugs on the Github issue tracker.

Contributing

All contributions are welcome; please read the Guidelines for contributing first.

We also have a Code of Conduct to foster an inclusive and productive space.

A wish list for new features

Currently, DABEST offers functions to handle data traditionally analyzed with Student’s paired and unpaired t-tests. It also offers plots for multiplexed versions of these, and the estimation counterpart to a 1-way analysis of variance (ANOVA), the shared-control design. While these five functions execute a large fraction of common biomedical data analyses, there remain three others: 2-way data, time-series group data, and proportional data. We aim to add these new functions to both the R and Python libraries.

● In many experiments, four groups are investigate to isolate an interaction, for example: a genotype × drug effect. Here, wild-type and mutant animals are each subjected to drug or sham treatments; the data are traditionally analysed with a 2×2 ANOVA. We have received requests by email, Twitter, and GitHub to implement an estimation counterpart to the 2-way ANOVA. To do this, we will implement ∆∆ plots, in which the difference of means (∆) of two groups is subtracted from a second two-group ∆.

● Currently, DABEST can analyse multiple paired data in a single plot, and multiple groups with a common, shared control. However, a common design in biomedical science is to follow the same group of subjects over multiple, successive time points. An estimation plot for this would combine elements of the two other designs, and could be used in place of a repeated-measures ANOVA.

● We have observed that proportional data are often analyzed in neuroscience and other areas of biomedical research. However, compared to other data types, the charts are frequently impoverished: often, they omit error bars, sample sizes, and even P values—let alone effect sizes. We would like DABEST to feature proportion charts, with error bars and a curve for the distribution of the proportional differences.

We encourage contributions for the above features.

Acknowledgements

We would like to thank alpha testers from the Claridge-Chang lab: Sangyu Xu, Xianyuan Zhang, Farhan Mohammad, Jurga Mituzaitė, and Stanislav Ott.

Testing

To test DABEST, you will need to install pytest.

Run pytest in the root directory of the source distribution. This runs the test suite in the folder dabest/tests. The test suite will ensure that the bootstrapping functions and the plotting functions perform as expected.

DABEST in other languages

DABEST is also available in R (dabestr) and Matlab (DABEST-Matlab).

About

Data Analysis with Bootstrapped ESTimation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%