Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 41

HYPOTHESIS

TESTING
.1 NULL AND ALTERNATIVE HYPOTHESES
2 TEST STATISTIC
3 P-VALUE
4 SIGNIFICANCE LEVEL
5 ONE-SAMPLE Z TEST
6 POWER AND SAMPLE SIZE
Terms Introduce in Prior Chapter

 Population  all possible values


 Sample  a portion of the population
 Statistical inference  generalizing from a sample to a
population with calculated degree of certainty
 Two forms of statistical inference
Hypothesis testing
 Estimation
 Parameter  a characteristic of population, e.g., population mean
µ
 Statistic  calculated from data in the sample, e.g., sample mean (
)
x
Distinctions Between Parameters
and Statistics
Parameters Statistics

Source Population Sample

Notation Greek (e.g., μ) Roman (e.g., xbar)

Vary No Yes

Calculated No Yes
Sampling Distributions of a Mean (Introduced in
Ch 8)
The sampling distributions of a mean (SDM)
describes the behavior of a sampling mean

x ~ N  , SE x 

where SE x 
n
Hypothesis Testing
 Is also called significance testing
 Tests a claim about a parameter using evidence (data in a sample)
 The technique is introduced by considering a one-sample z test
 The procedure is broken into four steps
 Each element of the procedure must be understood
Hypothesis Testing Steps
A. Null and alternative hypotheses
B. Test statistic
C. P-value and interpretation
D. Significance level (optional)
Null and Alternative Hypotheses

 Convert the research question to null and alternative hypotheses


 The null hypothesis (H0) is a claim of “no difference in the population”
 The alternative hypothesis (Ha) claims “H0 is false”
 Collect data and seek evidence against H0 as a way of bolstering Ha (deduction)
Illustrative Example: “Body
 Weight”
The problem: In the 1970s, 20–29 year old men in the U.S. had a mean μ body
weight of 170 pounds. Standard deviation σ was 40 pounds. We test whether mean
body weight in the population now differs.

Null hypothesis H0: μ = 170 (“no difference”)
 The alternative hypothesis can be either Ha: μ > 170 (one-sided test) or
Ha: μ ≠ 170 (two-sided test)
Test Statistic

This is an example of a one-sample test of a


mean when σ is known. Use this statistic to
x  0
test the problem: z stat 
SE x
where  0  population mean assuming H 0 is true

and SE x 
n
Illustrative Example: z statistic

 For the illustrative example, μ0 = 170


 We know σ = 40
 Take an SRS of n = 64. Therefore
 40
SE x   5

n 64
If we found a sample mean of 173, then

x   0 173  170
zstat    0.60
SE x 5
Illustrative Example: z statistic
If we found a sample mean of 185, then

x   0 185  170
zstat    3.00
SE x 5
Reasoning Behinµzstat

x ~ N 170,5
Sampling distribution of xbar
under H0: µ = 170 for n = 64 
P-value

We have the range of values on the x-axis and the


frequency of occurrences of different values on the y-
axis.
Now, let’s say we pick any random value from this
distribution. The probability that we will pick values
close to the mean is highest as it has the highest peak
(due to high occurrence values in that region). We can
clearly see that if we move away from the peak, the
occurrence of the values decreases rapidly and so does
the corresponding probability, towards a very small
value close to zero.
p-value is the cumulative probability (area
under the curve) of the values to the right of
the red point in the figure .

p-value corresponding to the red point tells us about the ‘total


probability’ of getting any value to the right hand side of the
red point, when the values are picked randomly from the
population distribution.
P-value

 The P-value answer the question: What is the probability


of the observed test statistic or one more extreme when
H0 is true?
 This corresponds to the AUC in the tail of the Standard
Normal distribution beyond the zstat.
 Convert z statistics to P-value :
For Ha: μ> μ0  P = Pr(Z > zstat) = right-tail beyond zstat
For Ha: μ< μ0  P = Pr(Z < zstat) = left tail beyond zstat
For Ha: μμ0  P = 2 × one-tailed P-value
 Use Table B or software to find these probabilities (next
two slides).
One-sided P-value for zstat of 0.6
One-sided P-value for zstat of 3.0
Two-Sided P-Value

 One-sided Ha  AUC in tail


beyond zstat
 Two-sided Ha  consider
potential deviations in both
directions  double the one-sided
P-value Examples: If one-sided P
= 0.0010, then two-sided
P = 2 × 0.0010 = 0.0020.
If one-sided P = 0.2743,
then two-sided P = 2 ×
0.2743 = 0.5486.
Statistical Significance of the p-
value: Enter – Alpha value

Alpha value is nothing but a threshold p-value, which the group


conducting the test/experiment decides upon before conducting a
test of similarity or significance ( Z-test or a T-test).

