Hypothesis Testing and p-values
- Source textbook: āAll of statisticsā Chapter 10
Suppose we want to know if exposure to asbestos (a desease) is associated with lung disease. We take some rats and randomly divide them into two groups. One is eposed to asbestos and the second group is unexposed. Then we compare the disease rate in the two groups.
Null Hypothesis
The null hypothesis: the disease rate is the same in the two groups The alternative hypothesis: the disease rate is not the same in the two groups.
If the exposed group has a much higher rate of diesease than the unexposed group then we will reject the null hypothesis annd conclude that the evidence favors the alternative hypothesis.
Suppose that we partition the parameter space
We call
Hypothesis testing
Let
reject retain
Usually the rejection region R is of the form:
is a test statistic is a critical value.
The problem in hypothesis testing is to find an appropriate test statistic
Warning: hypothesis testing methods are appropriate only when there is a well-defined hypothesis. Otherwise use estimation or confidence intervals.
Intuition: Hypothesis testing is like a legal trial. We assume someone is innocent unless the evidence strongly suggets that he is guilty. Similarly we retain
Type of errors
- Type I error: rejecting
when is true - Type II error: retaining
when is true
Definition: power function
The power function of a test with rejection region
The size of a test is defined by
A test is said to have level
Simple vs composite hypothesis:
- A hypothesis of the form
is called simple - Otherwise if
or is called a composite hypothesis
A test can be two-sided like:
or
is called a one-sided test.
The most common tests are two sided.
It would be desiderable to find the test with highest power under
The Wald Test
Let
Consider testing:
The size of
Theorem asymptotically the Wald test has size
Alternative version:
is the standard error computed at
Theorem: Suppose the true value of
Recall that
Example: Comparing Two prediction Algorithms
Let
be the size of the test set on which Algorithm 1 is tested. Algorithm 2 is tested on another test set of size Let be the number of incorrect prediction for A1 and Let be the number of incorrect predictions for A2. Let Binomial( ) and \Binomial( ). The null hypothesis is so we can write versus where . The MLE is with estimated standard error: The size of Wald test is to reject when where: The power of this test will be largest when is far from and when the sample sizes are large.
Theorem: The size
Thus, testing the hypothesis is equivalent to checking whether the null value is in the confidence interval.
The difference between statistical significance and scientific significance is easy to understand in light of previous theorem. Any confidence interval that excludes
p-Values
Rejecting or retaining an hypothesis is not very informative.
Instead we could ask for every
Generally, if the test rejects at level
Definition: Suppose that for ever
That is the smallest level at which we can reject

Informally, the p-value is a measure of evidence against

A large p-value is NOT strong evidence in favor of
A large p-value can occur for two reasons:
is true is false but the test has low power
p-value IS NOT the probability that the null hypothesis is true
Theorem: suppose that the size
- reject
if and only if
Then
- p-value =
where
- p-value =
We can express previous theorem as: āThe p-value is the probability (under
Theorem
Let

Theorem: if the test statistic has a continuos distribution, then under
Intuition: In other words if
The ^2 Distribution
distibution
Let
Let
We say that
The probability density of
- for
It can be shown that
The upper
- where
is the CDF - that is
Pearsonās test for multinomial data
This test is used for multinomial data.
- The name is similar to Pearson Correlation Coefficient for Feature Selection
Recall that if
Let
Definition: Pearsonās
- where
is the expected value of under
Theorem
Under

Example - Mendelās peas
Mendel bred peas with round yellow seeds and wrinkled green seeds. There are four types of progeny: round yellow, wrinkled yellow, round green, and wrinkled green.
The number of each type is multinomial with probability
In
We test that
Since
The
In the previous example, one could argue that hypothesis testing is not the
right tool. Hypothesis testing is useful to see if there is evidence to reject
Perhaps a confidence set for the distance between
Permutation Test
The permutation test is a nonparametric method for testing whether two distributions are the same.
This test is āexact,ā meaning that it is not based on large sample theory approximations.
This is the kind of test to consider when testing whether a treatment differs from placebo.
Let
versus
Let
Let
Under the null hypothesis, each of these values is equally likely. The distribution
Let
is the indicator function
Algorithm for Permutation Test:

In large samples, the permutation test usually gives similar results to a test that is based on large sample theory. The permutation test is thus most useful for small samples.
The Likelihood Ratio Test
- See also: ML1 lec3/ML1 - Lec4
It can be used for vector-valued parameter
Consider testing:
The likelihood ratio statistic is:
It is most useful when
Goodness-of-fit Tests
It is used when we want to check whether data come from an assumed parametric model.
There are many such test, here is one.
Let
be the probability that an observation falls on
Here
Maximizing
Now define the test statistic:
Theorem let
Goodness-of-fit testing has some serious limitations. If we reject
We may have failed to reject simply because the test did not have enough power. This is why it is better to use nonparametric methods whenever possible rather than relying on parametric assumptions.
Multiple Testing
In some situations we may conduct many hypothesis tests.
Multiple testing problem
Suppose each test is conducted at level
The problem comes up in many data mining situations where one may end up testing thousands or even millions of hypotheses.
There are many ways to deal with this problem. Here we discuss two methods.
Consider
Bonferroni Method
Given p-values
Theorem: Using the Bonferroni method, the probability of falsely rejecting any null hypotheses is less than or equal to
False Rate of Discovery (FDR)
The Bonferroni method is very conservative because it is trying to make it unlikely that you would make even one false rejection.
Sometimes, a more reasonable idea is to control the false discovery rate (FDR) which is defined as the mean of the number of false rejections divided by the number of rejections.
Suppose we reject all null hypothesis whose

The False Discovery Proportion (FDP) is:
The FPD is the proportion of rejections that are incorrect. Next define EDR=
The Benjamini-Hochberg (BH) method

