Skip to content
Open
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
94 changes: 80 additions & 14 deletions Solutions.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "bbb8f6c1",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import datetime\n",
"import warnings\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import math\n",
"from scipy.stats import ttest_ind\n",
"warnings.filterwarnings('ignore')"
]
},
{
"cell_type": "markdown",
"id": "e00a11f1",
Expand Down Expand Up @@ -33,12 +51,21 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "39c6f717",
"cell_type": "raw",
"id": "0ca1325d",
"metadata": {},
"outputs": [],
"source": []
"source": [
"Honolulu Heart Study:\n",
"\n",
"--> the average systolic blood pressure is μ = 130.1 mm Hg\n",
"--> standard deviation of 21.21 mm Hg\n",
"\n",
"Regular population: the mean systolic blood pressure is μ = 120 mm Hg\n",
"\n",
"Hypothesis :\n",
"--> Ho: Systolic blood pressure, on average, not higher than regular population.\n",
"--> Ha: Systolic blood pressure, on average, higher than regular population."
]
},
{
"cell_type": "markdown",
Expand All @@ -49,12 +76,18 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b09ce149",
"cell_type": "raw",
"id": "c3ba3468",
"metadata": {},
"outputs": [],
"source": []
"source": [
"There are 5 main steps in hypothesis testing:\n",
"\n",
"1) State your research hypothesis as a null (Ho) and alternate (Ha) hypothesis.\n",
"2) Collect data in a way designed to test the hypothesis.\n",
"3) Perform an appropriate statistical test.\n",
"4) Decide whether the null hypothesis is supported or refuted.\n",
"5) Present the findings in your results and discussion section."
]
},
{
"cell_type": "markdown",
Expand All @@ -66,11 +99,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "97f73e20",
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"data": {
"text/plain": [
"4.7619"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mean_population = 120\n",
"sample_mean = 130.1\n",
"stdev = 21.21\n",
"n = 100\n",
"\n",
"t = ((sample_mean - mean_population) / (stdev / math.sqrt(n)))\n",
"\n",
"round(t,5)"
]
},
{
"cell_type": "markdown",
Expand All @@ -97,7 +150,20 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.8.8"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,
Expand Down