{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Lab 2-1: Hypothesis Testing\n", "\n", "The Skykomish River in Washington state appears to have had a change in streamflow around the year 1975. \n", "* Test for statistical significance of the observed change in the mean annual flood. \n", "* Use a two-sample test, with alpha=0.05 (i.e. 95% confidence) and the z-distribution to define the rejection region.\n", "\n", "Why is it appropriate to use the z-distribution here? (consider the [Central Limit Theorem](https://en.wikipedia.org/wiki/Central_limit_theorem))\n", "\n", "---" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import scipy.stats as stats\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/opt/conda/lib/python3.10/site-packages/openpyxl/worksheet/_read_only.py:81: UserWarning: Unknown extension is not supported and will be removed\n", " for idx, row in parser.parse():\n" ] }, { "data": { "text/html": [ "
\n", " | date of peak | \n", "water year | \n", "peak value (cfs) | \n", "gage_ht (feet) | \n", "
---|---|---|---|---|
0 | \n", "1928-10-09 | \n", "1929 | \n", "18800 | \n", "10.55 | \n", "
1 | \n", "1930-02-05 | \n", "1930 | \n", "15800 | \n", "10.44 | \n", "
2 | \n", "1931-01-28 | \n", "1931 | \n", "35100 | \n", "14.08 | \n", "