0% found this document useful (0 votes)
30 views69 pages

ES12010 Lecture 8 2023-24

Uploaded by

Soham Aher
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)
30 views69 pages

ES12010 Lecture 8 2023-24

Uploaded by

Soham Aher
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/ 69

ES12010: Statistics for Economics

Lecture 8
Testing of Hypothesis

• Dr Imran Shah
• Lecturer in Economics
• Email: i.h.shah@bath.ac.uk
• Office: 3 East 4.27
Outline and ILOs (1-2)
Reference: Newbold Chapter 9

After this lecture you will be able to:


• Understand the difference between null and alternative hypotheses.

• The distinction between null and alternative hypotheses.

• Define Type I and Type II errors and evaluate a test's power.

• Under the principles of significance level and rejection region

• Define Type I and Type II errors and assess the power of a test.
• Formulate null and alternative hypotheses for applications involving

– a single population mean from a normal distribution

– a single population proportion (large samples)


Outline and ILOs (2-2)
Reference: Newbold Chapter 10

After completing this chapter, you should be able to:

• Test hypotheses for the difference between two population means

– Two means, matched pairs.

– Independent populations, population variances known.

– Independent populations, population variances unknown but equal.

• Complete a hypothesis test for the difference between two proportions (large
samples).
Rules Learned Thus Far

• So far, we learned rules about:


– making best guesses about the value of a parameter and
– making probability statements about how far our best guess is from an unknown
parameter we want to estimate.
• There are situations however when a decision needs to be made on the basis of a
best guess, and we can use statistical rules for this.
• We develop these rules in the context of an example.
Motivation
In this lecture, we explore hypothesis-testing procedures for testing claims using
sample data. The process involves forming a hypothesis about a population, stating it as
two options, and selecting one based on computed statistics from a random sample.
Here are examples:
• Malt-O-Meal, Inc.: Claims its cereal packages weigh at least 16 ounces. The claim
can be tested by collecting a random sample of packages and computing the sample
mean weight.
• Automobile-parts Factory: Aims to monitor manufacturing processes for piston
diameters. Random samples are taken every 2 hours from the production line to
ensure adherence to engineering specifications.
What are Hypothesis Tests?

• Very often we wish to make statements about some population parameter:


– “The Data suggest that Drug X has no impact on patients’ chance of survival”.
• We wish to be able to formalise the method through which we can make such
claims.
• Essentially, we want to be able formulate a statement that is either true or untrue,
and then use statistics to suggest how likely it is to be true or not.
• We call such a statement a ’Hypothesis’.
• We ask whether the data support a ‘particular hypothesis’.
• Example: The mean monthly cell phone bill of this city is
Different Types of Hypotheses

• We refer to the hypothesis that we want to test as the Null Hypothesis.


• It is denoted
• This hypothesis is tested against an alternative or maintained hypothesis is
denoted .
• Hypothesis are referred to as being simple hypotheses if they concern a specific
value .
• Alternative hypothesis refer to ranges of values. E.G. or .
• Often the null hypothesis is defined to be a lack of evidence for something.
The Null Hypothesis (H0)
States the assumption (numerical) to be tested
• For example: The average number of TV sets in French homes is equal to three

(H0 : μ =3).

• It is always about a population parameter, and we use information from a sample to


test H0.

• The null hypothesis always contains an = sign, e.g.


– the average weight is at most 160 kgms (H0 : μ ≤ 160kgms).
– The average jump in share prices in January is at least 2% (H0 : μ ≥2).
The Alternative Hypothesis (H1 or Ha)
• Is the opposite of the null hypothesis
– e.g., The average number of TV sets in U.S. homes is not equal to 3

– ( H 1: μ ≠ 3 )

• Challenges the status quo


