0% found this document useful (0 votes)
76 views

Session - 14-15-Hypothesis Testing

This document discusses hypothesis testing for one sample tests. It covers the concepts of the research hypothesis, statistical hypothesis, null hypothesis and alternative hypothesis. It provides examples of hypothesis testing for the mean when the population standard deviation is known and unknown. The key steps of hypothesis testing are stated as selecting the null and alternative hypotheses, computing the test statistic, determining the critical value based on the significance level and type of test, and making a decision to reject or fail to reject the null hypothesis based on comparing the test statistic to the critical value.

Uploaded by

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

Session - 14-15-Hypothesis Testing

This document discusses hypothesis testing for one sample tests. It covers the concepts of the research hypothesis, statistical hypothesis, null hypothesis and alternative hypothesis. It provides examples of hypothesis testing for the mean when the population standard deviation is known and unknown. The key steps of hypothesis testing are stated as selecting the null and alternative hypotheses, computing the test statistic, determining the critical value based on the significance level and type of test, and making a decision to reject or fail to reject the null hypothesis based on comparing the test statistic to the critical value.

Uploaded by

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

Testing of Statistical Hypothesis

(One Sample Tests)

• Concept of Hypothesis testing


• Hypothesis testing for mean
• Hypothesis testing for proportion
• Hypothesis testing for variance
The Hypothesis

• Research Hypothesis
▪ a statement of what the researcher believes will be
the outcome of an experiment or a study

• Statistical Hypothesis
▪ a formal structure used to statistically (based on a
sample) test the research hypothesis
• Examples of Research Hypotheses

▪ Older workers are more loyal to a company.

▪ Companies with more than $1 billion of assets spend


a higher percentage of their annual budget on
advertising than do companies with less than $1
billion of assets.
Statistical Hypotheses
• A claim (assumption) about a population
parameter
• Examples:
▪ The average monthly cell phone bill of the people in
Lucknow is Rs. 1000.00
▪ The proportion of adults in this city with cell phones
is more than 0.80
• Statistical Hypothesis has two parts
▪ Null Hypothesis
▪ Alternative Hypothesis
The Null Hypothesis
• Denoted as H0
• Nothing new is happening
• The null condition exists
• It refers to the status quo (current or existing state of
affairs)
• Similar to the notion of innocent until proven guilty
• Usually a hypothesis of no difference.
• Example: The average number of TV sets in U.S.
Homes is equal to three. H0: μ = 3
• Begin with the assumption that the H0 is true
• It is tested for rejection or acceptance.
The Alternative Hypothesis
• Denoted as H1 or Ha
• Something new is happening
• It is the opposite of the null hypothesis
▪ E.g., The average number of TV sets in U.S. homes is
not equal to 3 ( H1: μ ≠ 3 )
• It challenges the status quo
• It is generally the hypothesis that the researcher is
trying to prove
• The Null and Alternative Hypotheses are mutually
exclusive.
• Only one of them can be true.
• Example:
• Because of the increased marketing efforts,
company officials believe the company’s market
share is now greater than 18%, and the officials
would like to prove it.

H0 :   0.18 or H0 :  = 0.18
H1 :   0.18
The Hypothesis Testing
• Claim: The population mean age is 50 years.
▪ H0: μ = 50, H1: μ ≠ 50
• Sample the population and find sample mean.
Population

Sample
• Suppose the sample mean age is 20 years.

• This is significantly lower than the claimed mean


population age 50 years.

• If the claim (H0) is true, the probability of getting


such a different sample mean would be very small.

• Getting a sample mean of 20 is very unlikely.

• So, when we get sample mean as 20, we do not


believe on the claim (H0).
• If the sample mean is close to the assumed
population mean, H0 is not rejected.

• If the sample mean is far from the assumed


population mean, H0 is rejected.

• How far is “far enough” to reject H0?

• The critical value of the test statistic is used to


decide on this.
Critical (Rejection) and Acceptance Region
• Critical value divides the whole area under
probability curve into two regions:
• Critical (Rejection) region
▪ When the statistical outcome falls into this region,
H0 is rejected.
▪ Size of this region is α.

• Acceptance Region
▪ When the statistical outcome falls into this region,
H0 is not rejected.
▪ Size of this region is (1-α).
Critical Values

Acceptance Region
Distribution of the test statistic (1- a)