This means that if the likeliness of getting the sample score is less
than alpha or the threshold p-value, we consider it significantly
different from the population, or even belonging to some new
sample distribution.
Consider the above normal distribution again. The red point in this distribution
represents the alpha value or the threshold p-value. Now, let’s say that the green and
orange points represent different sample results obtained after an experiment.
We can see in the plot that the leftmost green point has a p-value greater than the
alpha. As a result, these values can be obtained with fairly high probability and
the sample results are regarded as lucky.
The point on the rightmost side (orange) has a p-value less than the alpha value (red).
As a result, the sample results are a rare outcome and very unlikely to be lucky.
Therefore, they are significantly different from the population.
The alpha value is decided depending on the test being performed. An alpha value of
0.05 is considered a good convention if we are not sure of what value to consider.
The smaller the value of alpha we consider, the harder it is to consider the results
as significant.
P-value < alpha
alpha value.
This is basically the threshold p-
value
. We can clearly see that the area
under the
curve
to the right of the threshold is
very low.
The orange point represents the
p-value using the sample
population. In
this case, we can clearly see that
the
p-value is less than the alpha value
The results obtained from the sample is an extremity of the population
distribution (an extremely rare event), and hence there is a good chance it
may belong to some other distribution (as shown below)
 Right – I feel you should answer this question before reading
further. Now that you know the other side of this coin, you will be
able to think of the outcome of this scenario.
 p-value greater than the alpha means that the results are in favor of
the null hypothesis and therefore we fail to reject it. This result is
often against the alternate hypothesis (obtained results are from
another distribution) and the results obtained are not significant
and simply a matter of chance or luck.
 Again, consider the same population distribution curve with the
red point as alpha and the orange point as the calculated p-value
from the sample:
 So, p-value > alpha (considering the area under the curve to
the right-hand side of the red and the orange points) can be
interpreted as follows
 The sample results are just a low probable event of the
population distribution and are very likely to be obtained by
luck.
 We can clearly see that the area under the population curve to
the right of the orange point is much larger than the alpha
value. This means that the obtained results are more likely to
be part of the same population distribution than being a part of
some other distribution.
Example of p-value in Statistics

 In the National Academy of Archery, the head coach intends to


improve the performance of the archers ahead of an upcoming
competition. What do you think is a good way to improve the
performance of the archers?
 The statistics before and after experiments are below:
 The results favor the assumption that the overall score of the
archers improved. But the coach wants to make sure that these
results are because of the improved ability of the archers and
not by luck or chance. So what do you think we should do?
 In order to solve this, we will follow a step-by-step approach:
1. Understand the information given and form the alternate and
null hypothesis
2. Calculate the Z-score and find the area under the curve
3. Calculate the corresponding p-value
4. Compare the p-value and the alpha value
5. Interpret the final results
Step 1: Understand the given
information

• Population Mean = 74
• Population Standard Deviation = 8 (Historical data of the last
10 years is associated to the population)
• Sample Mean = 78
• Sample Size = 60 (Here, the sample is associated with the
archers who practiced breathing exercises and meditation)
 We have the population mean and standard deviation with us
and the sample size is over 30, which means we will be using
the Z-test.
 According to the problem above, there can be two possible
conditions:
1. The after-experiment results are a matter of luck, i.e. mean
before and after experiment are similar. This will be our “Null
Hypothesis”
2. The after-experiment results are indeed very different from the
pre-experiment ones. This will be our “Alternate Hypothesis”
Step 2: Calculating the Z-Score
• X = Population Mean
• M = Sample Mean
• Sigma = Population Standard Deviation
• n = number of sample instances
 On plugging in the corresponding values, Z-Score comes out
to be – 3.87.

Step 3: Referring to the Z-table and
finding the p-value:

 The probability that we obtained is to the left of the Z-score (Red Point)
which we calculated. The value 0.999 represents the “total probability” of
getting a result “less than the sample score 78”, with respect to the
population.
 For this, we will use the fact that the total area under the normal Z
distribution is 1. Therefore the area to the right of Z-score (or p-value
represented by the unshaded region) can be calculated as:
 p-value = 1 – 0.999
 p-value = 0.001
 0.001 (p-value) is the unshaded area to the right of the red point. The
value 0.001 represents the “total probability” of getting a result “greater
than the sample score 78”, with respect to the population.

Step 4: Comparing p-value and alpha
value:
 We were not given any value for alpha, therefore we can consider alpha =
0.05. According to our understanding, if the likeliness of obtaining the
sample (p-value) result is less than the alpha value, we consider the sample
results obtained as significantly different.
 We can clearly see that the p-value is far less than the alpha value:
 0.001 (red region) << 0.5 (orange region)
 This says that the likeliness of obtaining the mean as 78 is a rare event with
respect to the population distribution. Therefore, it is convenient to say
that the increase in the performance of the archers in the sample
population is not the result of luck. The sample population belongs to
some other (better in this case) distribution of itself.

You might also like