• Never contains the “=” , “≤” or “” sign
• May or may not be supported
• Is generally the hypothesis that the researcher is trying to support
Hypothesis Testing Process (1-2)
• Begin with the assumption that the null hypothesis is true.
– Similar to the notion of innocent until proven guilty.
– Refers to the status quo.
– Always contains.
– May or may not be rejected. “ ”, “” or “” sign

• Is the opposite of the null hypothesis (alternative hypothesis).


• Is the opposite of the null hypothesis is not equal to 3
“ ”, “” or “” sign
• May or may not be supported.
• Is generally the hypothesis that the researcher is trying to support?
Hypothesis Testing Process (2-2)
Reason for Rejecting Null Hypothesis
Level of Significance, Alpha

Level of Significance :
• Defines the unlikely values of the sample statistic if the null hypothesis is true.

• Defines rejection region of the sampling distribution.

• Is designated by α, (level of significance).

• Typical values are 0.01, 0.05, or 0.10.

• Is selected by the researcher at the beginning.

• Provides the critical value(s) of the test.


One and Two Tailed Tests (1-2)

• Tests are either One Tailed or Two Tailed.

• The term tail refers to the tails of a distribution.

• Sometimes we know that if the null-hypothesis is ‘rejected’ that the alternative


hypothesis is almost definitely on one side of the value involved in the null-
hypothesis.
• This might be because of some physical limit, evidence from previous research, etc.
Level of Significance and the Rejection Region
Errors in Making Decisions (1-3)

Type 1 and Type 2 errors are commonly associated with hypothesis testing in statistics.
• Type I Error
• Reject a true null hypothesis.
• Considered a serious type of error.
• The probability of Type I Error is α
• Called level of significance of the test.
• Set by researcher in advance.
• Type II Error
• Fail to reject a false null hypothesis.
• The probability of Type II Error is β.
Errors in Making Decisions (2-3)
1. Type I Error (False Positive):
• Example: In a medical test for a disease, a Type 1 error would occur if the test
incorrectly shows that a person has the disease when they actually do not.
• Result: The individual may undergo unnecessary treatment due to the false
diagnosis.

2. Type II Error (False Negative):


• Example: In a medical test for a disease, a Type 2 error would occur if the test
incorrectly indicates that a person does not have the disease when they actually do.
• Result: The disease may go undetected, leading to delayed treatment and
hypothetically worsening health conditions.
Errors in Making Decisions (3-3)
Consequences of Fixing the Significance Level of a Test
• Once the significance level α is chosen (generally less than 0.10), the probability of
Type II error, β, can be found.
Type I & II Error Relationship
• Type I and Type II errors can not happen at the same time.
• Type I error can only occur if is true.
• Type II error can only occur if is false.
• If Type I error probability then.
• Type II error probability .

Factors Affecting Type II Error


• All else equal,
• when the difference between hypothesized parameter and its true value .
• when .
• when .
• when .
The Power of a Test

• The power of a test is the probability of rejecting a null hypothesis that is false, i.e.
it equals 1- β.

Power  P (Reject H 0 | H1 is true)

• The power of the test increases as the sample size increases [ the more observations
you have the easier it is to make a correct decision].
• For example, if the probability of finding a guilty person innocent is 0.15, the power
of the test is 0.85, we find them guilty 85% of the time.
Decision Rules
• H0 : μ ≤ μ0 ; H1: μ > μ0. ASSUME we know the population variance ().

Reject H0 if z= > (1)

• That is you reject the null if the sample mean is more standard deviations
away from the proposed population mean than is viewed as reasonable.

The P Value
• A critical concept in this is the p value.
• p-value: probability of obtaining a test statistic more extreme ( ≤ or  ) than the
observed sample value, given H0 is true.
Tests of the Mean of a Normal Distribution Sigma Known
• Convert sample result ( x ) to a z value
Decision Rule

x  0
Reject H 0 if z  
 z

n
Alternate rule:

