0% found this document useful (0 votes)
283 views43 pages

2 Hypothesis-Testing

1) Hypothesis testing involves setting up a null hypothesis (H0) and an alternative hypothesis (H1) about a population parameter. 2) A test statistic is computed from a sample and compared to a critical value to either reject or fail to reject the null hypothesis. 3) There are two types of errors - Type I error rejects a true null hypothesis and Type II error fails to reject a false null hypothesis. 4) Common hypothesis tests include those for a single mean, difference of means, single proportion, and difference of proportions. Large sample tests assume sampling distributions are approximately normal.

Uploaded by

Muskan Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
283 views43 pages

2 Hypothesis-Testing

1) Hypothesis testing involves setting up a null hypothesis (H0) and an alternative hypothesis (H1) about a population parameter. 2) A test statistic is computed from a sample and compared to a critical value to either reject or fail to reject the null hypothesis. 3) There are two types of errors - Type I error rejects a true null hypothesis and Type II error fails to reject a false null hypothesis. 4) Common hypothesis tests include those for a single mean, difference of means, single proportion, and difference of proportions. Large sample tests assume sampling distributions are approximately normal.

Uploaded by

Muskan Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 43

Hypothesis Testing

A statistical hypothesis is some statement about the


population, which may or may not be true. Under
Hypothesis Testing , we have to test the validity of this
statement on the basis of the evidence from a random
sample.

Null Hypothesis: if we want to test any statement


about the population, we setup null hypothesis which
says that the statement is true, e.g. if we want to find
out if the population mean has a specified value say μ0,
then null hypothesis is set up as:
H0 :   0
Alternative Hypothesis:

H1 :   0
Procedure For Hypothesis Testing
Step I : setup the null Hypothesis e.g. H 0 :   0
Step II : setup the Alternative Hypothesis e.g. H1 :   0
Step III: Decide level of significance e.g. α = 5%
Step IV: Compute test – statistic under the validity of
null hypothesis as
x  E( x )
Z ~ N (0,1)
S .E ( x )
where E ( x )   , Z can be defined as a
Standard Normal Variate ( S .N .V ) for any statistic
Step V: Conclusion: We compare the computed value of Z in
step (iv) with the significant value Zα (tabulated value)
at given level of significance ‘α’
if |Z| < Zα, then Z is not significant i.e. difference b/w statistic and the
difference is just due to sampling fluctuations
H0 can not be rejected & Vice – Versa.
Step VI: Making Decision
Types of Error in Hypothesis Testing
Type I Error: Reject H0 when it is true P (Type I Error)= α
α: Level of significance
1- α = P (Rejecting H0 when it is false)

Type II Error: Accept H0 when it is false


P (Type II Error)= β
1- β = P (Accepting H0 when it is true)

Critical Values Level of Significance (α)


1% 5% 10%

Two Tailed Test 2.58 1.96 1.645

Right Tailed Test 2.33 1.645 1.28

Left Tailed Test -2.33 -1.645 -1.28


Type I and Type II Error

Accept H0 Reject H0

H0 True Correct decision Type I Error

H0 False Type II Error Correct decision


Hypothesis Testing
• Single Mean
• Difference of Mean
• Single Proportion
• Difference of Proportion
Z Test Statistic for the Mean
of a Normal Population
• Assumptions
– Population is normally distributed
– If not normal, requires large samples
• z test statistic

x x
z 
x 
n
Sampling Distribution of Mean

X has a sampling distribution with mean 


i.e. E( X ) = 
X  
Z=

2

X follows Normal Distribution with mean  and S .E .( X )


2

as
n
Acceptance and Rejection Region
Accept null hypothesis if test statistic falls in the acceptance region

0.475 on each side

0.95 of area
0.025 Acceptance Region
0.025

1.96 1.96
P-value (Observed Level of Significance)
• P-value – If p-value is more than  , Null hypothesis
accepted. Will be rejected if p-value is less than 
Large Sample Test
Sample is large if n > 30
S.N.V to a statistic:
t  E (t )
Z  ~ N (0,1) as n  
S .E.(t )
Test For Proportion Test For Mean
pP x
Z ~ N (0,1) Z ~ N (0,1)
PQ / n / n
Limits for P at α Limits for μ at α
Level of significance: Level of significance:
PQ 
P  p  z   x  z
n n
 PQ   2 
