{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "8f489602",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "a6f682ce",
            "cell_type": "markdown",
            "source": "We'll use data from [2], Table 1. The null hypothesis is that the means of\nthe distributions underlying the samples and control are equal.\n\nFirst, we test that the means of the distributions underlying the samples\nand control are unequal (``alternative='two-sided'``, the default).\n",
            "metadata": {}
        },
        {
            "id": "92c597af",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.stats import dunnett\nsamples = [[3.8, 2.7, 4.0, 2.4], [2.8, 3.4, 3.7, 2.2, 2.0]]\ncontrol = [2.9, 3.0, 2.5, 2.6, 3.2]\nres = dunnett(*samples, control=control)\nres.statistic",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 0.90874545, -0.05007117])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "77197544",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "res.pvalue",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.58325114, 0.99819341])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "a1afdafa",
            "cell_type": "markdown",
            "source": "Now, we test that the means of the distributions underlying the samples are\ngreater than the mean of the distribution underlying the control.\n",
            "metadata": {}
        },
        {
            "id": "d0830d1b",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "res = dunnett(*samples, control=control, alternative='greater')\nres.statistic",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 0.90874545, -0.05007117])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "816e7e49",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "res.pvalue",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.30230596, 0.69115597])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "6077dbd7",
            "cell_type": "markdown",
            "source": "For a more detailed example, see :ref:`hypothesis_dunnett`.",
            "metadata": {}
        }
    ]
}