{ "cells": [ { "cell_type": "markdown", "id": "79234e4f", "metadata": {}, "source": [ "# Central Limit Theorem\n", "\n", "\n", "### Set up Python libraries\n", "\n", "As usual, run the code cell below to import the relevant Python libraries" ] }, { "cell_type": "code", "execution_count": 187, "id": "ba52cbb5", "metadata": {}, "outputs": [], "source": [ "#Set-up Python libraries - you need to run this but you don't need to change it\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import scipy.stats as stats\n", "import pandas \n", "import seaborn as sns\n", "sns.set_theme()" ] }, { "cell_type": "markdown", "id": "0c7807e3", "metadata": {}, "source": [ "### Load and plot the data\n", "\n", "We will work with a distinctly non-normal data distribution - the scores for a large number of individuals on a 100-item political questionairre called BrexDex. \n", "\n", "The questions are designed and scored so that a high score overall score on the questionairre indicates an attitude agains Brexit, and a low score indicates an attitude in favour of Brexit.\n", "\n", "Because the scores relate to a polarizing topic, the data distribution is bimodal\n", "\n", "(These are made up data by the way!)\n", "\n", "First load the data:" ] }, { "cell_type": "code", "execution_count": 188, "id": "66216ca9", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | ID_code | \n", "score | \n", "
---|---|---|
0 | \n", "186640 | \n", "53 | \n", "
1 | \n", "588140 | \n", "90 | \n", "
2 | \n", "977390 | \n", "30 | \n", "
3 | \n", "948470 | \n", "42 | \n", "
4 | \n", "564360 | \n", "84 | \n", "
... | \n", "... | \n", "... | \n", "
9995 | \n", "851780 | \n", "81 | \n", "
9996 | \n", "698340 | \n", "45 | \n", "
9997 | \n", "693580 | \n", "51 | \n", "
9998 | \n", "872730 | \n", "78 | \n", "
9999 | \n", "385642 | \n", "88 | \n", "
10000 rows × 2 columns
\n", "