The "claim" is called the null hypothesis and denoted H0.
The "suspicion" is called alternative hypothesis and denoted H1 or HA.
The (random) quantity we use to measure evidence is called a test statistic. We need to know its sampling distribution when H0 is true.
The p-value quantifies "the evidence against H0". A smaller p-value means more evidence against claim.
How small does the p-value need to be?
p-value ≤α then we reject H0
p-value >α then there is not enough evidence to rject H0
By convention α=0.01orα=0.05
Hypothesis Testing
A hypothesis is a conjecture concerning the value of a problem parameter.
Requires two competing hypotheses:
a null hypothesis, denoted by H0
an alternative hypothesis, denoted by H1 or HA
The hypothesis is tested by evaluating experimental evidence:
we rejectH0 if the evidence against H0 is strong
we fail to rejectH0 if the evidence against is H0 is insufficient
Errors in Hypothesis Testing
Two types of errors can be committed when testing H0 against H1.
Decision: reject H0
Decision: fail to reject H0
Reality: H0 is True
Type I Error
No Error
Reality: H0 is False
No Error
Type II Error
If we reject H0 when H0 is true ⇒ we have committed a type I error.
If we fail to reject H0 when H0 is false ⇒ type II error
Probability of Committing Errors and Power
The probability of committing type I error is usually denoted by:
α=P(rejectH0∣H0istrue).
The probability of committing type II error is:
β=P(failtorejectH0∣H0isfalse).
The power of test is the probability of correctly rejecting H0:
Power=P(rejectH0∣H0isfalse)=1−β
Conventional values of α,β and Power are 0.05, 0.2, 0.8, respectively.
Type of Null and Alternative Hypothesis
Let μ be the population parameter of interest. The hypotheses are expressed in terms of the values of this parameter.
The null hypotheses is a simple hypothesis, that is, it is of the form:
H0:μ=μ0
where μ0 is some candidate value ("simple" means that it is assumed to be a single value.)
The alternative hypothesis H1 is a composite hypothesis, i.e. it contains more than one candidate value.
Depending on the context, hypothesis testing takes on one of the following three forms:
H0:μ=μ0 where μ0 is a number.
against a two-sided alternative: H1:μ=μ0
against a left-sided alternative: H1:μ<μ0 or
against a right-sided alternative: H1:μ>μ0
The formulation of the alternative hypothesis depends on our research hypothesis and is determined prior to experiment or study.
Test Statistic and Critical Region
To test a statistical hypothesis statistics we use a test statistic. A test statistic is a function of the random sample and the population parameter of interest.
We reject H0 if the value of the test statistic is in the critical region or rejection area. The critical region is a subset of the real numbers.
The critical region is obtained using the definition of errors in hypothesis testing. We select the critical region so that
α=P(rejectH0∣H0istrue).
is equal to some pre-determined value, like 0.05 or 0.01.
Test for a Mean with Known Variance
Suppose X1,...,Xn is a random sample from a population with mean μ and variance σ2, let X=n1∑i=1nXi and denote the sample mean:
if the population is normal then X is exactly N(μ,σ2/n)
if the population is not normal, then as long as n is large enough, we have X is\simimately N(μ,σ2/n), according to the CLT.
In this section, we assume that the population variance σ2 is known, and that the hypothesis concerns the unknown population mean μ.
Explanation: Left-Sided Alternative
Consider the unknown population mean μ. Suppose that we would like to test:
H0:μ=μ0 against H1:μ<μ0
where μ0 is some candidate value for μ.
To evaluate the evidence against H0, we compare X to μ0: under H0,
Z0=σ/nX−μ0∼N(0,1)
We say that Z0 is the observed value of the Z-test statisticZ0. If z0 < 0, we have evidence that μ < μ0. However, we only reject H0 in favour of H1 if the evidence is _significant.
Critical Region: Let α be the level of significance. We reject H0 in favour of H1 only if z0≤−zα.
The corresponding p-value for the test is the probability of observing evidence as or more extreme than our current evidence in favour of H1, assuming that H0 is true (that is, simply by chance). Even more extreme in this case means further to the left; so p-value =P(Z≤z0)=Φ(z0), where z0 is the observed value for the Z-test statistic.
Decision Rule: if the p-value ≤α, then we rejectH0 in favour of H1. If the p-value >α, we fail to rejectH0.
Left-Sided Test
H0:μ=μ0 against H1:μ<μ0
At significance α, if z0≤−zα, we reject H0 in favour of H1.
Right-Sided Test
H0:μ=μ0 against H1:μ>μ0
At significance α, if z0≥−zα, we reject H0 in favour of H1.
Two-Sided Test
H0:μ=μ0 against H1:μ=μ0
At significance α, if ∣z0∣≥−zα, we reject H0 in favour of H1.
Procedure
To test for H0:μ=μ0, where μ0 is a constant.
set H0:μ=μ0
select an alternative hypothesis H1 (what we are trying to show using the data). Depending on context, we choose on of these alternatives:
H1:μ<μ0 (left-sided test)
H1:μ>μ0 (right-sided test)
H1:μ=μ0 (two-sided test)
choose α=P(typeIerror): typically α=0.01 or 0.05.
for the observed sample x1,...,xn, compute the observed value of the test statistics z0
determine the critical region as follows:
Alternative Hypothesis
Critical Region
H1:μ>μ0
z0>zα
H1:μ<μ0
z0<−zα
H1:μ=μ0
∥z0∥>zα/2
compute the associated p-value as follows:
Alternative Hypothesis
p-Value
H1:μ>μ0
P(Z>z0)
H1:μ<μ0
P(Z<z0)
H1:μ=μ0
2⋅min{P(Z>z0),P(Z<z0)}
Decision Rule: if the p-value ≤α, then we rejectH0 in favour of H1. If the p-value >α, we fail to rejectH0.
Test for a Mean with Unknown Variance
If the data is normal and σ is unknown, we can estimate it by the sample variance:
S=n−11∑i=1n(Xi−X2)
As we have seen for confidence intervals, the test statistic follows a Student's t-distribution with n−1 degrees of freedom.
T=S/nX−μ∼t(n−1)
We can follow the same steps as for the test with known variance, with the modified critical regions and p-values:
Alternative Hypothesis
Critical Region
H1:μ>μ0
t0>tα(n−1)
H1:μ<μ0
t0<−tα(n−1)
H1:μ=μ0
∥t0∥>tα/2(n−1)
where t0,tα(n−1) is the t-value satisfying P(T>tα(n−1))=α, and T follows a Student's t-distribution with n−1 degrees of freedom.
Alternative Hypothesis
p-Value
H1:μ>μ0
P(T>t0)
H1:μ<μ0
P(T<t0)
H1:μ=μ0
2⋅min{P(T>t0),P(T<t0)}
Two-Sample Tests
Unpaired
Let X1,1,...,X1,n be a random sample from a normal population with unknown mean μ1 and variance σ12; let Y2,1,...,Y2,m be a random sample from a normal population with unknown mean μ2 and variance σ22, with both populations independent of one another. We want to test:
H0:μ1=μ2 against H1:μ1=μ2
Let X=n1∑i=1nXi, Y=n1∑i=1nYi. The observed values are again denoted by lower case letters: x,y.
Case 1: SD1 and SD2 are known
Alternative Hypothesis
Critical Region
H1:μ>μ0
z0>zα
H1:μ<μ0
z0<−zα
H1:μ=μ0
∥z0∥>zα/2
where z0=σ12/n+σ22/mx−y,zα satisfies P(Z>zα)=α, and Z∼N(0,1)
Alternative Hypothesis
p-Value
H1:μ>μ0
P(Z>z0)
H1:μ<μ0
P(Z<z0)
H1:μ=μ0
2⋅min{P(Z>z0),P(Z<z0)}
Case 2: SD1 and SD2 are Unknown (Small Samples)
Alternative Hypothesis
Critical Region
H1:μ>μ0
t0>tα(n+m−2)
H1:μ<μ0
t0<−tα(n+m−2)
H1:μ=μ0
∥t0∥>tα/2(n+m−2)
where t0=Sp2/n+Sp2/mX−Y,Sp2=n+m−2(n−1)S12+(m−1)S22,tα(n+m−2) satisfies P(T>tα(n+m−2))=α, and T∼t(n+m−2)
Alternative Hypothesis
p-Value
H1:μ>μ0
P(T>t0)
H1:μ<μ0
P(T<t0)
H1:μ=μ0
2⋅min{P(T>t0),P(T<t0)}
Case 3: SD1 and SD2 are Unknown (Large Samples)
Alternative Hypothesis
Critical Region
H1:μ>μ0
z0>zα
H1:μ<μ0
z0<−zα
H1:μ=μ0
∥z0∥>zα/2
where z0=S12/n+S22/mX−Y,zα satisfies P(Z>zα)=α, and Z∼N(0,1)