{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "56b82cce",
            "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": "82868e07",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy.stats.mstats import kruskal",
            "outputs": []
        },
        {
            "id": "08be61d0",
            "cell_type": "markdown",
            "source": "Random samples from three different brands of batteries were tested\nto see how long the charge lasted. Results were as follows:\n",
            "metadata": {}
        },
        {
            "id": "21d81063",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "a = [6.3, 5.4, 5.7, 5.2, 5.0]\nb = [6.9, 7.0, 6.1, 7.9]\nc = [7.2, 6.9, 6.1, 6.5]",
            "outputs": []
        },
        {
            "id": "97709028",
            "cell_type": "markdown",
            "source": "Test the hypothesis that the distribution functions for all of the brands'\ndurations are identical. Use 5% level of significance.\n",
            "metadata": {}
        },
        {
            "id": "7670940d",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "kruskal(a, b, c)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "KruskalResult(statistic=7.113812154696133, pvalue=0.028526948491942164)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "5abaa555",
            "cell_type": "markdown",
            "source": "The null hypothesis is rejected at the 5% level of significance\nbecause the returned p-value is less than the critical value of 5%.",
            "metadata": {}
        }
    ]
}