0% found this document useful (0 votes)
50 views34 pages

Test of Hypothesis by Zakir Sir

Uploaded by

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

Test of Hypothesis by Zakir Sir

Uploaded by

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

Introduction to Statistical Concepts:

Inferential Techniques
(Estimation and Test of Hypothesis)

Presented by-
Professor Dr. Md. Zakir Hossain
Department of Statistics
Shahjalal University of Science & Technology

1
Fundamental Concepts on Test of
Hypothesis

Statistical Hypothesis:
A statistical hypothesis is an assertion or
conjecture about the distribution of one or more
random variables.

Statistical Test:
Method of verifying a statistical hypothesis is
called statistical test.
2
Null Hypothesis: The null hypothesis is a statement which tells
us that there is no difference exists between the parameter
and the statistic being compared of it. In other way, the
hypothesis which we are going to test for possible rejection
under the assumption that it is true is called the null
hypothesis. It is denoted by H0.
For example, there is no difference in the population between
the rates of prevalence of malnutrition between the male
and female children.
As for example, H0: P1= P2
Alternative Hypothesis: An alternative hypothesis is one such
that we can conclude in its favour if the sample evidence does
not support the null hypothesis. It is
denoted by H1.
As for example H1: P1≠ P2. 3
Type-I Error: Type-I error is the error due to rejection of the null
hypothesis when it is true.
Type-II Error: Type-II error is the error due to the acceptance of
the null hypothesis when it is false.

It is important to remember the following relationship between


Type I error & Type II error for any statistical hypothesis test.
# A type I error is often considered to be more serious, than a
type II error and therefore required to make type I as
minimum as possible.
# For any given set of data, type I and type II errors are
inversely related; the smaller the risk of one, the higher the
risk of the other.

4
Test Statistic:
A test statistic is a quantity calculated from our sample data. Its value
is used to decide whether or not the null hypothesis should be rejected
in our hypothesis test.
The choice of a test statistic will depend on the assumed probability
model and the hypotheses under question.

Critical Value(s):
The critical value(s) for a hypothesis test is a threshold to which the
value of the test statistic in a sample is compared to determine whether
or not the null hypothesis is rejected.

The critical value for any hypothesis test depends on the significance
level at which the test is carried out, and whether the test is one-
sided or two-sided.

5
Critical Region:
The general idea of hypothesis testing is to divide the
whole sample space into two parts: (i) Acceptance region
and (ii) Rejection region.
The acceptance region for the null hypothesis H0 , consists
of the set of values of the test criteria for which H0 will be
accepted.
The critical region (CR), or rejection region (RR), is a set of
values of the test statistic for which the null hypothesis is
rejected in a hypothesis test. So, if the observed value of
the test statistic is a member of the critical region, we
conclude "Reject H0"; if it is not a member of the critical
region then we conclude "Do not reject H0".

6
Level of Significance:
Probability of committing type-I error is known as level of significance
or
size of the test. It is denoted by α which is defined as

α = Pr { type-I error}
= Pr{ x lies in the rejection region w when H0 is
true}.
Power of the test:
Probability of rejecting the null hypothesis (H0) when the alternative
hypothesis (H1) is true is known as the power of the test. It is a correct
decision.
If β be the probability of committing type II error then the power of the
test is expressed by
Power of the test: 1- β = 1- pr{type-II error}
=Pr {x lies in the rejection region w when H1 is
true}

7
Types of Test:
On the basis of alternative hypothesis tests are usually two types: one-sided
(or one tailed) and two-sided tests.
One-sided Test:
If the alternative hypothesis states the direction of difference, then the test is
called one tailed. In a one-sided test, the critical region is the set of
values less than the critical value of the test, or the set of values greater
than the critical value of the test.
Example: Suppose we wanted to test a manufacturers claim that there are,
on average, 50 matches in a box. We could set up the following
hypotheses H0: µ = 50, against H1: µ < 50 or H1: µ > 50. Either of these
two alternative hypotheses would lead to a one-sided test.
Two-Sided Test:
If there is no direction of difference given in the alternative hypothesis, then
the test is termed as two-sided test. The critical region for a two-sided
test is the set of values less than a first critical value of the test and the
set of values greater than a second critical value of the test.
As for example H0: µ = 50 against H1: μ≠ 50 in the above example.
The choice between a one-sided and a two-sided test is determined by the
purpose of the investigation or prior reasons for using a one-sided test.

8
Steps of Hypothesis Testing
1. Set up the hypotheses : Null hypothesis (Ho) &
Alternative hypothesis (H1)
2. Choose level of significance, usually 0.05
3. Choose the appropriate test statistic on the basis of
the assumption about the population distribution and
sample size
4. Write the decision rule (critical region) depends on the
test statistic and level of significance
 2
