diff --git a/.ipynb_checkpoints/Solutions_Lab-t-tests-p-values-checkpoint.ipynb b/.ipynb_checkpoints/Solutions_Lab-t-tests-p-values-checkpoint.ipynb
new file mode 100644
index 0000000..7c92b4a
--- /dev/null
+++ b/.ipynb_checkpoints/Solutions_Lab-t-tests-p-values-checkpoint.ipynb
@@ -0,0 +1,302 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "ee314908",
+ "metadata": {},
+ "source": [
+ "# Lab | Inferential statistics - T-test & P-value"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "515aa25e",
+ "metadata": {},
+ "source": [
+ "## 1. We will have another simple example on two sample t test (pooled- when the variances are equal). But this time this is a one sided t-test\n",
+ "\n",
+ "In a packing plant, a machine packs cartons with jars. It is supposed that a new machine will pack faster on the average than the machine currently used. To test that hypothesis, the times it takes each machine to pack ten cartons are recorded. The results, in seconds, are shown in the tables in the file `files_for_lab/machine.txt`.\n",
+ "Assume that there is sufficient evidence to conduct the t test, does the data provide sufficient evidence to show if one machine is better than the other\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ff27e116",
+ "metadata": {},
+ "source": [
+ "**Question: What again is the difference between pooled and not pooled? Do I need to do anything different when analysing?**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "c4797fc7",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import numpy as np\n",
+ "from scipy.stats import ttest_ind\n",
+ "import statistics\n",
+ "import pandas as pd\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "9bbf1860",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "H0: There is no difference in time between using machine old and new\n",
+ "H1: New machine is faster/needs less time than old machine "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "77c14e57",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "data = pd.read_excel('files_for_lab/anova_lab_data.xlsx')# , sheet_name='data_collected')\n",
+ "data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "cda8c11d",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "old_machine = (42.7, 43.6, 43.8, 43.3, 42.5, 43.5, 43.1, 41.7, 44, 44.1)\n",
+ "new_machine = (42.1, 41, 41.3, 41.8, 42.4, 42.8, 43.2, 42.3, 41.8, 42.7)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "c9a35eea",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "Ttest_indResult(statistic=3.3972307061176026, pvalue=0.0032111425007745158)"
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "ttest_ind(old_machine, new_machine)"
+ ]
+ },
+ {
+ "attachments": {
+ "image.png": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAApAAAAA5CAYAAACBORtfAAAMIklEQVR4Ae2da3LjKhBGs2tvIl6Fs4zxKpy/WUCyCaZaMhI0DUZ+yAKdW5XSA2joQzd8luW5H+4Z/32f3OHz7H4TWxd3OpzcJbnfx43ff0d3+Kr17tedP4/u/Gf7LraO/1KCUrtUZlvjbtXc/J3d0YzbmV9sx5hDif3qGJjtrnMm4z240/ft3mI/VX0jvy9fym4FS2V1w5eybuVzNRl46PvuWM00ijHknEtiJps7Y9xO62FSr9N9JfFT2BqxaNYb94l5LTJyP4zTedr2dZZhF0GQOpNuqec/zJZeFyPD/V18PMUlAW5txDWT9ZQBvMfIrQUzGlWO0VDJCNKpcalsqsSJIlAzN1Jn2qRUe3+p7cTXxiLtG27gKBv2Lf/8MGO//N3r0YpddW9JX8r6xi6Xz6n4Pm/ckq+huE7ztybuNgbl9nBUPFgNdIzZMTPyi/YTET7Thu6cq+jL6n/b9/JxF8fXKMStvNZ8h+tgX9bl2+bxitHlG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ACso15YpQQgAAEIAABCEBgMwQQkJuZCgYCAQhAAAIQgAAE2iCAgGxjnhglBCAAAQhAAAIQ2AwBBORmpoKBQAACEIAABCAAgTYIICDbmCdGCQEIQAACEIAABDZD4CEB+fPz4/iDATFADBADxAAxQAwQA/uKgYcE5GZkMAOBAAQgAAEIQAACEFiNAAJyNdR0BAEIQAACEIAABPoggIDsYx7xAgIQgAAEIAABCKxGAAG5Gmo6ggAEIAABCEAAAn0QQED2MY94AQEIQAACEIAABFYjgIBcDTUdQQACEIAABCAAgT4IICD7mEe8gAAEIAABCEAAAqsRQECuhpqOIAABCEAAAhCAQB8E/gMP7XOYlKeOpQAAAABJRU5ErkJggg=="
+ }
+ },
+ "cell_type": "markdown",
+ "id": "ae19f02f",
+ "metadata": {},
+ "source": [
+ "###### Results:
\n",
+ "For a sinificance/alpha level of 0.05, the t-critical for one-tailed test is 1.734
\n",
+ "used DoF Degrees of Freedom: (N1-1)+(N2-1) = (10-1)+(10-1) = 18
\n",
+ " \n",
+ "p-value (0.00321) < significance value (0.05)
# As this test the table already is for one side I did not divide 0.5 /2 but used 0.05 instead.\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "t statistic (3.3972307061176026) > t critical (1.734)
\n",
+ "\n",
+ "-> I would assume we can reject H0, as p-value is smaller 0.05, and t statistic value is above critical region of t critical.
Is that correct? Or do I need to test something else?\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "501614ae",
+ "metadata": {},
+ "source": [
+ "## 2. An additional problem (not mandatory): In this case we can't assume that the population variances are equal. Hence in this case we cannot pool the variances.\n",
+ " Independent random samples of 17 sophomores and 13 juniors attending a large university yield the following data on grade point averages. Data is provided in the file `files_for_lab/student_gpa.txt`.\n",
+ " At the 5% significance level, do the data provide sufficient evidence to conclude that the mean GPAs of sophomores and juniors at the university differ?\n",
+ "\n",
+ " Test statistics can be calculated as: [link to the image - Test statistics calculation for Unpooled Variance Case](https://education-team-2020.s3-eu-west-1.amazonaws.com/data-analytics/7.04/7.04-unpooled_variances.png)\n",
+ "\n",
+ " Degrees of freedom is `(n1-1)+(n2-1)`."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "af0a11e7",
+ "metadata": {},
+ "source": [
+ "H0: There is no significant difference between mean of sophmores and mean juniors
\n",
+ "H1: There is a significant difference between mean of sophmores and mean juniors
"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "3925f57e",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "sophmores = [3.04, 1.71, 3.3, 2.88, 2.11, 2.6, 2.92, 3.6, 2.28, 2.82, 3.03, 3.13, 2.86, 3.49, 3.11, 2.13, 3.27]\n",
+ "juniors = [2.56, 2.77, 2.7, 3, 2.98, 3.47, 3.26, 3.2, 3.19, 2.65, 3, 3.39, 2.58]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "5a11f3f2",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "2.980769230769231"
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "mean_junior = statistics.mean(juniors)\n",
+ "mean_junior"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "fce55b49",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "2.84"
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "mean_sophmores = statistics.mean(sophmores)\n",
+ "mean_sophmores"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "97e1b899",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "Ttest_indResult(statistic=-0.864325455323425, pvalue=0.39475359666695975)"
+ ]
+ },
+ "execution_count": 10,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "ttest_ind(sophmores, juniors)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3ee23bb1",
+ "metadata": {},
+ "source": [
+ "**Result 1:** p value (0.39475) > 0.05. H0 can be accepted. No signifant difference between means."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f381ee5b",
+ "metadata": {},
+ "source": [
+ "DoF = (17-1)+(13-1)= 16+12 = 28"
+ ]
+ },
+ {
+ "attachments": {
+ "image.png": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAn4AAAAtCAYAAAAwVWYQAAAJm0lEQVR4Ae2dbXLqOgyG2TWbKKugy4BVtH+7gJ5N+IySOJEVOZgAJXaeO9Mh8YdsPZbslwDnHgL/QQACEIAABCAAAQjsgsBhF17iJAQgAAEIQAACEIBAQPgRBBCAAAQgAAEIQGAnBBB+O1lo3IQABCAAAQhAAAIIP2IAAhCAAAQgAAEI7IQAwm8nC42bEIAABCAAAQhAAOFHDEAAAhCAAAQgAIGdEED47WShcRMCEIAABCAAAQgg/IgBCEAAAhCAAAQgsBMCq4Tfz89P4A8GxAAxQAwQA8QAMUAM1BUDq4TfTkQxbr6VgITmHv7eCpnBIQABCEBgZwQQfjtb8Hrc3YPoI/3qiUdmCgEIQKANApw8baxjg14g/BpcVFyCAAQgAIE3E0D4vXkBGD5HAOGXI0M5BCAAAQhAYC0BhN9acvR7MQGE34sBYx4CEIAABHZIAOG3w0Wvw2WEXx3rxCwhAAEIQKAmAgi/mlZrV3NF+O1quXEWAhCAAAT+hADC708wM8j9BBB+9zOjBwQgAAEIQGCZAMJvmQ+1byOA8HsbegaGAAQgAIFmCSD8ml3a2h1D+NW+gswfAhCAAAS2RwDht701YUYdAYQfgQABCEAAAhB4NoGVwu83XD+O4Xgc/j6/knl9faq6j2v4TWrrv/m9nMLR+Dx5ZdgII4eBZ6Mri0y711O4/pss7+tqnfD7vRzC8TPf9/pxCMej+VPtk3pVHv/3cbfsx3blr89eVRN/pXGaa/d9nsVvm/n9Fc4q906XW7tW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YqWxamCwEIQAACVRNA+FW9fC1PfqtC7dnzankN8Q0CEIAABLZGAOG3tRVhPgOBZwusrdpjwSEAAQhAAAJ/RwDh93esGekuAlsVas+e111QaAwBCEAAAhB4iADC7yF8dIYABCAAAQhAAAL1EED41bNWzBQCEIAABCAAAQg8RADh9xA+OkMAAhCAAAQgAIF6CCD86lkrZgoBCEAAAhCAAAQeIoDwewgfnSEAAQhAAAIQgEA9BBB+9awVM4UABCAAAQhAAAIPEVgl/H5+fgJ/MCAGiAFigBggBogBYqCuGFgl/B6SmnSGAAQgAAEIQAACEHgLAYTfW7AzKAQgAAEIQAACEPh7Av8Bu/jAM49a+MYAAAAASUVORK5CYII="
+ }
+ },
+ "cell_type": "markdown",
+ "id": "b81809c6",
+ "metadata": {},
+ "source": [
+ "For a sinificance/alpha level of 0.05, the t-critical for one-tailed test is 1.701.
\n",
+ "\n",
+ "
\n",
+ "\n",
+ "t statistic(0.864325455323425) < t critical (1.701)
\n",
+ "\n",
+ "**Result 2 (supports Result 1):** We fail to reject the H0 hypothesis. As t statistic value is within critical region (-1.701 < critical region > +1.701)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "6ca6ace2",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.4"
+ },
+ "toc": {
+ "base_numbering": 1,
+ "nav_menu": {},
+ "number_sections": true,
+ "sideBar": true,
+ "skip_h1_title": true,
+ "title_cell": "Table of Contents",
+ "title_sidebar": "Contents",
+ "toc_cell": false,
+ "toc_position": {},
+ "toc_section_display": true,
+ "toc_window_display": false
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/.ipynb_checkpoints/Untitled-checkpoint.ipynb b/.ipynb_checkpoints/Untitled-checkpoint.ipynb
deleted file mode 100644
index bb907ae..0000000
--- a/.ipynb_checkpoints/Untitled-checkpoint.ipynb
+++ /dev/null
@@ -1,76 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "ee314908",
- "metadata": {},
- "source": [
- "# Lab | Inferential statistics - T-test & P-value"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "515aa25e",
- "metadata": {},
- "source": [
- "## 1. We will have another simple example on two sample t test (pooled- when the variances are equal). But this time this is a one sided t-test\n",
- "\n",
- "In a packing plant, a machine packs cartons with jars. It is supposed that a new machine will pack faster on the average than the machine currently used. To test that hypothesis, the times it takes each machine to pack ten cartons are recorded. The results, in seconds, are shown in the tables in the file `files_for_lab/machine.txt`.\n",
- "Assume that there is sufficient evidence to conduct the t test, does the data provide sufficient evidence to show if one machine is better than the other\n",
- "\n",
- "\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "c4797fc7",
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "markdown",
- "id": "501614ae",
- "metadata": {},
- "source": [
- "## 2. An additional problem (not mandatory): In this case we can't assume that the population variances are equal. Hence in this case we cannot pool the variances.\n",
- " Independent random samples of 17 sophomores and 13 juniors attending a large university yield the following data on grade point averages. Data is provided in the file `files_for_lab/student_gpa.txt`.\n",
- " At the 5% significance level, do the data provide sufficient evidence to conclude that the mean GPAs of sophomores and juniors at the university differ?\n",
- "\n",
- " Test statistics can be calculated as: [link to the image - Test statistics calculation for Unpooled Variance Case](https://education-team-2020.s3-eu-west-1.amazonaws.com/data-analytics/7.04/7.04-unpooled_variances.png)\n",
- "\n",
- " Degrees of freedom is `(n1-1)+(n2-1)`."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "3925f57e",
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "ironhack",
- "language": "python",
- "name": "ironhack"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.8.5"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/Solutions_Lab-t-tests-p-values.ipynb b/Solutions_Lab-t-tests-p-values.ipynb
new file mode 100644
index 0000000..7c92b4a
--- /dev/null
+++ b/Solutions_Lab-t-tests-p-values.ipynb
@@ -0,0 +1,302 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "ee314908",
+ "metadata": {},
+ "source": [
+ "# Lab | Inferential statistics - T-test & P-value"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "515aa25e",
+ "metadata": {},
+ "source": [
+ "## 1. We will have another simple example on two sample t test (pooled- when the variances are equal). But this time this is a one sided t-test\n",
+ "\n",
+ "In a packing plant, a machine packs cartons with jars. It is supposed that a new machine will pack faster on the average than the machine currently used. To test that hypothesis, the times it takes each machine to pack ten cartons are recorded. The results, in seconds, are shown in the tables in the file `files_for_lab/machine.txt`.\n",
+ "Assume that there is sufficient evidence to conduct the t test, does the data provide sufficient evidence to show if one machine is better than the other\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ff27e116",
+ "metadata": {},
+ "source": [
+ "**Question: What again is the difference between pooled and not pooled? Do I need to do anything different when analysing?**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "c4797fc7",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import numpy as np\n",
+ "from scipy.stats import ttest_ind\n",
+ "import statistics\n",
+ "import pandas as pd\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "9bbf1860",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "H0: There is no difference in time between using machine old and new\n",
+ "H1: New machine is faster/needs less time than old machine "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "77c14e57",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "data = pd.read_excel('files_for_lab/anova_lab_data.xlsx')# , sheet_name='data_collected')\n",
+ "data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "cda8c11d",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "old_machine = (42.7, 43.6, 43.8, 43.3, 42.5, 43.5, 43.1, 41.7, 44, 44.1)\n",
+ "new_machine = (42.1, 41, 41.3, 41.8, 42.4, 42.8, 43.2, 42.3, 41.8, 42.7)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "c9a35eea",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "Ttest_indResult(statistic=3.3972307061176026, pvalue=0.0032111425007745158)"
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "ttest_ind(old_machine, new_machine)"
+ ]
+ },
+ {
+ "attachments": {
+ "image.png": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAApAAAAA5CAYAAACBORtfAAAMIklEQVR4Ae2da3LjKhBGs2tvIl6Fs4zxKpy/WUCyCaZaMhI0DUZ+yAKdW5XSA2joQzd8luW5H+4Z/32f3OHz7H4TWxd3OpzcJbnfx43ff0d3+Kr17tedP4/u/Gf7LraO/1KCUrtUZlvjbtXc/J3d0YzbmV9sx5hDif3qGJjtrnMm4z240/ft3mI/VX0jvy9fym4FS2V1w5eybuVzNRl46PvuWM00ijHknEtiJps7Y9xO62FSr9N9JfFT2BqxaNYb94l5LTJyP4zTedr2dZZhF0GQOpNuqec/zJZeFyPD/V18PMUlAW5txDWT9ZQBvMfIrQUzGlWO0VDJCNKpcalsqsSJIlAzN1Jn2qRU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bpDwKyy2nFKQhAAAIQaJYAArLZqdvTwBGQe5ptfIUABCAAge0TQEBuf44YofFDl7beffQCmKmEAAQgAAEI9EEAAdnHPHbuhRdgrR87nybcgwAEIACB3RBAQO5mqlt2dIlwbNlPxg4BCEAAAhBogwACso15YpQQgAAEIAABCEBgMwQQkJuZCgYCAQhAAAIQgAAE2iCAgGxjnhglBCAAAQhAAAIQ2AwBBORmpoKBQAACEIAABCAAgTYIICDbmCdGCQEIQAACEIAABDZD4CEB+fPz4/iDATFADBADxAAxQAwQA/uKgYcE5GZkMAOBAAQgAAEIQAACEFiNAAJyNdR0BAEIQAACEIAABPoggIDsYx7xAgIQgAAEIAABCKxGAAG5Gmo6ggAEIAABCEAAAn0QQED2MY94AQEIQAACEIAABFYjgIBcDTUdQQACEIAABCAAgT4IICD7mEe8gAAEIAABCEAAAqsRQECuhpqOIAABCEAAAhCAQB8E/gMP7XOYlKeOpQAAAABJRU5ErkJggg=="
+ }
+ },
+ "cell_type": "markdown",
+ "id": "ae19f02f",
+ "metadata": {},
+ "source": [
+ "###### Results:
\n",
+ "For a sinificance/alpha level of 0.05, the t-critical for one-tailed test is 1.734
\n",
+ "used DoF Degrees of Freedom: (N1-1)+(N2-1) = (10-1)+(10-1) = 18
\n",
+ " \n",
+ "p-value (0.00321) < significance value (0.05)
# As this test the table already is for one side I did not divide 0.5 /2 but used 0.05 instead.\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "t statistic (3.3972307061176026) > t critical (1.734)
\n",
+ "\n",
+ "-> I would assume we can reject H0, as p-value is smaller 0.05, and t statistic value is above critical region of t critical.
Is that correct? Or do I need to test something else?\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "501614ae",
+ "metadata": {},
+ "source": [
+ "## 2. An additional problem (not mandatory): In this case we can't assume that the population variances are equal. Hence in this case we cannot pool the variances.\n",
+ " Independent random samples of 17 sophomores and 13 juniors attending a large university yield the following data on grade point averages. Data is provided in the file `files_for_lab/student_gpa.txt`.\n",
+ " At the 5% significance level, do the data provide sufficient evidence to conclude that the mean GPAs of sophomores and juniors at the university differ?\n",
+ "\n",
+ " Test statistics can be calculated as: [link to the image - Test statistics calculation for Unpooled Variance Case](https://education-team-2020.s3-eu-west-1.amazonaws.com/data-analytics/7.04/7.04-unpooled_variances.png)\n",
+ "\n",
+ " Degrees of freedom is `(n1-1)+(n2-1)`."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "af0a11e7",
+ "metadata": {},
+ "source": [
+ "H0: There is no significant difference between mean of sophmores and mean juniors
\n",
+ "H1: There is a significant difference between mean of sophmores and mean juniors
"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "3925f57e",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "sophmores = [3.04, 1.71, 3.3, 2.88, 2.11, 2.6, 2.92, 3.6, 2.28, 2.82, 3.03, 3.13, 2.86, 3.49, 3.11, 2.13, 3.27]\n",
+ "juniors = [2.56, 2.77, 2.7, 3, 2.98, 3.47, 3.26, 3.2, 3.19, 2.65, 3, 3.39, 2.58]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "5a11f3f2",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "2.980769230769231"
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "mean_junior = statistics.mean(juniors)\n",
+ "mean_junior"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "fce55b49",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "2.84"
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "mean_sophmores = statistics.mean(sophmores)\n",
+ "mean_sophmores"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "97e1b899",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "Ttest_indResult(statistic=-0.864325455323425, pvalue=0.39475359666695975)"
+ ]
+ },
+ "execution_count": 10,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "ttest_ind(sophmores, juniors)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3ee23bb1",
+ "metadata": {},
+ "source": [
+ "**Result 1:** p value (0.39475) > 0.05. H0 can be accepted. No signifant difference between means."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f381ee5b",
+ "metadata": {},
+ "source": [
+ "DoF = (17-1)+(13-1)= 16+12 = 28"
+ ]
+ },
+ {
+ "attachments": {
+ "image.png": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAn4AAAAtCAYAAAAwVWYQAAAJm0lEQVR4Ae2dbXLqOgyG2TWbKKugy4BVtH+7gJ5N+IySOJEVOZgAJXaeO9Mh8YdsPZbslwDnHgL/QQACEIAABCAAAQjsgsBhF17iJAQgAAEIQAACEIBAQPgRBBCAAAQgAAEIQGAnBBB+O1lo3IQABCAAAQhAAAIIP2IAAhCAAAQgAAEI7IQAwm8nC42bEIAABCAAAQhAAOFHDEAAAhCAAAQgAIGdEED47WShcRMCEIAABCAAAQgg/IgBCEAAAhCAAAQgsBMCq4Tfz89P4A8GxAAxQAwQA8QAMUAM1BUDq4TfTkQxbr6VgITmHv7eCpnBIQABCEBgZwQQfjtb8Hrc3YPoI/3qiUdmCgEIQKANApw8baxjg14g/BpcVFyCAAQgAIE3E0D4vXkBGD5HAOGXI0M5BCAAAQhAYC0BhN9acvR7MQGE34sBYx4CEIAABHZIAOG3w0Wvw2WEXx3rxCwhAAEIQKAmAgi/mlZrV3NF+O1quXEWAhCAAAT+hADC708wM8j9BBB+9zOjBwQgAAEIQGCZAMJvmQ+1byOA8HsbegaGAAQgAIFmCSD8ml3a2h1D+NW+gswfAhCAAAS2RwDht701YUYdAYQfgQABCEAAAhB4NoGVwu83X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U3ir3N2jjk6dbJiLn5MGdmk+Wvi2bE3WW70qpjxAquFNyEJNRmrsthcJfwSp7mBwEsI3Cn8bgqsrdp7CTyMQgACEIAABFwCCD8XC4XvJ7BVofbseb2fNDOAAAQgAIH9EED47WetK/P02QJrq/YqWxamCwEIQAACVRNA+FW9fC1PfqtC7dnzankN8Q0CEIAABLZGAOG3tRVhPgOBZwusrdpjwSEAAQhAAAJ/RwDh93esGekuAlsVas+e111QaAwBCEAAAhB4iADC7yF8dIYABCAAAQhAAAL1EED41bNWzBQCEIAABCAAAQg8RADh9xA+OkMAAhCAAAQgAIF6CCD86lkrZgoBCEAAAhCAAAQeIoDwewgfnSEAAQhAAAIQgEA9BBB+9awVM4UABCAAAQhAAAIPEVgl/H5+fgJ/MCAGiAFigBggBogBYqCuGFgl/B6SmnSGAAQgAAEIQAACEHgLAYTfW7AzKAQgAAEIQAACEPh7Av8Bu/jAM49a+MYAAAAASUVORK5CYII="
+ }
+ },
+ "cell_type": "markdown",
+ "id": "b81809c6",
+ "metadata": {},
+ "source": [
+ "For a sinificance/alpha level of 0.05, the t-critical for one-tailed test is 1.701.
\n",
+ "\n",
+ "
\n",
+ "\n",
+ "t statistic(0.864325455323425) < t critical (1.701)
\n",
+ "\n",
+ "**Result 2 (supports Result 1):** We fail to reject the H0 hypothesis. As t statistic value is within critical region (-1.701 < critical region > +1.701)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "6ca6ace2",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.4"
+ },
+ "toc": {
+ "base_numbering": 1,
+ "nav_menu": {},
+ "number_sections": true,
+ "sideBar": true,
+ "skip_h1_title": true,
+ "title_cell": "Table of Contents",
+ "title_sidebar": "Contents",
+ "toc_cell": false,
+ "toc_position": {},
+ "toc_section_display": true,
+ "toc_window_display": false
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/Untitled.ipynb b/Untitled.ipynb
deleted file mode 100644
index bb907ae..0000000
--- a/Untitled.ipynb
+++ /dev/null
@@ -1,76 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "ee314908",
- "metadata": {},
- "source": [
- "# Lab | Inferential statistics - T-test & P-value"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "515aa25e",
- "metadata": {},
- "source": [
- "## 1. We will have another simple example on two sample t test (pooled- when the variances are equal). But this time this is a one sided t-test\n",
- "\n",
- "In a packing plant, a machine packs cartons with jars. It is supposed that a new machine will pack faster on the average than the machine currently used. To test that hypothesis, the times it takes each machine to pack ten cartons are recorded. The results, in seconds, are shown in the tables in the file `files_for_lab/machine.txt`.\n",
- "Assume that there is sufficient evidence to conduct the t test, does the data provide sufficient evidence to show if one machine is better than the other\n",
- "\n",
- "\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "c4797fc7",
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "markdown",
- "id": "501614ae",
- "metadata": {},
- "source": [
- "## 2. An additional problem (not mandatory): In this case we can't assume that the population variances are equal. Hence in this case we cannot pool the variances.\n",
- " Independent random samples of 17 sophomores and 13 juniors attending a large university yield the following data on grade point averages. Data is provided in the file `files_for_lab/student_gpa.txt`.\n",
- " At the 5% significance level, do the data provide sufficient evidence to conclude that the mean GPAs of sophomores and juniors at the university differ?\n",
- "\n",
- " Test statistics can be calculated as: [link to the image - Test statistics calculation for Unpooled Variance Case](https://education-team-2020.s3-eu-west-1.amazonaws.com/data-analytics/7.04/7.04-unpooled_variances.png)\n",
- "\n",
- " Degrees of freedom is `(n1-1)+(n2-1)`."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "3925f57e",
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "ironhack",
- "language": "python",
- "name": "ironhack"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.8.5"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}