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

Statistical Hypothesis Testing - One Way & Two Way

The document discusses statistical hypothesis testing for a mean using a one sample z-test. It provides examples of testing whether the average salary of CPAs has increased, decreased, or changed from a survey done 10 years ago. A sample of 112 CPAs had a mean salary of $78,695, higher than the past survey's $74,914 mean. A right-tailed test found this increase to be statistically significant, while a left-tailed test did not find a decrease to be significant, so it can be concluded that the average CPA salary has likely increased over the past 10 years.

Uploaded by

Saurabh Sharma
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)
173 views

Statistical Hypothesis Testing - One Way & Two Way

The document discusses statistical hypothesis testing for a mean using a one sample z-test. It provides examples of testing whether the average salary of CPAs has increased, decreased, or changed from a survey done 10 years ago. A sample of 112 CPAs had a mean salary of $78,695, higher than the past survey's $74,914 mean. A right-tailed test found this increase to be statistically significant, while a left-tailed test did not find a decrease to be significant, so it can be concluded that the average CPA salary has likely increased over the past 10 years.

Uploaded by

Saurabh Sharma
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/ 49

Testing of Statistical Hypothesis

(One Sample Tests)

• Concept of statistical hypothesis


testing
• Statistical Hypothesis testing of a
mean
• Statistical Hypothesis testing of a
proportion
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.

 The price of scrap metal is a good indicator of the


industrial production index six months later.
Statistical Hypotheses
• A claim (assumption) about a population
parameter
• Example: The average monthly cell phone bill of
the people in Lucknow is Rs. 2500.00
• Example: 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.

H 0 : P  0.18 or H 0 : P  0.18
H 1 : P  0.18
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 - β
• Two types of error:
 Type I Error: Reject H0, when it is true
 Type II Error: Accept H0, when it is wrong
 Size of Type I Error = P(Type I Error)
=P(Reject H0, when it is true)
=P(Reject H0| H0)
=α (Also called as Producer’s risk)
 Size of Type II Error = P(Type II Error)
=P(Accept H0, when it is wrong)
=P(Accept H0| H1)
=β (Also called as Consumer’s risk)
• Size of Type I Error (α) is called Level of Significance.
• α is set by the researcher in advance.
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 accepted.

• 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 accepted.
 Size of this region is (1-α).
Critical Values

Acceptance Region
Distribution of the test statistic 

Region of Region of
Rejection Rejection
 

Critical Values

Two Tail Test


Example: H0: μ = 50 Vs H1: μ ≠ 50



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

 

0
Lower-tail test or Left Tail Test
Example:
H0: μ ≥ 50 Vs H1: μ < 50
Hypothesis Testing for μ
(σ known)
Example:
• A survey, done 10 years ago, of CPAs 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.
• 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 , 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)


 

 

• 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α
N(0,1)
• P( Z < zα) = 1- α

• P(Z < 1.645 ) = 0.95

• P(Z > zα ) = α
• P(Z >1.645) = 0.05 

• For left tail test (H0: μ ≥ μ0, H1: μ < μ0): -zα
• P( Z > -zα) = 1- α N(0,1)

• P(Z > -1.645 ) = 0.95

• P(Z < -zα ) = α
• P(Z < -1.645) = 0.05 
• 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
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?
• 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 accept 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 right


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.
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: x μ 53.1  52
Zc    0.88
σ 10
n 64
P Z  Z c   P(Z  0.88 )  1  0.8106  0.1894
p-value = 0.1894
Zc = 0.88
Reject H0
 = 0.10

0
Do not reject H0 1.28 Reject H0

Do not reject H0 since p-value = 0.1894 >  = 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
Hypothesis Testing for μ
(σ unknown)
• Assumptions:
 σ is unknown.
 Population is normal or
 sample size is large (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α
T~t(n-1)
• P( T < tα) = 1- α Rejection
Region (α)
• P(T > tα ) = α
Acceptance
Region (1- α)

• For left tail test (H0: μ ≥ μ0, H1: μ < μ0): -tα
T~t(n-1)
• P( T > -tα) = 1- α Rejection
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:
• A sample of 25 people is taken.
• The length of time to prepare dinner is recorded in
minutes, as given below:
• 44.0 51.9 49.7 40.0 55.5 33.0 43.4 41.3
45.2 40.7 41.1 49.1 30.9 45.2 55.3 52.1
55.1 38.8 43.1 39.2 58.6 49.8 43.2 47.9
46.6
• Is there any evidence that the population mean time
to prepare dinner is greater than 40 minutes?
• Use a level of significance of 0.05.
• Computed value of Test Statistic = 4.04388267
• Example:
• An insurance agent claims that the average age of policy
holders who have insured through him is less than the
average for all agents, which is 30.5 years.
• A random sample of 100 policy holders who had insured
through him gave the following age distribution:
Age no. of people
16-20 12
21-25 22
26-30 20
31-35 30
36-40 16
• Test his claim at 5% level of significance.
• Computed Value of Test Statistic = -2.66251
• Note: For large samples, t distribution can be approximated
by N(0,1).
• 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  = 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 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 P
• 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.
• Let the population is divided into 2 mutually exclusive and
exhaustive classes “A” and “Ac”
• P= 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: Population is large.
• n ≥ 30 or nP ≥ 5 as well as nQ ≥ 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  = 0.05 significance level.
• Computed Value of Test Statistic = -1.6485

H0: P = 0.08 H1: P ≠ 0.08 Reject Reject

α = 0.05 0.025 0.025


n = 500, p = .06
0 z
Critical Value = ± 1.96 -1.96 1.96
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 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
standard deviation of 1.6 mL.
• The new machine they are considering was tested
on 30 bottles, producing a batch with a standard
deviation of 1.2 mL.
• Does this machine produce a variance less than 1.6
mL at the 0.05 significance level?
• Assumptions:
 Population is normal.
• Let x1, x2,…,xn are sample observations
• Test Statistic: n


(x  x)2 i
(n  1) s12 ns 2
 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 two tail test (H0: σ = σ0, H1: σ ≠ σ0):
Critical Region
(α/2) Critical Region
(α/2)
Acceptance Region
(1-α)

0
 (21 / 2 )  (2 / 2 )

• This distribution is not symmetric.


• So, we have different notations for critical values.
• Area 2after the2 point is mentioned in2 subscript.

 c  H (in/ the
We reject
orof H at α cx100%
2 ) favor   level,
2
(1 / 2if)
0 1
• For right tail test (H0: σ ≤ σ0, H1: σ > σ0):

Critical Region
(α)

Acceptance Region
(1-α)

0
 (2 )

 
2
c
2
( )
• We reject H0 in the favor of H1 at α x100% level, if
• For left tail test (H0: σ ≥ σ0, H1: σ < σ0):
Critical Region
(α)

Acceptance Region
(1-α)

0
 (21 )

• We reject H0 in  
2
thec
2
favor(1of
 )H1 at α x100% level, if
• Example:
• Consider the “bottling machines” example.
• Sample size = 30, sample standard deviation= 1.2
• We want to test:
• H0: σ ≥ 1.6, H1: σ < 1.6
n
• Test Statistic:  (x  x)2
i
(n  1) s12 29  1.2  1.2
 
2
c
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

• Reject H0 at 5% level
Summary
Testing of Mean
x x
Zc  ~ N (0,1) Tc  ~ t ( n 1)
 n s1 n
Testing of Proportion
pP
Zc  ~ N (0,1)
PQ n
Testing of Variance
n

 i
( x  x ) 2
(n  1) s12 ns 2
 c2  i 1
  ~  2
( n 1)
2  2
 2

You might also like