Reject H 0 if x  0  z
n
P-Value Approach to Testing
• p-value: Probability of obtaining a test statistic more extreme than the observed
sample value given is true.
• Also called observed level of significance.
• Smallest value of α for which can be rejected.
p-Value Approach to Testing
• Convert sample result (e.g. ) to test statistic (e.g., z statistic).
• Obtain the p-value.
• For an upper tail test:
• Decision rule: compare the p-value to α.
• If p-value  α, reject H 0 x  0
p - value  P( z  , given thet H 0 is true)
• If p-value  α, do not reject . 
n
x  0
 P( z    0 )

n
Example 1: Upper-Tail Z Test for Mean Sigma Known (1-3)

• A phone industry manager thinks that customer monthly cell phone bill have
increased, and now average over $52 per month. The company wishes to test this
claim. (Assume   10 is known)

Form hypothesis test:


H 0 :   52 the average is not over $52 per month
H1 :   52 the average is greater than $52 per month

(i.e., sufficient evidence exists to support the manager’s claim)

• Suppose that   .10 is chosen for this test

• Find the rejection region:


Example 1: Upper-Tail Z Test for Mean Sigma Known (2-3)

• Suppose a sample is taken with the following


• Results: n  64, x  53.1 (  10 was assumed known )

– Using the sample results,


x  0 53.1  52
z   0.88
 10
n 64

Reach a decision and interpret the result:


• Do not reject H 0 since z = 0.88 < 1.28

• i.e.: there is not sufficient evidence that the mean bill is over $52
Example 1: Upper-Tail Z Test for Mean Sigma Known: P-value Solution (3-3)

• Calculate the p-value and compare to α.


(assuming that   52.0)

P ( x  53.1   52.0)
 
 53.1  52.0 
 P z  
 10 
 
 64 
 P( z  0.88)  1  .8106
 .1894

• Do not reject H 0 since p-value = .1894 > α = .10


A Two Tailed Test – Example (1-2)
• Let us move to an example which involves a two tailed test:

H0: μ = 3 , H 1: μ ≠ 3

• Now we will reject if the sample mean is either too high or too low, i.e. we are
interested in both sides of the distribution.
• Choose =0.05. Assume population variance is known (σ = 0.8) and hence use the
Z test.
• Suppose the sample results are n = 100, = 2.84.
z= = = = -2.0
A Two Tailed Test – Example (2-2)
• Here, z = -2.0 < -1.96, so the test statistic is in the rejection region.
• We reject the null hypothesis and conclude that there is sufficient evidence that
the population mean is not equal to 3.
• Visually -2.0 lies in this part of the rejection region:

• Since hypothesis and conclude that there is sufficient evidence that the mean
number of T Vs in U S homes is not equal to 3
A Two Tailed Test - Example
The p-Value approach for z= = = -2.0

• How likely is it to see a sample mean of 2.84 (or something further from the mean,
in either direction) if the true mean is  = 3.0?

• P-value= 0.0454.

• Since .0456 < .05, we reject the null


hypothesis.
Tests of the Mean of a Normal Population (σ Unknown)
• Here we use the sample standard deviation and because of this the t distribution.
• So with a one tailed test:

• The decision rule becomes:

Reject H0 if t= > (2)

Compare this to (1). AS ALWAYS very similar just switch s for σ and for .

And for a two tailed test. H0: μ = μ0 H1: μ ≠ μ0

Reject H0 if t= < - or if t= > (3)


Tests of the Mean of a Normal Population (σ Unknown) – Example (1-2)

• The average cost of a hotel room in Paris is said to be Euros 168 per night. A

random sample of 25 hotels resulted in x = €172.50 and s = €15.40.

• Test at the  = 0.05 level: H0: μ = 168 H1: μ ≠ 168

• Because we do not know the population standard deviation we use s and the t

statistic.

• From (3) let us calculate:

= = 1.46

• Now (also from (3)) we need to compare this with

where n-1=24;

• The t value we are looking for is 2.064.


Tests of the Mean of a Normal Population (σ Unknown) – Example (2-2)