4. Calculate the value of test statistic (usually z or t or or
F etc)
5. State your conclusion on the basis of decision rule
(either reject the null hypothesis or accept it).
9
1. State the Hypotheses
Ha: The proportion of birth defection in Bangladesh (p1) is
higher than the proportion in the US (p2).
Ha: p1 >p2

H0: There is no difference for birth defection proportion


between the Bangladesh and the U.S. population
H0: p1= p2
Note:
• Always state hypotheses in terms of population parameters!
• Some texts write the null hypothesis as "less than or equal to," but it doesn't
matter in the execution of the test.

10
2. Identify the correct Test Statistic:
To identify the correct statistic we have to
concern about the distribution of the
population from where the samples are
Drawn and also the sampling distribution.
Usually Normal test statistic (Z), t-test
statistic, chi-square test statistic and F test
statistic are used in most of the cases.

11
3. Select a Level of Significance
Making a false claim (a Type I error) is worse than saying you are uncertain. What
is the greatest probability of making a false claim (alpha) that you feel
comfortable with? For social science, the usual standard for alpha is 0.05. In
theory, you should choose alpha before looking at the test result.

Reality
Ho True Ho False
Ha False Ha True

Reject Ho Type I Error Correct Test


Accept Ha
Test Result

Result
Fail to Correct Test Type II Error
Reject Ho Result

12
3. Write the Decision Rule
z = 1.645
Assume the Null is true.
Only 5 percent of the
time will a sample have a
z score greater than
1.645 (the critical value of
z).
5 percent
If the z score for our sample
exceeds the critical value of z, it
is unlikely to have happened just
by chance. If we picked the
correct alpha, we will feel
comfortable rejecting the Null
Reject H0 if z>1.645 and accepting the Alternative
hypothesis.
13
4. Calculate the Test Statistic
 68 
pˆ  p 0 pˆ  p 0    0.0009
 36000  0.001
z    6.321 > 1.645
 pˆ p 0 (1  p 0 ) (0.0009)( 0.9991) 0.000158
36000
n

This is the sampling Sampling Distribution Assuming the Null


distribution of Hypothesis is True

proportion to binomial.
Assumed
Sampling
Relative Frequency

What is the probability Distribution

that we would observe Sample P

this sample P if the Null


Hypothesis were true? 0.00000 0.00050 0.00100 0.00150 0.00200

Proportion of defects

14
5. State the Conclusion

We reject the Null hypothesis which means that


sufficient evidence exists to conclude that the rate
of birth defects is higher in Bangladesh than the
rate of US.

* State the substantive conclusion, not just "reject the null"

* Still a chance we could be wrong, but if we are wrong (the


null is really correct) this will only happen 5 percent of the
time.

15
The Procedures of Testing some important hypotheses
are described below:

Testing the hypothesis of population mean


We want to test the null hypothesis
H0: μ=μ0 against (i) H1: μ>μ0, (ii) H1: μ<μ0 (iii) H1: μ≠μ0

Assumption: Samples are drawn from N(μ,σ2).

Case 1: When σ2 is known


The test statistic is given by
x  0
Z 
/ n
Which follows N(0,1).
16
Case 2: When σ2 is not known but sample is large (n>30)

The test statistic is given by


x  0
Z 
s/ n
where 1 n
s   ( xi  x) 2
2

n i 1

17
Table1: Decision rules and Critical values for case
1 and case 2

H1 K values for different α


α=0.05 α=0.01 α=0.001
μ>μ0 Z>K 1.65 2.33 3.09

μ<μ0 Z<K -1.65 -2.33 -3.09

μ≠μ0 |Z|>K 1.96 2.58 3.29

18
Case 3: When σ2 is not known and small sample (n<30)
The test statistic is given by
x  0
t
s/ ( n  1)
n
1
Where s 2 

n i 1
( x i  x ) 2

which follows students t distribution with (n-1) df.

19
Table 2: Decision rules and Critical values for case 3
H1 K values for different α with n=16
α=0.05 α=0.01
μ>μ0 t>K 1.75 2.58

μ<μ0 t<K -1.75 -2.58

μ≠μ0 |t|>K 2.12 2.92

20
Testing the equality of two population means
We want to test null hypothesis
H0: μ1=μ2 against (i) H1: μ1>μ2 (ii) H1: μ1<μ2 (iii) H1: μ1≠μ2

Assumption: Independent samples are drawn from two


Normal distribution.
Case1: If σ2 is known
Test statistic is given by
x1  x 2
Z 
 12  22

n1 n2

21
Decision rules and Critical values are same as Table 1.
Case 2: If σ2 is unknown and n1 & n2 are large
Test statistics is given by

x1  x 2
Z 
s12 s 22

n1 n2

1 n
where s1   ( xi  x) 2
2

n1 i 1
1 n
s2   ( yi  y) 2
2

n2 i 1
Decision rules and Critical values are same as Table 1.