Region of Region of
Rejection Rejection
a/2 a/2

Critical Values

Two Tail Test


Example: H0: μ = 50 Vs H1: μ ≠ 50
a
1- a

0
Upper-tail test or Right Tail Test
Example:
H0: μ ≤ 50 Vs H1: μ > 50

a 1- a

0
Lower-tail test or Left Tail Test
Example:
H0: μ ≥ 50 Vs H1: μ < 50
Example:
• A survey, done 10 years ago, of CPAs in the U.S.
found that their average salary was $74,914.
• A sample of 112 CPAs produced a mean salary of
$78,695.
• Assume that  = $14,530.
• An accounting researcher would like to test
whether over the years
▪ this average has increased?
▪ this average has decreased?
▪ this average has changed?
Hypothesis Testing for μ
(σ known)
Example:
• A survey, done 10 years ago, of CPA’s (Certified Public Accountant)
in the U.S. found that their average salary was $74,914.
• An accounting researcher would like to test whether over the
years
▪ this average has increased?
• Right or Upper Tail Test (H0: μ ≤ 74914, H1: μ > 74914)
▪ this average has decreased?
• Left or Lower Tail Test (H0: μ ≥ 74914, H1: μ < 74914)
▪ this average has changed?
• Two Tail Test (H0: μ = 74914, H1: μ ≠ 74914)
• A sample of 112 CPAs produced a mean salary of $78,695.
• Assume that  = $14,530.
• Has the average salary of CPAs in the U.S. increased?
• Right or Upper Tailed Test
• (H0: μ ≤ 74914, H1: μ > 74914)
• Test Statistic x -  78695- 74914
Zc = = = 2.7539
 n 14530 112

• At 5% level of significance, critical value for a right


tailed test, z(0.05) =1.645
• Since, computed value > critical value at 5% level of
significance
• we reject H0 at 5% level of significance in favor of H1
• and conclude that average salary of CPAs in the U.S.
has increased.
• Has the average salary of CPAs in the U.S. decreased?
• Left or Lower Tailed Test
• (H0: μ ≥ 74914, H1: μ < 74914)
• Test Statistic x -  78695- 74914
Zc = = = 2.7539
 n 14530 112

• At 5% level of significance, critical value for a left tailed


test, z(0.05) = -1.645
• Since, computed value > critical value at 5% level of
significance
• we do not reject H0 at 5% level of significance against H1
• and conclude that average salary of CPAs in the U.S. has
not decreased.
• Has the average salary of CPAs in the U.S. is changed?
• Two Tailed Test
• (H0: μ = 74914, H1: μ ≠ 74914)
• Test Statistic x -  78695- 74914
Zc = = = 2.7539
 n 14530 112

• At 5% level of significance, critical value for a two


tailed test, z(0.025) =1.96
• Since, |computed value| > critical value at 5% level of
significance
• we reject H0 at 5% level of significance in favor of H1
• and conclude that average salary of CPAs in the U.S. is
changed.
• Assumptions:
▪ σ is known.
▪ Population is normal or
▪ sample size is large (n ≥ 30).
• Test Statistic:
▪ Compute the value of test statistic using following
formula: x -
Zc =
 n
• Level of Significance:
▪ Fix the value of a, say 0.05 or 0.10
• Critical Values:
▪ Distribution of test statistic is N(0,1)
▪ Critical values are obtained using N(0,1)
• For two tail test (H0: μ = μ0, H1: μ ≠ μ0): zα/2
N(0,1)

(0.025)
(0.025) (0.95)

-1.96 1.96

• P(- zα/2 < Z< zα/2 ) = 1- α


• P(- 1.96 < Z < 1.96 ) = 0.95
• P(Z > zα/2 ) = α/2
• P(Z >1.96) = 0.025
• P( Z < -zα/2 ) = α/2
• P(Z < -1.96) = 0.025
• For right tail test (H0: μ ≤ μ0, H1: μ > μ0): zα
• P( Z < zα) = 1- α N(0,1)
(0.05)
• P(Z < 1.645 ) = 0.95
(0.95)
• P(Z > zα ) = α
• P(Z >1.645) = 0.05 1.645
• For left tail test (H0: μ ≥ μ0, H1: μ < μ0): -zα
• P( Z > -zα) = 1- α N(0,1)
• P(Z > -1.645 ) = 0.95 (0.05)