• Hence Do not reject H0: not sufficient evidence that true mean cost is different than
€168.
• Note just because the sample mean is different from the proposed population mean,
is not in itself proof that the proposed population mean is wrong.
• The sample is the sample and we would not expect the sample mean to be the same
as the population mean.
Tests of the Population Proportion
• Firstly remember in lecture 4 we had the following: has a binomial distribution, but

can be approximated by a normal distribution when nP(1 – P) > 5. Thus n needs to

be at least: n=5/(P(1-P).

• Now we start with a one tailed test:

• OK we start by assuming that nP(1 – P) > 5 and hence the sampling distribution of

is approximately normal, so the test statistic is a z value:

z= (4)
Tests of the Population Proportion – Example (1-2)
• A marketing company claims that it receives 8% responses from its mailing. To test
this claim, a random sample of 500 were surveyed with 25 responses. Test at the 
= .05 significance level.
• Check: Our approximation for is

= 25/500 = .05

z= = = -2.47

• It’s a two tailed test so need to compare with ± = ± Z0.025 = ±1.96: (-2.47<-1.96).
Tests of the Population Proportion – Example (2-2)
Decision: As calculated value of Z falls in the rejection region. Hence, we reject null
hypothesis and conclude that There is sufficient evidence to reject the company’s claim
of 8% response rate.

Critical Values: ±1.96


Tests of the Population Proportion – p-Value Solution Example

• Calculate the p-value and compare to α. (For a two sided test the p-value is always
two sided).

p-value = .0136:
P( Z  2.47)  P( Z  2.47)
 2(.0068)  0.0136

Reject H 0 since p-value = .0136 < α = .05


Outline and ILOs
Reference: Newbold Chapter 10

Week 29

• Test hypotheses for the difference between two population means,


proportions and variances.
Introduction
• The process of comparing two populations begins with an investigator forming a
hypothesis about their means or proportions, leading to two possible outcomes.

• A decision is made based on statistics computed from random samples.

• Hypothesis tests involving variances are increasingly important in business for


reducing process variability and ensuring high-quality production.
Introduction Examples (1-2)
• An instructor wants to see if assigning case studies increases students' test scores.
• She could assign cases to one section and not to the other, then compare the exam
scores to determine if case studies have a significant impact.
• To prove that case studies enhance learning, she would initially assume that
completing assigned cases doesn't improve overall exam scores.
• Let represent the mean final exam score in the class using case studies, and
represent the mean final exam score in the class without case studies.
• The null hypothesis for this study is formulated as the composite hypothesis.

• The alternative hypothesis.


Introduction Examples (2-2)
• A news reporter wants to determine if a tax reform appeals equally to men and
women.
• To test this, they gather opinions from randomly selected individuals of both
genders.
• They might assume, as a working null hypothesis, that a new tax proposal is equally
appealing to men and women.
• The null hypothesis.

• The alternative hypothesis.


Two Sample Tests
Tests of the Difference B/W Two Normal Population Means:
Dependent Samples (1-3)

For instance, differences between twins' measures of human behaviour tend to be

smaller than differences between randomly selected individuals.

In general, dimensions for parts produced on the same machine are typically closer

than those produced on different machines.

Thus, matched pairs of observations are preferred when comparing measurements from

two populations, as they result in smaller variance. This smaller variance increases the

probability of rejecting when the null hypothesis is false.


Tests of the Difference B/W Two Normal Population Means:
Dependent Samples (2-3)

• Suppose we have a random sample of matched pairs of observations from

distributions with means and .

• Let and represent the observed sample mean and standard deviation for the

differences .

• If the population distribution of the differences is normal, the following tests are

conducted at significance level . To test the null:

• Decision rule is as follows


Tests of the Difference B/W Two Normal Population Means:
Dependent Samples (3-3)

• To test either null hypothesis :

• Decision rule is as follows

• To test either null hypothesis:

• Decision rule is as follows


Decision Rules

Matched or Paired Samples

Lower-tail test: Upper-tail test: Two-tail test:


H0 : x   y  0 H0 : x   y  0 H 0 : x   y  0
H1 :  x   y  0 H1 :  x   y  0 H1 :  x   y  0

d
Where t  has n  1 d.f .
sd
n
Dependent Samples Example (1-4)
• Assume you send your salespeople to a “customer service” training workshop.

Has the training made a difference in the number of complaints? ( = 0.05). You

collect the following data:

= =-21/5 = -4.2; = = (128.8/4)0.5 = 5.67

Note similarity Lecture 7 equations 2 & 3


Dependent Samples Example (2-4)

• Has the training made a difference in the number of complaints (at the  = 0.05
level)? = -4.2; = 5.67; n=5.

H0: μx – μy = 0

H1: μx – μy  0

= = -1.66

• Decision: t-stat doesn’t fall in the rejection region.

• Conclusion: There is not a significant change in the number of complaints.


Tests of the Difference B/W Two Means: Independent Samples

• Now let us compare independent samples.


• The populations are different, unrelated and independent.
• A sample selected from one population has no effect on the sample selected from
the other population.
• We cannot calculate , because as the populations are independent it makes no sense.
Before they were the same person. Here there is no link.
• Thus, we will test the difference between the two normal population means.
• The goal is to form a confidence interval for the difference between two population
means: .
Difference Between Two Means
Independent Samples: If and are Known (1-3)

• Assumptions:
– Samples are randomly and independently drawn.
– Both population distributions are normal.
– Population variances are known.
• When and [the population variances] are known the variance of - is + and the
corresponding Z variable is defined as:
Z= (2
Independent Samples: If and are Known (2-2)

Z=

Decision Rule
Lower-tail test:

Upper-tail test:
Independent Samples: If and are Known (3-3)
Decision Rule

Two-tail test:
(𝑥− 𝑦)
𝐻 0 : 𝜇 𝑥 – 𝜇 𝑦 + 0 ; 𝐻 1: 𝜇 𝑥 – 𝜇 𝑦 ≠ 0 ,𝑟𝑒𝑗𝑒𝑐𝑡 >Z𝛼


2 2
𝜎𝑥 𝜎 𝑦
2
+
𝑛𝑥 𝑛 𝑦

• For large sample sizes , replacing population variances with sample variances
provides a good approximation at significance level .
• Additionally, the CLT ensures accurate approximations even if populations are not
normally distributed.
Independent Samples: Population Variance is known – Example (1-2)

Shirley Brown, an agricultural economist, is comparing cow manure and turkey dung
as fertilizers for farmers.
She'll determine whether turkey dung, offered at a favourable price by a major turkey
farmer, increases productivity compared to cow manure.
• To begin the study, Shirley specified a hypothesis test with

• versus the alternative that

• where is the population mean productivity using turkey dung and is the population
mean productivity using cow manure.
• indicates that turkey dung results in higher productivity.
Independent Samples: Population Variance is known – Example (2-2)

• Turkey dung was applied to a first random sample

• Cow manure was applied to a second random sample

• This is greater than Z = 1.645; hence reject H0 and accept H1. Confirm that the for
this is 0.0094.
Tests of the Difference Between Two Means: and are Unknown But
Assumed Equal (1-3)

• Assumptions:
– Samples are randomly and independently drawn.
– Populations are normally distributed.
– Population variances are unknown but assumed equal.
• The population variances are assumed equal, so use the two sample standard
deviations and pool them to estimate .
• We use t-value with degrees of freedom.
• The t statistic for this is:

t=
Tests of the Difference Between Two Means: and are Unknown But
Assumed Equal (2-3)
In these tests, we assume an independent random sample of size and observations
drawn from normally distributed populations with means and and a common variance.
The sample variances and are used to compute a pooled variance estimator.

1. Then, using the observed sample means and , the following tests have significance
level :

(x  y)
t
s 2p s 2p

nx ny
Tests of the Difference Between Two Means: and are Unknown But
Assumed Equal (3-3)
• Two Population Means, Independent Samples, Variances Unknown.

Lower-tail test: Upper-tail test: Two-tail test:

H 0 :  x – y  0 H 0 :  x  y  0 H 0 :  x  y  0
H1 :  x –  y  0 H1 :  x  y  0 H1 :  x  y  0
Two Means: Unknown but Equal Variances Example (1-3)

• You are a financial analyst for a brokerage firm. Is there a difference in dividend
yield between stocks listed on the S&P500 & NASDAQ? You collect the following
data on yields:

• Assuming both populations are approximately normal with equal variances, is there
a difference in average yield ( = 0.05)?
Two Means: Unknown but Equal Variances Example (2-3)
H 0 : 1  2  0 i.e. ( 1  2 )
H 1 : 1  2  0 i.e. ( 1  2 )

• The test statistic is:

( X1  X 2 ) (3.27  2.53)
t   2.040
1 1  1 1 
S   
2
1.5021  
p
 n1 n2   21 25 

( n  1) S 2
 ( n  1) S 2
(21  1)1.30 2
 (25  1)1.16 2
S p2  1 1 2 2
  1.5021
(n1  1)  (n2  1) (21  1)  (25  1)
Two Means: Unknown but Equal Variances Example (3-3)

  
df  21  25  2  44
Critical Values: t   2.0154

Test Statistic:

3.27  2.53
t  2.040
 1 1 
1.5021   
 21 25 

• Decision: As t-computed does fall in the rejection region . So, we reject at 5%.
• Conclusion: There is evidence of a difference in means.
Test Hypotheses for two Population Proportions (1-3)

• Develop procedures for comparing two population proportions.


• Standard model: Random sample of observations from a population with
proportion of successes.
• Second independent random sample: observations from a population with
proportion of successes.
• We assume that both sample sizes are large so that .
• The general Z formula is.

Z=
has a standard normal distribution.
Test Hypotheses for two Population Proportions (2-3)

• We want to test the hypothesis that the population proportions and are equal.

Denote their common value by . Then under this hypothesis.


Z=
follows to a close approximation a standard normal distribution.
• Finally, the unknown proportion can be estimated by a pooled estimator defined

as follows:

• Where
Test Hypotheses for two Population Proportions (3-3)

H 0 : Px  Py  0 H 0 : Px  Py  0 H 0 : Px  Py  0
H1 : Px  Py  0 H1 : Px  Py  0 H1 : Px  Py  0

Lower-tail test: Upper-tail test: Two-tail test:


Two Population Proportions Example (1-2)

• Is there a significant difference between the proportion of men and the proportion of
women who will vote Yes on Proposition A?

• In a random sample, 36 of 72 men and 31 of 50 women indicated they would vote


Yes. Test at the 0.05 level of significance.

(the two proportions are equal)

(there is a significant difference between proportions)

• The sample proportions are:

Men: ; Women:
Two Population Proportions Example (2-2)
= = =0.549
• The test statistic is (from (8)):

Z= = =-1.31
• The critical Z value corresponding to a 5% rejection region, with 2.5% in each tail
is 1.96. The Z value above is less than that in absolute terms hence can’t reject the
null.
• Conclusion: There is not significant evidence of a difference between men and
women in proportions who will vote yes.
Summary (1-2)

• Addressed hypothesis testing methodology.


• The hypothesis testing process.
• One and two tailed tests.
• Level of significance and region region.
• Errors in Marking Decision.
• The connection between Type I and Type II errors
Summary (2-2)

• Discussed critical value and p-value approaches to hypothesis testing.

• Compared two dependent samples (paired samples).

• Compared two independent samples.

• Performed t test for the mean

• Compared two population proportions.

• Performed z test for the proportion.

• Performed a hypothesis test for the variance .

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy