Hypothesis Testing
Hypothesis Testing
It is a statistical method that is used in making
statistical decisions using experimental data.
It is basically an assumption that we make about
the population parameter.
Hypothesis Testing
Hypothesis testing was introduced by
Sir Ronald Fisher,
Jerzy Newman
Karl Pearson
Egon Pearson (Karl Pearson’s son)
Hypothesis Testing
3 Methods to Test the Hypothesis
traditional method
p-value
confidence interval
Two Types of Statistical Hypothesis
Null Hypotheses, symbolized by H0, is a statistical
hypothesis testing that assumes that the observation
is due to a chance factor.
Alternative hypothesis, symbolized by H1 it states
that there is a difference between two population
means (or parameters)
Level of Significance
The level of significance refers to the degree of
significance in which we accept or reject the null
hypothesis.
Level of significance is the maximum probability of
committing a Type I error.
That is, P(Type I error) = α.
Level of Significance
The critical or rejection value is the range of the values
of the test value that indicates that there is significant
difference and that the null hypothesis (H0) should be
rejected.
noncritical or nonrejection region is the range of the
values of the test value that indicates that the difference
was probably due to chance and that the null hypothesis
(H0) should not be rejected.
One Tailed versus Two Tailed
A one-tailed test shows that the H0 be rejected when
test value is in the critical region on one side of the
mean.
A two-tailed test, the H0 should be rejected when the
test value is in either of the two critical regions.
Steps in Conducting Hypothesis Testing
State the null hypothesis (H0) and the alternative hypothesis
(H1).
Choose the level of significance, α, and the sample size.
Determine the test statistic & sampling distribution.
Determine the critical values that divide the rejection and
nonrejection regions.
Collect the data and compute the value of the test statistic.
Make a statistical decision.
State the conclusion.
t Test for Two Small Independent Samples
Student’s t test (or t test for independent samples) of
difference of means is used to test the significance of
the difference between two sample.
The sample size should be less than 30.
It was developed by G.W. Gosset in 1908 and
published the pseudonym Student.
Example 1: t Test for 2 Small Samples
A researcher wishes to determine whether the monthly salary of
professional elementary teachers in private schools and
elementary teachers in public schools differs. He selected a
sample of elementary teachers, then the observations were shown
in the table below. At α = 0.05, can he conclude that the private
school teachers does not received the same salary with the public
school teachers? Assume that the populations are approximately
normally distributed
Private Public
= 16,400 = 15,170
s1 = 700 s2 = 800
n1 = 15 n2 = 9
Solution :
Step 1: State the hypotheses and identify the claim.
H0: μ1 = μ2
There is no significant difference between the salaries of
private and public school elementary teachers.
H1: μ1 ≠ μ2
There is significant difference between the salaries of
private and public school elementary teachers.
Solution :
Step 2: Level of significance is α = 0.05.
df = n1 + n2 – 2 = 15 + 9 – 2 = 22
Step 3: The t critical value is 2.074 (two-tailed test)
Step 4: Compute the test value
Solution :
Step 5: Decision rule.
Reject H0
-2.074 0 +2.074 3.953
Step 6: Conclusion.
There is enough evidence to support the claim that the
salaries paid to elementary teachers employed in private
schools are different with in elementary teachers in public
schools.
t Test for Paired Samples
Paired sample t test is a statistical technique that is
used to compare two population means in the case of
two samples that are correlated. It is used in “before
after” studies, or when the samples are the matched
pairs, or the case is a control study
Assumptions in Paired t test
Only the matched pair can be used to perform the
paired sample t test.
In the paired sample t test, normal distributions are
assumed.
The variance of two samples is the same.
The observations must be independent of each other.
Example 2: Paired t Test
The management of Resale Furniture, a change of second hand
furniture stores in Metro Manila, designed an incentive plan for
salespeople. To evaluate this innovative incentive plan, 10
salespeople were selected at random, and their weekly incomes
before and after the incentive plan were recorded.
Salesperson 1 2 3 4 5 6 7 8 9 10
Before 2,000 3,000 2,500 3,100 1,900 1,750 2,300 3,210 2,340 1,870
After 3,500 4,120 3,800 4,200 1,820 1,600 3,400 1,900 2,340 3,290
Was there a significant increase in the typical salesperson’s
weekly income due to the innovative incentive plan? Use the 0.05
significance level.
Solution :
Step 1: State the hypotheses and identify the claim.
H0: μA = μB
The income after incentive plan is equal to the income
before the incentive plan.
H1: μA > μB
The income after incentive plan is greater than before the
incentive plan.
Solution :
Step 2: Level of significance is α = 0.05.
df = n - 1 = 10 – 1 = 9
Step 3: The t critical value is 1.833 (one-tailed test)
Solution 3:
Salesperson Before (X1) After (X2) D = X2 – X1 D2 = (X2 – X1)2
1 2,000 3,500 1,500 2,250,000
2 3,000 4,120 1,120 1,254,400
3 2,500 3,800 1,300 1,690,000
4 3,100 4,200 1,100 1,210,000
5 1,900 1,820 –80 6,400
6 1,750 1,600 –150 22,500
7 2,300 3,400 1,100 1,210,000
8 3,210 1,900 –1,310 1,716,100
9 2,340 2,340 0 0
10 1,870 3,290 1,420 2,016,400
6,000 11,375,800
Solution 3:
Step 4: Compute the test value
Determine the mean of the differences.
Determine the standard dev. of the differences.
Solution 3:
Step 5: Decision rule.
Reject H0
0 1.833 2.041
Step 6: Conclusion.
We can conclude that there is enough evidence to support
the claim that the income after the incentive plan is
greater than before the incentive plan.
Analysis of Variance
Sir Ronal A. Fisher
ANOVA is a powerful
statistical tool developed in
the 1950’s by Sir Ronald A.
Fisher
Statistician and geneticist
Knighthood bestowed
for work in statistics
What is Analysis of Variance?
A statistical procedure for comparing three or more
conditions or groups to see if the difference among group
variances are greater than would be expected by chance
alone.
The critical value is calculated on the F statistic, a ratio of
between groups effects to within group variability.
Different Forms of ANOVA
One-way ANOVA
One-Way ANOVA Repeated measures
Two and three-way ANOVA (factorial designs)
Mixed designs, where one factor is repeated but
another is held constant (factorial designs)
Sum of Squares
ANOVA uses sums of squares to analyze differences
between groups
The larger the sum of squares, the greater the
variability in a data set
Degrees of Freedom of ANOVA
Degrees of freedom are stated for the various
calculations, such as for total subjects, for between
groups, and for within groups. They are used to help
calculate the various F ratios
Mean Squares
Sums of squares are converted into a variance
estimate or mean square
Each sum of squares is divided by its respective
degrees of freedom to get the mean square
Post-hoc Test
ANOVA only tells you there is a difference between
groups, not which group shows greatest change
Use post-hoc tests to tell you which group is
different
Characteristics of ANOVA
The value of F is at least zero. (F cannot be negative)
F distribution is continuous, is positively skewed, and its
values may range from 0 to positive infinity.
The F distribution is based on two sets of degrees of freedom.
(numerator and denominator)
There is a family of F distribution. Each time the no. of df
changes, a new F distribution is created.
Assumptions of ANOVA
Conditions before employing the ANOVA:
The data must be at least of interval scale.
The population being studied must be approximately normally
distributed.
The populations should be approximately equal standard
deviations.
The sample should be randomly selected.
The populations are independent.
Sample problem (One-way ANOVA)
A concerned consumer organization was interested in determining whether
any difference existed in the average life of four different brands of
fluorescent bulbs A random sample of five fluorescent bulbs of each brand
was tested with the following results (in months):
Brand A Brand B Brand C Brand D
12 11 12 12
13 10 11 15
14 13 15 10
11 15 15 12
15 14 16 11
At the 0.05 level of significance, is there evidence of significant
difference in the average life of these four brands of fluorescent bulbs?
F computation
Step 1: State the Hypotheses.
H0: µA = µB = µC = µD
(All the fluorescent bulbs have equal life time means.)
H1: µA ≠ µB ≠ µC ≠ µD
(Not all the fluorescent bulbs have equal life time means.)
Step 2: The level of significance is α = 0.05.
Step 3: Determine the critical region.
dfbg = k – 1 = 4 – 1 = 3 and dfwg = n – k = 20 – 4 = 16
Fcritical = F3,16 = 3.24
p value = 0.53
Critical values of F for 0.05
df = (dfbg, dfwg) = (3, 16)
dfbg for the Numerator
1 2 3 …
dfwg for the Denominator 1 161.50 199.5 215.70 …
2n 18.51 19.00 19.16 …
: : : :
: : : …
16 3.24 …
F computation
Step 4: Compute for the value of F.
We have to compute for the means of all the groups (Brand A, B, C, and
D) and the total mean.
= mean of group A (Brand A)
= mean of group B (Brand B)
= mean of group C (Brand C)
= mean of group D (Brand D)
= mean of total subjects (Brand A, B, C, D)
Computation of means
SSB Computation
No. XA XB XC XD
1 12 11 12 12
2 13 10 11 15
3 14 13 15 10
4 11 15 15 12
5 15 14 16 11
Total 65 63 69 60
Mean 12
13 12.6 13.8
= 5(13 – 12.85)2 + 5(13.8 – 12.85)2 + 5(12.6 – 12.85)2 + 5(12 –
12.85)2
= 5(0.0225) + 5(0.9025) + 5(0.0625) + 5(0.7225)
= 0.1125 + 4.5125 + 0.3125 + 3.6125
= 8.55
SSW Computation
No. XA XB XC XD
1 12 11 12 12 1.00 2.56 3.24 0.00
2 13 10 11 15 0.00 6.76 7.84 9.00
3 14 13 15 10 1.00 0.16 1.44 4.00
4 11 15 15 12 4.00 5.76 1.44 0.00
5 15 14 16 11 4.00 1.96 4.84 1.00
Total 65 63 69 60 10.00 17.20 18.80 14.00
Mea 12. 12
n 13 6 13.8
= 10 + 17.20 + 18.80 + 14
= 60
SST Computation
No. XA XB XC XD
1 12 11 12 12 0.7225 3.4225 0.7225 0.7225
2 13 10 11 15 0.0225 8.1225 3.4225 4.6225
3 14 13 15 10 1.3225 0.0225 4.6225 8.1225
4 11 15 15 12 3.4225 4.6225 4.6225 0.7225
5 15 14 16 11 4.6225 1.3225 9.9225 3.4225
Total 65 63 69 60 10.1125 17.5125 23.3125 17.6125
= 12.85
= 10.1125 + 17.5125 + 23.3125 +
17.6125
= 68.55
Test statistic
Table for One-way ANOVA
Source of Sum of Squares Degrees of Mean Square F
Variations Freedom (Variance)
Between Groups dfbg = k – 1
Within Groups dfwg = n – k
Total n–1
Table for One-way ANOVA
Source of Sum of Degrees of Mean Square F
Variations Squares Freedom
Between Groups 8.55 4–1=3 2.85 0.76
Within Groups 60.00 20 – 4 = 16 3.75
Total 68.55 20 – 1 = 19
Test statistic
Step 5: Decision Rule.
Since the computed F-value of 0.76 is less than the F critical value of
3.24 at level of significance of 0.05, the statistical decision is do not
reject the null hypothesis.
Rejection
Region
F-value = 0.76 3.24 (p = 0.05)
p = 0.53
Note: p obtain > p critical
F obtain < F critical
Continuation…
Step 6: Conclusion.
Since the null hypothesis has not been rejected, we can conclude that
there no is evidence that shows significant difference in the average
life time of the fluorescent bulbs.
Violations of the required conditions
If the data are not normally distributed we can replaced the
one-way ANOVA with its nonparametric counterpart, which is
the Kruskal-Wallis test.
Correlation and Regression
Analysis
Correlation
Correlation refers to the departure of two random
variables from independence.
Pearson product-moment correlation (PPMC) is the
most widely used in statistics to measure the degree of
the relationship between the linear related variables.
The correlation coefficient is defined as the covariance
divided by the standard deviations of the variables.
Pearson product-moment correlation
Pearson’s product-moment correlation coefficient of
simply correlation coefficient (or Person’s r) is a
measure of the linear strength of the association
between two variables.
Founded by Karl Pearson.
The value of the correlation coefficient varies
between +1 and –1.
Correlation Coefficient
Y Variable
Y Variable
X Variable X Variable
Perfect Positive Correlation (r = 1.00) Perfect Negative Correlation (r = -1.00)
Y Variable
Y Variable
X Variable X Variable
Positive Correlation (r = 0.80) Negative Correlation (r = -0.80)
Correlation Coefficient
Y Variable
Y Variable
X Variable X Variable
Zero Correlation (r = 0.00) Non-Linear Correlation (r = -1.00)
Pearson product-moment correlation
Test of Significance
df = n – 2
Correlation Coefficient & Strength of Relationships
0.00 – no correlation, no relationship
±0.01 to ±0.20 – slight correlation, almost negligible relationship
±0.21 to ±0.40 – slight correlation, definite but small relationship
±0.41 to ±0.70 – moderate correlation, substantial relationship
±0.71 to ±0.90 – high correlation, marked relationship
±0.91 to ±0.99 – very high correlation, very dependable relationship
±1.00 – perfect correlation, perfect relationship
Assumptions
Subjects are randomly selected and independently
assigned to groups.
Both populations are normally distributed.
Procedure for Pearson Product-Moment Corr. test
Set up the hypotheses.
H0: = 0 (The correlation in the population is zero.)
H1: 0, 0, 0 (The correlation in the population is
different from zero.)
Calculate the value of Pearson’s r.
Calculate the value of t value.
Statistical decision for hypothesis testing
If tcomputed tcritical, do not reject H0.
If tcomputed tcritical, reject H0.
Example 1: Pearson r
The owner of a chain of fruit shake stores would like to study the
correlation between atmospheric temperature and sales during the summer
season. A random sample of 12 days is selected with the results given as
follows:
Day 1 2 3 4 5 6 7 8 9 10 11 12
Temperature (°F) 79 76 78 84 90 83 93 94 97 85 88 82
Total Sales (Units) 147 143 147 168 206 155 192 211 209 187 200 150
Plot the data on a scatter diagram. Does it appear there is a relationship
between atmospheric temperature and sales? Compute the coefficient of
correlation. Determine at the 0.05 significance level whether the correlation
in the population is greater than zero.
Scatter Plot
220
210
200
190
Sales (Y)
180
170
160
150
140
130
70 75 80 85 90 95 100
Temperature (X)
Solution 1:
Step 1: State the hypotheses.
H0: r = 0
There is no correlation between atmospheric
temperature and total sales of fruit shake.
H1: r 0
There is a correlation between atmospheric temperature
and total sales of fruit shake.
Step 2: Level of significance is α = 0.05.
Step 3: df = n–2 = 12 – 2 = 10 & t critical value is 2.228.
Step 4: Compute the Pearson’s r.
Table
Day X Y X2 Y2 XY
1 79 147 6,241 21,609 11,613
2 76 143 5,776 20,449 10,868
3 78 147 6,084 21,609 11,466
4 84 168 7,056 28,224 14,112
5 90 206 8,100 42,436 18,540
6 83 155 6,889 24,025 12,865
7 93 192 8,649 36,864 17,856
8 94 211 8,836 44,521 19,834
9 97 209 9,409 43,681 20,273
10 85 187 7,225 34,969 15,895
11 88 200 7,744 40,000 17,600
12 82 150 6,724 22,500 12,300
Total 1,029 2,115 88,733 380,887 183,222
Computation of Pearson’s r
= 0.93
The atmospheric temperature and total sales indicates a very
high positive correlation (very dependable relationship)–that is
an increased in atmospheric temperature is highly associated
with the increased in total sales of fruit shake.
Solution 2:
Step 5: Decision rule.
Reject H0
-2.228 0 +2.228 8.00
Step 6: Conclusion.
We can conclude that there is evidence that shows
significant association between the atmospheric
temperature and the total sales of fruit shake.