6.2 Hypothesis Testing v1
6.2 Hypothesis Testing v1
6.2 Hypothesis Testing v1
Hypothesis Testing
Introduction
In hypothesis testing, an analyst collects sample data and
checks whether the data provide enough evidence to support
a theory, or hypothesis.
The hypothesis that an analyst is attempting to prove is called
the alternative hypothesis.
◦ It is also frequently called the research hypothesis.
Example
H0: 𝛍 = 𝟎 α/2 1-α α/2
Ha: 𝛍 ≠ 𝟎 (2.5%) (95%) (2.5%)
0 1.3 3.4
Practical versus Statistical
Significance
Statistically significant results are those that produce sufficiently small
p-values.
◦ In other words, statistically significant results are those that provide
strong evidence in support of the alternative hypothesis.
Such results are not necessarily significant in terms of importance. They
might be significant only in the statistical sense.
There is always a possibility of statistical significance but not practical
significance with large sample sizes.
By contrast, with small samples, results may not be statistically
significant even if they would be of practical significance.
Hypothesis Tests for a
Population Mean
As with confidence intervals, the key to the analysis is the sampling
distribution of the sample mean.
If you subtract the true mean from the sample mean and divide the
difference by the standard error, the result has a t distribution with n – 1
degrees of freedom.
◦ In a hypothesis-testing context, the true mean to use is the null hypothesis,
specifically, the borderline value between the null and alternative
hypotheses.
◦ This value is usually labeled μ0.
To run the test, referred to as the t test for a population mean, you calculate
the test statistic as shown below:
Hypotheses:
H0: μ≤ 0
Ha: μ> 0
Favour Old Style Favour New Style
≤0 >0
-10 0 +10
Rejection
region
α
(1-α) (5%) p
95% (0.0038)
Fail to reject H0
reject H0
0
t value
(2.8159)
tα,n-1
(2.023)
Hypothesis Tests for Other
Parameters
Just as we developed confidence intervals for a variety of
parameters, we can develop hypothesis tests for other
parameters.
In each case, the sample data are used to calculate a test statistic
that has a well-known sampling distribution.
Then a corresponding p-value measures the support for the
alternative hypothesis.
Hypothesis Tests for a
Population Proportion
To test a population proportion p, recall that the sample proportion has a
sampling distribution that is approximately normal when the sample size is
reasonably large.
◦ Specifically, the distribution of the standardized value
If the samples are independent, the test is referred to as the t test for
difference between means from independent samples.
◦ Test statistic for independent samples test of difference between means:
Example 9.4:
Soft-Drink Cans.xlsx (slide 1 of 3)
To run the test, select Chi-Square Test from StatTools Normality Tests dropdown
list.
Both the output and histograms below confirm that the normal fit to the data
appears to be quite good.
Example 9.7:
Testing Normality.xlsx (slide 3 of 5)
A more powerful test than the chi-square test of normality is the Lilliefors
test.
◦ This test is based on the cumulative distribution function (cdf), which
shows the probability of being less than or equal to any particular value.
◦ Specifically, the Lilliefors test compares two cdfs: the cdf from a normal
distribution and the cdf corresponding to the given data.
◦ This latter cdf, called the empirical cdf, shows the fraction of
observations less than or equal to any particular value.
◦ If the maximum vertical distance between the two cdfs is sufficiently
large, the null hypothesis of normality can be rejected.
Example 9.7:
Testing Normality.xlsx (slide 4 of 5)
To run the Lilliefors test for the Width variable in Example 9.7, select Lilliefors
Test from the StatTools Normality Tests dropdown list.
StatTools then shows the numerical outputs and the graph of the normal and
empirical cdfs.
Example 9.7:
Testing Normality.xlsx (slide 5 of 5)
Objective: To use the chi-square test of independence to test whether demand for
Windows laptops is independent of demand for Mac laptops.
Solution: Big Office wants to know whether the demands for Windows and Mac
laptops are related in any way.
Big Office has daily information on categories of demand for 250 days, with each
day’s demand for each type of computer categorized as Low, Medium Low,
Medium High, or High.
Example 9.8:
Laptop Demand.xlsx (slide 2 of 2)