{
"cells": [
{
"cell_type": "markdown",
"id": "2fe086e0",
"metadata": {},
"source": [
"# Hypothesis testing\n",
"\n",
"*Dan L. Nicolae*\n",
"\n",
"Hypothesis testing can be thought of as a way to investigate the consistency of a dataset with a model, where a model is a set of rules that describe how data are generated. The consistency is evaluated using ideas from probability and probability distributions. \n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "1fb88591",
"metadata": {},
"source": [
"\n",
"\n",
"The consistency question in the above diagram is short for \"Is it plausible that data was generated from this model?\"\n",
"\n",
"We will use a simple example to illustrate this. Suppose that a friend is telling you that she has an urn with 6 blue and 4 red balls from which 5 balls are extracted without replacement. The description in the previous sentence is that of a model with four rules:\n",
"- there is an urn with 10 balls: 6 blue and 4 red;\n",
"- a total of 5 balls are extracted;\n",
"- the balls are extracted without replacement (once a ball is out of the urn, it cannot be selected again);\n",
"- at each extraction, every ball in the urn has the same chance of being selected (this assumption is **implicit** in urn problems).\n",
"\n",
"Suppose your friend reports the results of a drawing (these are the data) and here are two hypothetical scenarios (datasets):\n",
"- Scenario 1: outcome is *5 red balls*. Is this outcome consistent with the model above? The answer is clearly no as it is not possible to obtain 5 red balls when the first 3 rules above are true.\n",
"- Scenario 2: outcome is *2 blue and 3 red balls*. The answer here is not as obvious as above, but we can use probability to get an evaluation of how likely this outcome is. We will formalize this process in this chapter.\n",
"\n",
"We will use these ideas in the next sections to answer questions that are more complicated: Is pollution associated with risk of cancer? Are weights of babies different for older mothers? \n",
"\n",
"We end this introduction with examples of other data-generating models (so you can gain more insight before learning how to evaluate them):\n",
"- A simple random sample of 10 voters from a population of size 10,000 where 40% of the subjects vote for candidate A, 35% for candidate B and 25% for candidate C.\n",
"- Data from a binomial setting; this was introduced in the previous chapter where the binomial distribution comes from a sequence of Bernoulli trials that follow 4 rules: (i) a fixed number of trials; (ii) two possible outcomes for each trial; (iii) trials are independent; and (iv) the probability of success is the same for each trial\n",
"- A set of 100 observations generated independently from a Unif(1,5) distribution."
]
}
],
"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.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}