• P(Z < -zα ) = α (0.95)

• P(Z < -1.645) = 0.05


-1.645
• Decision Making
• We reject H0 in the favor of H1 at α x100% level
• If |Zc| > zα/2 (for two tailed test)
• If Zc > zα (for right tailed test)
• If Zc < -zα (for left tailed test)

• Accepting H0 means that


▪ The difference between sample mean and
hypothetical population mean is not significant.
▪ This difference is because of sampling fluctuation
only.
• Steps:
• State H0 and H1
• Compute the value of test statistic Zc
• Obtain critical value for fixed α and according to H1
(Right/ Left/ Two tailed test)
• Compare computed value of Zc with critical value
• Make the decision accordingly.
• Some useful critical values of N(0,1) distribution
Level of Significance
Test 1% 5% 10%
Two Tailed 2.58 1.96 1.645
Right Tailed 2.33 1.645 1.28
Left Tailed -2.33 -1.645 -1.28
Hypothesis Testing for μ
(σ unknown)
• Assumptions:
▪ σ is unknown.
▪ Population is normal or
▪ sample size is small (n < 30).
• Test Statistic: x-μ
Tc =
s1 n

• Test statistic Tc has t(n-1) distribution.


• Critical values of t(n-1) distribution can be obtained
from the t table for given d.f. and significance level.
• For right tail test (H0: μ ≤ μ0, H1: μ > μ0): tα
• P( T < tα) = 1- α T~t(n-1)
Rejection
Region (α)
• P(T > tα ) = α
Acceptance
Region (1- α)

• For left tail test (H0: μ ≥ μ0, H1: μ < μ0): -tα
• P( T > -tα) = 1- α Rejection T~t(n-1)
Region (α)
• P(T < -tα ) = α
Acceptance
Region (1- α)

-tα
• For two tail test (H0: μ = μ0, H1: μ ≠ μ0): tα/2
T~t(n-1)

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

- tα/2 tα/2
• P(- tα/2 < T< tα/2 ) = 1- α
• P(T > tα/2 ) = α/2 P( T < -tα/2 ) = α/2
• We reject H0 in the favor of H1 at α x100% level
• If |Tc| > tα/2 (for two tailed test)
• If Tc > tα (for right tailed test)
• If Tc < -tα (for left tailed test)
• Example:
• The mean tariff of a hotel room in New York is said to be
$168 per night.
• A random sample of 25 hotels resulted in mean tariff
$172.50 with standard deviation $15.40.
• Test at the a = 0.05 level:
• if the mean tariff of a hotel room in New York is more
than $168 per night;
• if the mean tariff of a hotel room in New York is not
$168 per night.
• A stem-and-leaf display and a normal probability plot
indicate the data are approximately normally distributed.
• Computed Value of Test Statistic = 1.461039
• Example:
• An engineer has developed a new, energy-efficient lawn
mower engine.
• He claims that the engine will run continuously for an
average of 300 minutes on a single gallon of regular
gasoline.
• Suppose a simple random sample of 50 engines is tested.
• The engines run for an average of 295 minutes, with a
standard deviation of 20 minutes.
• Test the null hypothesis that the mean run time is 300
minutes against the alternative hypothesis that the mean
run time is not 300 minutes.
• Use a 0.05 level of significance.
• Computed Value of Test Statistic = -1.76777
p – value Approach
• Let Zc be the computed value of test statistic
• Let Z ~ N(o,1)
• Then p – value is given by the following probability
▪ For two tailed tests:
• 2P(Z> |Zc|)
▪ For right tailed tests:
• P(Z> Zc)
▪ For left tailed tests:
• P(Z< Zc)
• Decision: H0 is rejected in the favor of H1 at α x100% level of
significance, if
• p – value < α
• The p – value is the smallest level of significance at which H0
would be rejected.
• Example:
• A phone industry manager thinks that customer monthly cell
phone bills have increased, and now average more than $52 per
month.
• The company wishes to test this claim.
• Suppose a sample is taken with the following results
• Sample size = 64, sample mean = $53.1 per month
• Past company records indicate that the standard deviation is
about $10.
• To Test
• H0: μ ≤ 52 Against H1: μ > 52
• Test Statistic: Zc =
x- μ
=
53.1 - 52
= 0.88
σ 10
n 64
P(Z  Zc ) = P(Z  0.88) = 1 - 0.8106 = 0.1894
p-value = 0.1894
Zc = 0.88
Reject H0
a = 0.10