P ~ N  P,  x ~ N   , 
 n   n 
Area under standard normal distribution between the mean and
successive value of Z
(i) Testing the significance of mean (x )

x  E(x) x
Z 
S .E ( x ) 2 /n

Compare Z 0.05 = 1.96 with |Z|

Critical values of Z Level of Significance


5% 10% 1%
Two - tailed 1.96 1. 645 2.58
One - tailed 1. 645
Example
A sample of 200 bulbs made by a company give a
lifetime mean of 1540 hours with a standard
deviation of 42 hours. Is it likely that the sample has
been drawn from a population with a mean lifetime
of 1500 hours? You may use 5 percent level of
significance.
Example
Company dealing in readymade garmnets wants to know consumer’s
rating of their product. One set of 100 consumers selected in Delhi.
Asked to rate their brand on a scale of 5. Sample average came out to
be 4.724 and standard deviation was 2.93. Now market researcher
wants to know whether the consumer’s rating exceeds 4 or not.

H0 :   4
H1 :   4
  0.05
x 4.724  4
Z   2.471
2 /n 0.293
z0.05 (one- tailed)=1.645
|Z| > z0.05 H1 accepted
On a typing test, a random sample of 36
graduates of a secretarial school averaged 73.6
word with a standard deviation of 8.10 words per
minute. Test an employer claim that the school’s
graduates average is less than 75 words per
minute using the 5 percent level of significance.
From past studies the monthly average household
expenditure on food items in a locality is 2700
with a standard deviation of Rs 160. An
economist took a random sample of 25
households from the locality and found that their
monthly household expenditure on food items to
be Rs 2790. At 0.01 level of significance, can we
conclude that the average household expenditure
on the food items is greater than Rs 2700?
(Critical Value for 0.01 is 2.33)
Prices of share of a company on the different
days in a month were found to be 66, 65, 69, 70,
69, 71, 70, 63, 64 and 68. Examine whether the
mean price of shares in the month is different
from 65. You may use 10 percent level of
significance. (Critical value for 10 percent level
of significance is 1.833)
Tests for difference between two
population means
Case of large sample

City Sample Mean Standard Sample Size


Hourly Deviation of
Earnings Sample
Denver 8.85 0.40 200
New Jersey 9.10 0.60 175

A study is carried out to examine whether the mean hourly wages of the
unskilled workers in the two cities are same. The random sample of hourly
earnings in both the cities is taken and the results are presented in the given
Table. Using 5 percent level of significance, test the hypothesis of no
difference in the average wages of unskilled workers in the two cities.
(ii) Test of significance for difference of Means

Whether the two population means are same or not?

H 0 : 1   2
H1 : 1   2

x1  x2
Z  ~ N (0,1)
1 2
2 2

n1 n2
Sampling Distribution of Difference in Means

• In large samples, the difference in two sample means is


approximately normally distributed:
  2
 2 
Y 1  Y 2 ~ N  1   2 , 1
 2 
 n n 
 1 2 

• Under the null hypothesis, 1-2=0 and:

Y1 Y 2
Z ~ N (0,1)
 2
 2
1
 2
n1 n2

• 12 and 22 are unknown and estimated by s12 and s22
Past records indicate that a golfer has averaged
7.9 on certain course. With new set of clubs, he
averages 8.2 over five rounds with a standard
deviation of 2.65. Can we conclude that at 0.025
level of significance, the new club has an
adverse effect on the performance? (alpha value
is 2.776)
Two types of medicines are meant to provide
relief to arthritis sufferers were produced in two
different laboratories. The first medicine was
administered to a group of 12 patients and
produced an average of 8.5 hours of relief with a
standard deviation of 1.8 hours. The second
medicine was tested on a sample of 8 patients
and produced an average of 7.9 hours of relief
with a standard deviation of 2.1 hours. Test the
hypothesis that the first medicine drug differs
from second medicine in providing a
significantly higher period of relief. Use 5
percent level of significance.
There were two medicines of ( 1 and 2) that were tried on some
patients for reducing weight. There were 8 adults who were
subjected to medicine 1 and 7 adults who were administered
medicine 2. The decrease in weight (in pounds) is given below:
Medicine 1 10 8 12 14 7 15 13 11
Medicine 2 12 10 7 6 12 11 12