22
Case 3: If σ2 is unknown and small samples
Test statistic (Assuming population variances are equal) is given by

x1  x 2
t t ( n1 n2  2)
1 1
s 
n1 n2

2 2
Where 2 ( n1  1) s1  ( n 2  1) s 2
s 
n1  n2  2
Decision rules and critical values are same as Table 2.

23
Testing the equality of two population means for
dependent samples known as “Paired t-test”:

It frequently happens that observations are sampled


in pairs. For example, a nutritionist is interested to
know whether weight is significantly increase or
not after giving a certain drug. In order to do this
weights were taken before and after
administration of drug from a group of patients .In
this case the sample data is dependent. Here we
can not apply the independent samples test.

24
The test statistic for paired sample is given by

d
t t ( n  1)
sd / n
where
d i  xi  y i ,
n

d
i1
i
d 
n
n

2
 i
(
i1
d  d ) 2

sd 
n 1
25
Testing hypothesis about Population variance
We want to test the null hypothesis H0: σ2=σ02 against
(i) H1: σ2>σ02 (ii) H1 : σ2<σ02 , (iii) H1 : σ2≠σ02
Assumption: Samples are drawn from N(μ,σ2).
Sample variance is computed as
n
1
s 2   ( xi  x) 2
n i 1
Test statistic is given by

ns 2
 2
   (2n  1),
 02

26
Decision rules and Critical values
H1 Reject H0 iff K-values can be
determined
σ2>σ02
ns 2
2
K
0 pr{ 2  K } 
σ2<σ02
ns 2
K
0 2
pr{ 2  K } 
σ2≠σ02
ns 2
2
K pr{ 2 K 1 }  / 2
0
and
or ns 2
K pr{ 2 K 1 }  / 2
 02

27
Testing hypothesis about equality of Population variance:
We want to test the null hypothesis H0: σ12=σ22 against
(i) H1: σ12≠σ22 (ii) H1: σ12>σ22 (iii) H1: σ12<σ22

For (i), we place the larger variance in the numerator and


obtain the critical value 2
L arg er  s
F
Smaller  s 2
2
For (ii) test statistic is given by s1
F  2
 F( n1  1),( n2  1)
s2
2
For (iii) test statistic is given by s2
F  2 F( n2  1),( n1  1)
s1

28
Testing the significance of a specified value of the proportion
We want to test the null hypothesis H0: p=p0 against
(i) H1: p>p0, (ii) H1: p<p0 (iii) H1: p≠p0
Assumptions:
(i) Samples are taken from a binomial distribution.
(ii) The samples are large enough to apply normal
approximation.
The test statistic is given by
^
p  p0
Z  N (0,1)
p0 (1  p0 ) / n
Decision rules and critical values are same as Table 1.

29
Testing the significance of difference between two proportions
We want to test the null hypothesis H0: p1=p2 against
(i) H1: p1>p2 , (ii) H1: p1<p2 (iii) H1: p1 ≠ p2

Here p1and p2 are the two population proportions of the


attributes under investigation.
Assumptions:
(i) Samples are taken from two independent binomial
distributions.
(ii) The samples are large enough to apply normal approximation.
(iii) Two populations have common proportion.

30
The test statistic is given by

~ 

p  p2
Z 1
 N (0,1)
** **

p (1  p )
where ~
x1 
x2 **
x  x2
p 1
 ,
n1
p 2
 ,
n2
p n  n2
1

And xi denotes the number of successes in two


independent samples
Decision rules and critical values are same as
table 1.
31
Testing significance about correlation coefficient
We want to test H0:ρ=0 against H1:ρ≠0.
Here test statistic is given by
r n/2
t  t ( n  2 )
(1  r 2 )
n n

x y i i  ( xi y i ) / n
where r i 1 i 1

{ xi2  ( xi ) 2 }{ y i  ( y i ) 2
2

i i

If calculated t-value greater than t ( n  2 ), / 2 we


reject the H0.

32
The p-value:
Now-a-days, statistical software provides the value of test
statistic along with its p-value. The p-value or observed
significance level of a test is the smallest value of α for
which H0 can rejected. If the p-value is less than a pre-
assigned significance level α, the H0 is rejected and we can
report that the results are statistically
significant at level α.

It is the actual risk of committing type I error, if H0 is


rejected based on the observed value of the statistic.
The p-value provides not only a means of making a
decision about H0 but also provides some idea about strong
the evidence.

33
Decision rules based on p-value:
1. If p-value is less than 0.01, H0 rejected and the results
are regarded as highly significant.
2. If p-value is between 0.01 and 0.05, reject H0 and the
results are statistically significant.
3. If p-value is between 0.05 and 0.10, then the results
are regarded as only tending toward statistical
significance.
4. If p-value is greater than 0.10, we accept H0 and the
results are regarded as not statistically significant.

34

You might also like