0
Do not reject H0 1.28 Reject H0

Do not reject H0 since p-value = 0.1894 > a = 0.10


P(Z  Zc ) = P(Z  0.88) = 1 - 0.8106 = 0.1894
p-value = 0.1894
Zc = 0.88
Reject H0
a = 0.10

0
Do not reject H0 1.28 Reject H0

Do not reject H0 since p-value = 0.1894 > a = 0.10


• Consider the example of average salary of CPAs in the U.S.
• computed value of test statistic, Zc = 2.7539
▪ For two tailed tests (H0: μ = 74914, H1: μ ≠ 74914):
• p = 2P(Z > 2.7539) = 0.005888 (using N(0,1))
• H0 is rejected for all α ≥ 0.005888
▪ For right tailed tests (H0: μ ≤ 74914, H1: μ > 74914):
• p = P(Z > 2.7539) = 0.002944
• H0 is rejected for all α ≥ 0.002944
▪ For left tailed tests (H0: μ ≥ 74914, H1: μ < 74914):
• p = P(Z < 2.7539) = 0.997056
• H0 is rejected for all α ≥ 0.997056
• We can not have this much high value of α
• So, we accept H0
• p – value Approach in t Distribution:
• Let tc be the computed value of test statistic
• Let T ~ t(n-1)
• Then p – value is given by the following probability
▪ For two tailed tests:
• 2P(T > |tc|)
▪ For right tailed tests:
• P(T > tc)
▪ For left tailed tests:
• P(T < tc)
• Decision: H0 is rejected in the favor of H1 at α x100% level of
significance, if
• p – value < α
• In case of t distribution, p – value may not always be
obtained from the table. (Use Excel)
Hypothesis Testing of
Population Proportion π
• Example:
• A manufacturer believes that exactly 8% of its products
contain at least one minor flaw.
• The company wants to test this belief.
• A sample of 200 products resulted in 33 items have at
least one minor flaw.
• Population is divided into 2 mutually exclusive and
exhaustive classes “A” and “Ac”
• π = Actual proportion of individuals in class “A”
• A sample is selected from this population
• p= sample proportion of individuals in class “A”
• We want to test:
▪ H0: P ≤ P0, H1: P > P0 (Right or Upper Tail Test)
▪ H0: P ≥ P0, H1: P < P0 (Left or Lower Tail Test)
▪ H0: P = P0, H1: P ≠ P0 (Two Upper Tail Test)
• Test Statistic p-P
Zc =
PQ n
• Assumption: Sample is large.
• n ≥ 30 or nP ≥ 5 as well as nPQ ≥ 5
• Zc ~ N(0,1)
• So, N(0,1) distribution is used to obtain critical value.
• Decision rules are the same as discussed earlier.
• p – value approach can also be used.
• Example:
• A marketing company claims that it receives 8%
responses from its mailing.
• To test this claim, a random sample of 500 were
surveyed with 30 responses.
• Test at the a = 0.05 significance level.
• H0: π = 0.08 H1: π ≠ 0.08 Reject H0 Reject H0
• π = 0.08, 1- π = 0.92
• n = 500, p = 0.06 0.025 Accept H0 0.025

• α = 0.05, z
0
• Critical Value = ± 1.96 -1.96 1.96

• Computed Test Statistic = -1.6485


• Accept H0 at α = 0.05
• Example:
• A marketing company claims that it receives 8%
responses from its mailing.
• To test this claim, a random sample of 500 were
surveyed with 30 responses.
• Test at the a = 0.05 significance level.
• H0: π = 0.08 H1: π ≠ 0.08 Reject H0 Reject H0
• π = 0.08, 1- π = 0.92
• n = 500, p = 0.06 0.025 Accept H0 0.025

• α = 0.05, z
0
• Critical Value = ± 1.96 -1.96 1.96

• Computed Test Statistic = -1.6485