Do the drug differ significantly in their effect on decreasing


weight? You may use 5 per cent level of significance. Assume
that the variances of two populations are not same.
Case of paired sample (dependent sample)

Suppose we are interested in comparing two


teaching methods on the basis of average scores
obtained by the management trainees divided
randomly into two equal sizes, one taught by
each method. After obtaining the scores by two
methods, the null hypothesis of average scores
being equal by two methods is written as:
Case of paired sample (dependent sample)

A company selects 8 salesmen randomly and recorded their sales


figure for the previous month. They then undergo a training
course devised by a business consultant, and their sales figure for
the following month are compared as shown in the table. Has the
training course caused an improvement in the ability of
salesman? Use 0.05 level of significance (Given tabulated t value
for 0.05 is 1.895).
Previous 75 90 94 95 100 90 70 64
Month
Following 77 101 93 92 105 88 76 68
Month
Example - Efficacy Test for New drug
• Null hypothesis - New drug is no better than standard trt

H 0 :  New   Std

• Alternative hypothesis - New drug is better than standard trt

H A :  New   Std
• Experimental (Sample) data:

y New y Std
s New sStd
nNew nStd
Example:
In order to make a survey of the buying habits, two markets A
& B are chosen at two different parts of a city.

Market A Market B

n1  400 n2  400
x1  250 x2  220
s1  40 s2  55

xi Average weekly expenditure on food


Test at 5 % level of significance whether the average
weekly food expenditure of two populations of shoppers
is equal.
Example: Suppose company wants to know the rating
of their brand in two different cities is same or not.

H 0 : 1   2
H1 : 1   2

Average rating on internal scale in Delhi is same as in


Bombay or different.
Whether the two population means are same or not?

H 0 : 1   2
H1 : 1   2

54
Z  ~ N (0,1)
2.9 2.6

40 40
Z  1.90

Hence ratings in two cities are same.


Z-test
(ii) Significance of Proportion:
p  E ( p) pP
Z 
S.E ( p) PQ / n
Compare Z0.05 =1.96 with |Z|
Example:
(i) say, 65% of customers will like the new package design
(ii) 80% of the dealers will prefer the new pricing policy

H 0 : P  .65 H 0 : P  .80
H1 : P  .65 H1 : P  .80
Small Sample Tests
If the sample size n is small (less than or equal to 30), then
the sampling distribution of the statistics is far from
normality. The normal test can’t be applied. Exact Sample
Tests are applied in such cases.
Assumptions:

(i) The Parent population from which the sample is


drawn is normally distributed.
(ii) The sample is random and independent of each other.
x x
T- test t  ~ t n 1
s2 / n  1 S2 / n
S2 
 (x  x) 2

Confidence Limits for μ n 1


( n  1) S 2   ( x  x ) 2
s
  x  t  ( n  1) 2
S  s2
n 1 n
T-test for difference of Means
Whether the population means are equal?

H 0 : 1   2
H 1 : 1   2
x1  x2
t ~ t n1  n2  2
1 1
S ( 
2
)
n1 n2

S 
2 1
n1  n2  2
 (x 1  x1 ) 2
  2 2
( x  x ) 2

Example:
A group of 5 patients treated with medicine ‘A’ weigh 42,
39, 48, 60 and 41 Kgs. Second group of 7 patients treated
with Medicine ‘B’ weigh 38, 42, 56, 64, 68, 69, 62 Kgs. Do
you agree with the claim that the medicine ‘B’ increases
the weight significantly ?

t0.05 at v=10 is 2.23


t0.10 at v=10 is 1.81

Note:
Two samples in this test are independent
Difference of Means (Independent Samples)
Product rated on 7- point interval scale
S.No Delhi Bombay
1 2 3
2 3 4
3 3 5
4 4 6
5 5 5
6 4 5
7 4 5
8 5 4
9 3 3
10 4 3
11 5 5
12 4 6
13 3 6
14 3 6 (Separate set
15 4 5 of consumers)
H0 : Mean ratings are same i.e. consumer rate the product in
two cities in same way.

H 0 : 1   2
H 1 : 1   2
  5%
| t | 2.75
t at 28 d . f .  2.05
| t |  t H 0 rejected
Significant Values Of t-Distribution
(Two-Tail Areas) P(|t| > tα) = α

Rejection Rejection
region (α/2) Acceptance region (α/2)
region (1-α)

-tθ(α) t=0 tθ(α)


d.f. Probability (α)
y 0.50 0.10 0.05 0.02 0.01 0.001
1 1.00 6.31 12.71 31.82 63.66 636.62
2 0.82 2.92 4.30 6.97 9.93 31.60
3 0.77 2.35 3.18 4.54 5.84 12.94
4 0.74 2.19 2.78 3.75 4.60 8.61
5 0.73 2.02 2.57 3.37 4.03 6.86
6 0.72 1.94 2.45 3.14 3.71 5.96
7 0.71 1.90 2.37 3.00 3.50 5.41
8 0.71 1.86 2.31 2.90 3.36 5.04
9 0.70 1.83 2.26 2.82 3.25 4.78
10 0.70 1.81 2.23 2.76 3.07 4.59
11 0.70 1.80 2.20 2.72 3.11 4.44
12 0.70 1.78 2.18 2.63 3.05 4.32
13 0.69 1.77 2.16 2.65 3.01 4.22
14 0.69 1.76 2.15 2.62 2.98 4.14
15 0.69 1.75 2.13 2.60 2.95 4.07
16 0.69 1.75 2.12 2.58 2.92 4.02
17 0.69 1.74 2.11 2.57 2.90 3.97
18 0.69 1.73 2.10 2.55 2.88 3.92
19 0.69 1.73 2.09 2.54 2.86 3.88
20 0.69 1.73 2.09 2.53 2.85 3.85
21 0.69 1.72 2.08 2.52 2.83 3.83
22 0.69 1.72 2.07 2.51 2.82 3.79
23 0.69 1.71 2.07 2.50 2.81 3.77
24 0.69 1.71 2.06 2.49 2.80 3.75
25 0.68 1.71 2.06 2.49 2.79 3.73
26 0.68 1.71 2.06 2.48 2.78 3.71
27 0.68 1.70 2.05 2.47 2.77 3.69
28 0.68 1.70 2.05 2.47 2.76 3.67
29 0.68 1.70 2.05 2.46 2.76 3.66
30 0.68 1.70 2.04 2.46 2.75 3.65
0.67 1.65 1.96 2.33 2.58 3.29
Paired t-test for difference of Mean
The two samples are dependent
Ho : x   y
H1 :  x   y
d
t ~ t n 1
S
n d i  xi  yi
1
d   di
n
1
S 
2

n 1
 ( d  d ) 2
Example: An IQ test was administered to 5 persons before and after they
were trained . The results are given below

Candidates: I II III IV V
IQ B.T 110 120 123 132 125
IQ A.T 120 118 125 136 121

Test whether there is any change in IQ after training program


t0.01(4) = 4.6

Example:
Attitude measurement towards a brand before and after the ad campaign.
rating done on 10 point scale .
10: Highly disliked 1: Highly liked
SN Before Test After Test
1 3 5
2 4 6
3 2 6
4 5 7
5 3 8
6 4 4
7 5 6
8 3 7
9 4 5
10 2 4
11 2 6
12 4 7
13 1 4
14 3 6
15 6 8
16 3 4
17 2 5
18 3 6
H o : 1   2
H 1 : 1   2
  5%
t  8.19
t  2.11
t t 
Hence Ho rejected hence Consumers rate the product differently in two
situations.

You might also like