Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

IPS

Introduction to Probability & Statistics

Lecture - 15/16

Prof. Pritam Ranjan


IPS

Motivating examples
• Hoping to improve customer service, a retailer sent a sample of 85
salespeople to a training program that emphasized self-image, respect
for others, and manners. Management decided that if the rate of
complaints fell below 10% per month after the training, it would judge
the program a success.

Test µ < 0.1 vs. µ ≥ 0.1

• According to Fortune, on February 27, 2007, the average stock in all


U.S. exchanges has a drop of 3.3%. If a random sample of 120 stocks
reveals an average drop of 2.8% on that day and a standard deviation of
1.7%, are there grounds to reject the magazine’s claim?

Test µ = 3.3 vs. µ �= 3.3

Pritam Ranjan / OM&QT 1


IPS

Hypothesis testing
• Two important hypotheses:
Ha : Researcher’s claim - hypothesis / Alternative hypothesis
H0 : Null hypothesis

• Examples:
Ha : p < p0 vs. H0 : p ≥ p0 Ha : µ < µ0 vs. H0 : µ ≥ µ0
Ha : p > p0 vs. H0 : p ≤ p0 Ha : µ > µ0 vs. H0 : µ ≤ µ0
Ha : p �= p0 vs. H0 : p = p0 Ha : µ �= µ0 vs. H0 : µ = µ0

• Important rules:
→ ”Equality” sign always stays with H0
→ H0 is ”always” the compliment of Ha

Pritam Ranjan / OM&QT 2


IPS

Motivating examples
• Hoping to improve customer service, a retailer sent a sample of 85
salespeople to a training program that emphasized self-image, respect
for others, and manners. Management decided that if the rate of
complaints fell below 10% per month after the training, it would judge
the program a success.

Test µ < 0.1 vs. µ ≥ 0.1

• According to Fortune, on February 27, 2007, the average stock in all


U.S. exchanges has a drop of 3.3%. If a random sample of 120 stocks
reveals an average drop of 2.8% on that day and a standard deviation of
1.7%, are there grounds to reject the magazine’s claim?

Test µ = 3.3 vs. µ �= 3.3

Pritam Ranjan / OM&QT 3


IPS

Hypothesis test for p


• Example 1: A pharmaceutical company is advertising that in more than
70% cases of migraine, ”ibuprofen” is preferred over ”asprin”. You
conducted a survey on 25 randomly chosen individuals with migraine,
and found that 18 patient preferred ”ibuprofen” over ”asprin”. Test the
claim made by the pharmaceutical company.

Random variable:

Data:

Parameter of interest:

Hypotheses : H0 : vs. Ha :

Pritam Ranjan / OM&QT 4


IPS

Defining H0 and Ha
• Should we use Ha : p > 0.7 vs. H0 : p ≤ 0.7
OR
Ha : p < 0.7 vs. H0 : p ≥ 0.7

H0 : “he is a rapist” OR “he is not a rapist”


H0 : “he is Covid+” OR “he is not Covid+”

Pritam Ranjan / OM&QT 5


IPS

Hypothesis test for p


Test procedure for H0 : vs.Ha :

1. Find a good estimator of p

– ”large value of Xobs ” is consistent with ”large values of p”?


– i.e., large value of Xobs is consistent with Ha

2. Build a sensible decision rule (rejection region):

Pritam Ranjan / OM&QT 6


IPS

Hypothesis testing
A few important points
1. We do not know the truth.
2. Based on the observed data, we have to support either H0 or Ha
3. Of course, we cannot be certain (i.e., there is some room for error)

Pritam Ranjan / OM&QT 7


IPS

Hypothesis testing
A few important points
1. We do not know the truth.
2. Based on the observed data, we have to support either H0 or Ha
3. Of course, we cannot be certain (i.e., there is some room for error)

Pritam Ranjan / OM&QT 8


IPS

Hypothesis testing
A few important points
1. We do not know the truth.
2. Based on the observed data, we have to support either H0 or Ha
3. Of course, we cannot be certain (i.e., there is some room for error)

Pritam Ranjan / OM&QT 9


IPS

Type I, II errors - Summary


• Type I error:
– maximum P(Type I error) is also called ”Type I error rate”
– maximum P(Type I error) is denoted by α
– α is also called ”level of significance”
– P(Type I error) is maximized at the boundary of H0 and Ha

• Type II error:
– P(Type II error) is always computed for a given fixed p ∈ Ha
– P(Type II error at p ∈ Ha ) is denoted by β(p)
– Power of a test K (p) = 1 − β(p)

Pritam Ranjan / OM&QT 10


IPS

“Good” test

• Objective: built a test that minimizes both Type I and Type II errors

• Define H0 , Ha assuming you want to be more careful when rejecting H0 .

Pritam Ranjan / OM&QT 11


IPS

“Good” test (contd.)


• Example 1: A company is advertising that in more than 70% cases of
migraine, ”ibuprofen” is preferred over ”asprin”. Survey on 25 individuals
found that 18 patient preferred ”ibuprofen” over ”asprin”. Test the claim
made by the company.

Recall: H0 : vs. Ha :

Test statistic: X ∼

Observed: Xobs =

Decision rule: reject H0 if

Maximum Type I error probability:

α = P(Reject H0 |p = p0 )

= P(X ≥ |p = )

Pritam Ranjan / OM&QT 12


IPS

(1) Critical Value Approach

(2) P-value Approach

Pritam Ranjan / OM&QT 13


IPS

Critical value approach


Hypothesis of interest
H0 : p ≥ p0 vs. H a : p < p0

(1) Assume a random sample from Ber (p)


(2) Test statistic: X - the number of successes in n trials
(3) Exact distribution: X ∼ bin(n, p)
(4) Approximate distribution: X ∼ N(np, npq)
(5) Decision rule: reject H0 if Xobs is too small

Pritam Ranjan / OM&QT 14


IPS

Critical value approach


Hypothesis of interest
H0 : p ≥ p0 vs. H a : p < p0

(1) Assume a random sample from Ber (p)


(2) Test statistic: X - the number of successes in n trials
(3) Exact distribution: X ∼ bin(n, p)
(4) Approximate distribution: X ∼ N(np, npq)
(5) Decision rule: reject H0 if Xobs is too small

How small is small?

Pritam Ranjan / OM&QT 15


IPS

Critical value approach


Hypothesis of interest
H0 : p ≥ p0 vs. H a : p < p0

(1) Assume a random sample from Ber (p)


(2) Test statistic: X - the number of successes in n trials
(3) Exact distribution: X ∼ bin(n, p)
(4) Approximate distribution: X ∼ N(np, npq)
(5) Decision rule: reject H0 if Xobs is too small

How small is small?

(5) Decision rule: reject H0 if Xobs ≤ C


How to find a reasonable C (aka - the critical value)?

Pritam Ranjan / OM&QT 16


IPS

Critical value approach


Hypothesis of interest
H0 : p ≥ p0 vs. H a : p < p0

(5) Decision rule: reject H0 if Xobs ≤ C


How to find a reasonable C (aka - the critical value)?

• Exact distribution: X ∼ bin(n, p)


• Approximate distribution: X ∼ N(np, npq)

Pritam Ranjan / OM&QT 17


IPS

Critical value approach


Hypothesis of interest
H0 : p ≥ p0 vs. H a : p < p0

(5) Decision rule: reject H0 if Xobs ≤ C


How to find a reasonable C (aka - the critical value)?
(5) Decision rule: reject H0 if (using approx sampling distr under H0 )
Xobs − np0
√ ≤ C∗
np0 q0

Pritam Ranjan / OM&QT 18


IPS

Critical value approach


Hypothesis of interest
H0 : p ≥ p0 vs. H a : p < p0

(5) Decision rule: reject H0 if Xobs ≤ C


How to find a reasonable C (aka - the critical value)?
(5) Decision rule: reject H0 if (using approx sampling distr under H0 )
Xobs − np0
√ ≤ C∗
np0 q0
What is C ∗ ?

Pritam Ranjan / OM&QT 19


IPS

Critical value approach


Hypothesis of interest
H0 : p ≥ p0 vs. H a : p < p0

(5) Decision rule: reject H0 if Xobs ≤ C


How to find a reasonable C (aka - the critical value)?
(5) Decision rule: reject H0 if (using approx sampling distr under H0 )
Xobs − np0
√ ≤ C∗
np0 q0
(6) Given a (small) level of significance α

C ∗ = −Zα lower α quantile of N(0, 1)


(e.g., if α = 0.05, the value of C ∗ = −1.645)

Pritam Ranjan / OM&QT 20


IPS

Summary of hypotheses for p


Assume: X ∼ bin(n, p) ≈ N(np, npq)

Ha Decision Rule

Pritam Ranjan / OM&QT 21


IPS

Example

Out of all the air-travel bookings in major airlines, at least 58% are said to be
done online. A sample of 70 airlines revealed that 52% of bookings for last
year were done online. State the null and alternative hypotheses and carry
out the test at the 5% level of significance.

Pritam Ranjan / OM&QT 22


IPS

Example (...)

In a random sample of 30 students at IIMI it was found that 22 use non-Apple


laptops. Test at α = 0.05 if there is sufficient evidence to conclude that over
60% of the students use non-Apple laptops.

Pritam Ranjan / OM&QT 23


IPS

Example (...)

A random sample of 150 recent donations at a certain blood bank reveals


that 82 were type A blood. Does this suggest that the actual percentage of
type A donations differs from 40%, the percentage of the population having
type A blood? Carry out a test of the appropriate hypotheses using a
significance level of α = 0.01. Would your conclusion have been different if a
significance level of α = 0.05 had been used?

Pritam Ranjan / OM&QT 24


IPS

Method - 2 for hypothesis testing

P-value method

Pritam Ranjan / OM&QT 25

You might also like