Beside Bayesian Inference there is Frequentist Inference, a well established way of making assumptions about an experiment. Frequentist Inference is especially used in medical research and similar fields, while Bayesian inference is mostly used in modern technology and had a comeback when computers became more powerful.

## Null Hypothesis Significance Test (NHST)

Suppose a friend tosses a coin 100 times and asks you afterwards if you think that the coin is fair or not. What would you answer when 95 heads show up? When 70 heads show up? When 53 heads show up? You might say that the first two outcomes are certainly not from a fair coin, but if you think about it more carefully you will figure out that there is a chance to have 70 or even 95 heads in 100 tosses even when the coin is fair. The question should therefore rather be: How certainly can I say if the coin is fair or not. The Null Hypothesis Significance Test helps us in this case. It answers the question if the data is well outside the region where we would expect it.

Before we can start with NHST we have to define a few things:

- : Null Hypothesis; The default assumption for the model generating the data.
- : Alternative Hypothesis; The hypothesis that must be accepted when the null hypothesis is rejected.
- X: Is the test statistic and is computed from the data.
- Rejection Region: If X is in the Rejection Region we accept
- ”Acceptance Region”: If X is in the “Acceptance Region” we do not reject .

**Example:** Lets simplify our Experiment. Suppose we toss a coin 10 times and have to decide afterwards if the coin is fair or not. We then have the following assumptions:

- is the probability that the coin lands heads.
- : “The coin is fair”;
- : “The coin is not fair”;
- X: “Number of heads in 10 tosses”
- Null Distribution:

And the following table:

X | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

p(x|) | 0.001 | 0.010 | 0.044 | 0.117 | 0.205 | 0.246 | 0.205 | 0.117 | 0.044 | 0.010 | 0.001 |

Now Let our rejection region be R{0, 1, 2, 8, 9, 10}. So if we have less than three or more than 7 heads, we reject our null hypothesis and suppose that the coin is not fair.

**Simple Hypothesis: **The null hypothesis from above is a simple hypothesis because the hypothesis and the “hypothesis distribution” is completely specified. In our case because

**Composite Hypothesis: **The alternative hypothesis from above is a composite hypothesis because it is not fully specified. That is because we just know that but we don’t really know which value has.

## Types of error

There are two types of error for an NHST.

**Type I error:**False rejection of ; We reject our null hypothesis though it is “correct”.**Type II error:**False acceptance of ; We accept or null hypothesis though it is “false”.

## Significance Level and Power

From the types of errors above we can derive the significance level and the power.

**Significance Level:**The probability that we incorrectly reject . We therefore have in more mathematical terms: P(reject |)=P(type I error)- Significance Level is the probability of thinking there is something interesting, something unusual, when there is not.

**Power:**The probability that we correctly reject . P(reject |)- Power is the probability of detecting something interesting, something unusual, when there is indeed something interesting, unusual.

We always try to have a small significance level and a large power.

## P-Values

Working with p-values makes the significance test often easy.

The p-value gives is the probability, assuming , of seeing data at least as extreme as our experimental data. If the p-value is less than our significance level , we reject .

**Z-Test for normal hypothesis**

One example for p-values is the z-test. To do the z-test we first have to define and . They are often normal-distributed. We then take the sample mean of our experimental data and standardise it while we assume that is true.

We then calculate the p-value:

## t-Tests

Another way of NHST is a t-test. Like many other tests, the t-test assumes data from a normal distribution. We should alway test if that applies. Either through plotting the data or by applying a normality test.

The t-test has the student-t-distribution as its basis: T~t(df) where df are the degrees of freedom.

**One Sample t-Test**

We use the z-test from above when we have unknown but known . But what do we do when we don’t know . Then we use the one-sample t-test and estimate .

We assume where both the mean and the variance are unknown.

Our null hypothesis is then that for some specific value .

We calculate the test-statistic with: , where

t is the standardised mean and is the sample variance.

Our null distribution is then the pdf of t(n-1) (t-distribution with n-1 degrees of freedom).

Using this information we can calculate the p-value and either reject or not reject the null hypothesis

**Example:**

- Data:
- and are unknown but we know that the data follows a normal distribution.

**Answer:**

- We don’t know the mean nor the variance so we use the one-sample t-test:
- So we do not reject our null hypothesis.

## Two Sample t-Test

The two sample t-test allows us to compare the means of two samples that have the same variance but we don’t know the variance.

- We assume and
- test statistic: where is the pooled variance.
- where are the sample variances.
- Our null hypothesis is then pdf of T~t(n+m-2)
- We can calculate the p-value like always.