• Accept H0 at α = 0.05
• Example:
• A political group ABC Party claims that the
proportion of voters who support it is more than
0.4.
• A news channel conduct a survey to test this claim.
• A sample of 200 people is selected.
• Out of them only 65 are the supporters of ABC Party.
• Can you help the news channel in the analysis.
• Computed value of Test Statistic = -2.1651
• p – value = ?
• Example:
• A political group ABC Party claims that the
proportion of voters who support it is more than
0.4.
• A news channel conduct a survey to test this claim.
• A sample of 200 people is selected.
• Out of them only 65 are the supporters of ABC Party.
• Can you help the news channel in the analysis.
• Computed value of Test Statistic = -2.1651
• p – value = ?
• Example:
• A manufacturer believes exactly 8% of its
products contain at least one minor flaw.
• The company wants to test this belief.
• A sample of 200 products resulted in 33 items
have at least one minor flaw.
• Use a probability of a Type I error of 0.10.
• Help the company officials.
• Computed value of Test Statistic = 4.4309
• p – value = ?
Hypothesis Testing of Population Variance σ2
Example:
• A pharmaceutical company is considering the
purchase of new bottling machines to increase
efficiency.
• The factory currently makes use of machines that fill
cough syrup bottles whose volume of medicine has
a variance of 1.6 mL.
• The new machine they are considering was tested
on 30 bottles, producing a batch with a variance of
1.2 mL.
• Does this machine produce a variance less than 1.6
mL at the 0.05 significance level?
Chi Square Distribution
• Let us take a sample x1, x2 ,..., xn from N(μ,σ).

 xi - x 
n 2

• If we define the statistic as  =   


2

i =1  

• The distribution of this statistic is  2


( n-1)
• The symbol  is read as Chi-Square and has a
2

Chi-Square Distribution with (n-1) degree of


freedom and range (0,∞).
Distribution of Sample Variance
• Let us take a sample x1, x2 ,..., xn from N(μ,σ).
• Sample variance
1 n 1 n
s = ( xi - x) or s1 =
n -1 
2 2 2
( xi - x ) 2
n i=1 i =1

• Using Chi square distribution,

(n -1)s ( xi - x)  xi - x 
2 2 n 2 n 2
= = 
ns
= 1
 ~  2
( n-1)
 2
 2
i =1 2 i =1   
df = 7
α = 0.10

α/2 = 0.05
1- α =0.90 α /2 = 0.05

2.167 14.067
• Assumptions:
▪ Population is normal.
• Test Statistic: n
 i
( x - x ) 2
(n - 1)s12 ns2
c2 = i =1
= =
 2
 2
2

• Distribution of above test statistic is Chi Square


with (n-1) degree of freedom.

• Critical values are obtained from the Chi Square


table for given level of significance and d.f.
• For right tail test (H0: σ ≤ σ0, H1: σ > σ0):

Critical Region
(α)

Acceptance Region
(1-α)

0
(2a )

• We reject H0 in the favor of H1 at α x100% level, if


 
2
c
2
(a )
• For left tail test (H0: σ ≥ σ0, H1: σ < σ0):
Critical Region
(α)

Acceptance Region
(1-α)

0
(21-a )

• We reject H0 in the favor of H1 at α x100% level, if

  2
c
2
(1-a )
• For two tail test (H0: σ = σ0, H1: σ ≠ σ0):
Critical Region
(α/2) Critical Region
(α/2)
Acceptance Region
(1-α)

0
(21-a / 2) (2a / 2)
• This distribution is not symmetric.
• So, we have different notations for critical values.
• Area after the point is mentioned in subscript.
• We reject H0 in the favor of H1 at α x100% level, if

 
2
c
2
(a / 2) or  
2
c
2
(1-a / 2)
• Example:
• Consider the “bottling machines” example.
• Sample size = 30, sample variance = 1.2
• We want to test:
• H0: σ2 ≥ 1.6, H1: σ2 < 1.6

n
Test Statistic: (xi - x)2 2
(n - 1)s1 291.2 1.2
c2 = i =1
= = = 16.3125
2 2 1.6 1.6
• For
▪ left tail test, 5% level of significance, d.f = 29,
• Critical Value is  (0.95) = 17.708
2

• Do not reject H0 at 5% level


Errors in Decision Making
Possible Hypothesis Test Outcomes
Actual Situation

Decision H0 True H0 False

Accept H0 No Error Type II Error


Probability 1 - α Probability β
Reject H0 Type I Error No Error
Probability α Probability 1 - β

You might also like