Sie sind auf Seite 1von 55

Hypothesis

Hypothesis Testing

1. What percentage of coupons printed in the


newspapers are redeemed?
2. How much more effective is prescription A than
prescription B?
3. Is it true that 30% of the shoppers buy their favorite
brand of toothpaste, regardless of the price?
4. Is this die biased in favor of 3?
5. Do boys and girls score differently on the verbal part
of the GAT?
Hypothesis Testing

• What is a statistical hypothesis?


– A statement about one or more populations which
is either true or false
– The statement ends with a period not with a
question mark
– It can be labeled as true or false
– The statements are about one or more population
parameters
– Sample statistic can be used to estimate these
parameters
Hypothesis Testing

• What is a hypothesis test?


– A procedure used to make inferences about the
truth or falsity of a hypothesis
• What is a one sample test?
– When we sample one population, we call the test
one sample test.
• What is a two sample test?
Hypothesis Testing

Q3. Is it true that 30% of the shoppers buy their


favorite brand of toothpaste, regardless of
the price?
H1: The percentage of shoppers who buy their
favorite toothpaste regardless of price is
30%.
H2: The percentage of shoppers who buy their
favorite toothpaste regardless of price is not
30%.
Hypothesis Testing

Q3. Is it true that 30% of the shoppers buy their


favorite brand of toothpaste, regardless of
the price?
• What is the population for this study?
• What is the parameter being considered?
–P
H1: p = 0.30.
H2: p ≠ 0.30.
Hypothesis Testing

Q 4. Is this die biased in favor of 3?


The two opposite hypotheses are
H1: The die is biased for 3s.
H2: The die is not biased for 3s.
Hypothesis Testing

Q 4. Is this die biased in favor of 3?


• What is the population for this study?
• What is the parameter being considered?
–P
H1: p > 1/6.
H2: p = 1/6. (≤)

H1: The die is biased for 3s; p > 1/6.


H2: The die is not biased for 3s; p = 1/6.
Hypothesis Testing

Q 5. Do boys and girls score differently on the


verbal part of the GAT?
• What would be two opposite hypotheses?
H1: Boys and girls have the same average scores
on the verbal part of GAT.
H2: Boys and girls do not have the same average
scores on the verbal part of GAT.
Hypothesis Testing

Q 5. Do boys and girls score differently on the


verbal part of the GAT?
• What are the populations for this study?
– This is a two-sample comparison
– There are two populations; all the boy who took
GAT and all the girls who took GAT
• What are the parameters being considered?
– Mean score for girls µG
– Mean score for boys µB
Hypothesis Testing

H1 claims that µG = µB, while H2 claims that µG ≠


µB.

H1: The average verbal scores are same; µG = µB.


H2: The average verbal scores are not same; µG ≠
µB.
Hypothesis Testing

• What is a null hypothesis?


– Is this a fair coin? What is a fair coin?
– What are our hypotheses?
• H1: The coin is fair; p = 0.50.
• H2: The coin is not fair; p ≠ 0.50.
– We attempt to establish the truth of either one of
these. If one is true, the other is false.
– Which hypothesis is easier to test?
– We know what to expect in the case of H1.
– We do not know what to expect in the case of H2.
Hypothesis Testing

• A null hypothesis is the one that leads to an expected


value which can be confirmed or denied by analyzing the
data from an appropriate sample.
– The null hypothesis is often the one that implies
fairness and honesty
• The die is fair.
• The claim is true.
• This theory is correct.
– Symbol is H0
Hypothesis Testing

• What do you call the hypothesis that is


opposite to the null hypothesis?
– Motivated or alternative hypothesis
– No specific expected value
– Of the original interest
• The die is biased.
• The claim is false.
• This theory is wrong.
– Ha
Hypothesis Testing

Q3. Is it true that 30% of the shoppers buy their


favorite brand of toothpaste, regardless of
the price?
H1: p = 0.30.
H2: p ≠ 0.30.
Hypothesis Testing

Q 4. Is this die biased in favor of 3?


H1: The die is biased for 3s; p > 1/6.
H2: The die is not biased for 3s; p = 1/6.
Hypothesis Testing

Q 5. Do boys and girls score differently on the


verbal part of the GAT?
H1: The average verbal scores are same;
µG = µ B.
H2: The average verbal scores are not same;
µG ≠ µ B .
Hypothesis Testing

Null: p = 0.30.
Alternative: p ≠ 0.30.

Null : p = 1/6.
Alternative: p > 1/6.

Null: µG = µB.
Alternative: µG ≠ µB .
Hypothesis Testing

• Average age in Pakistan is 56 years


– Figure is too large
– Figure is too small
– Figure is simply suspicious and may be too small
or too large
Hypothesis Testing

One- and two-tail alternatives

Q 3. Null: p = 0.30.
Alternative: p ≠ 0.30.

Q 4. Null: p = 1/6.
Alternative: p > 1/6.

Q 5. Null: µG = µB.
Alternative: µG < µB.
Hypothesis Testing

• One- and two-tail alternatives


Average age in Pakistan is 56 years
• Figure is too large (one-tail alternative)
• Figure is too small (one-tail alternative)
• Figure is simply suspicious and may be too
small or too large (two-tail alternative)
Hypothesis Testing

Null and alternatives


• Equal sign always appear in the null
hypothesis.
• The alternative hypothesis for one-tail test
contains < or > sign
• The alternative hypothesis for two-tail test
always contain ≠
Hypothesis Testing

• Formulate the null hypothesis and the


alternative hypothesis
– Is the average life span of a horse more than 13
years?
• Suppose population is all the horses at race club
• Let  = the average life span of horses
• H0 : The average life span is 13;  = 13.
• Ha : The average life span is not 13;  > 13.
Hypothesis Testing

− Is the proportion of 18-year old drivers who


have accidents the same the proportion of 26-
year-old drivers who have accidents?
• Suppose this study is set up in Lahore, Punjab, Pakistan.
• It compares two populations: All 18 years-old drivers and
all 26-year old drivers.
• Let p1 = P(an 18-years old has an accident)
Let p2 = P(an 26-years old has an accident)
• H0 = The proportion of accidents for two age groups are
same; p1 = p2 or p1 - p2 = 0.
• Ha = The proportion of accidents for two age groups are
not same; p1 ≠ p2 or p1 - p2 ≠ 0.
Hypothesis Testing

– What percentage of people born with Dyslexia can


be taught to read?
• Numerical response
• No claims to test
• Does not lead to hypothesis test
Hypothesis Testing

– Do teenage girls receive a smaller daily allowance


than teenage boys?
• Compares two averages
• Suppose population is all the teenage boys and
all the teenage girls in Kalar Kahar
• µG = Average daily allowance for teenage girls
µB = Average daily allowance for teenage boys
• H0: The average allowances are same; µG = µB.
Ha: The average allowances are not same;
µG < µB.
Hypothesis Testing

• Making a decision rule


• Two hypotheses established
• How to evaluate data? The function of decision
rule.
• For any hypothesis test, some appropriate statistic
is calculated from the sample data
• The decision rule decides all values of that statistics
which leads to the rejection of null hypothesis
• This set of values is called the decision region for
the hypothesis test
Making a Decision Rule

• You suspect that a certain coin is biased for


heads.
• What kind of statistical test can you use to
confirm your suspicion?
• Describe
– Population
– Parameter of interest
– The null and the alternative hypotheses
– The sample test statistics
– The decision rule
Making a Decision Rule

• Population
All possible tosses of the coin
• Parameter of interest
p
• The null and the alternative hypotheses
H0: The coin is fair; p = .5
Ha: The coin is not fair; p > .5
• The sample test statistics; on which we base a
conclusion about the parameter p
S, the number of heads
Making a Decision Rule

• Toss 40 times
• If fair then about 20 heads
• If biased substantially more than 20 heads
• what is substantially more than 20 heads?
• Make a decision rule;
– If in 40 tosses you get 25 or more heads then the coin
is biased
• Experiment
– Reject H0 if S  25
Statistical Errors

• Are you absolutely sure that your decision is


correct?

Not really, our decision is based on a sample


Statistical Errors

Four possible situations

1. H0 is true and sample data lead you to correctly


decide that it is true
2. H0 is true but by bad luck the sample data lead you to
mistakenly decide that it is false
3. H0 is false and sample data lead you to correctly
decide that it is false
4. H0 is false but by bad luck the sample data lead you
to mistakenly decide that it is true
Statistical Errors

• What is a type I error?


Type I error is rejecting a true null hypothesis as a
result of the luck of the sample.
• What is a type II error?
Type II error is failing to reject a false null hypothesis
as a result of the luck of the sample.
Statistical Errors
You fail to reject H0 You reject H0

H0 Is true Correct Type I error

H0 Is false Type II error Correct


Fail to reject H0 Reject H0

H0 true Truth not rejected Truth rejected,



H0 Is false Falsehood not Falsehood
rejected,  rejected
Statistical Errors

• You suspect that a certain coin is biased for


heads.

H0: The coin is fair; p = .5


Ha: The coin is not fair; p ≠ .5
Decision rule: Decide that the coin is biased if we
get 25 or more heads

What is meant by type I error and type II error


Statistical Errors

Calculating  from a given decision rule


• The coin is biased for heads
– What are the hypotheses?
– Take the value of p from our assumption that H0
p = P(heads) = 0.50 & q = 0.50
– The distribution of S
– What is np and nq?
Statistical Errors

–  = np = 20
 = 𝑛𝑝𝑞 = 3.16
– Find the probability that we would toss 25 or
more heads in 40 trials
– P (S  25)
– What is 𝒛𝟐𝟒.𝟓 ?
– P (S  25) =
–=
– We found value of  from a given decision rule
Statistical Errors

• Finding the decision rule that corresponds to a


given value of 
– We prefer to find the decision rule corresponding
to a given value of 
– Previous example  = .08, risk of making type I
error is too big
– How big a risk of type I error you are willing to
accept?
Say 0.01, and then calculate the decision rule
– Setting the significance level of the test
Statistical Errors

–  = 0.01
– One-tail test on the right
– Look up the area of 1.00 – 0.01 = .99
– 𝑧𝑐 = 2.33
The subscript c indicate that this is a critical value
The critical value is the value that marks the start
or end of the rejection region
– Transform 𝑧𝑐 into specific number of heads
𝑆𝑐 =  + 𝑧𝑐 x 
𝑆𝑐 = 27.8
Statistical Errors

• What is the significance level of a test?


The significance level of a hypothesis test is the
probability that the decision rule will result in type I
error
• Critical value of z-score
One-tail test Two-tail test
 = 0.01 2.33 or −2.33  2.58
 = 0.05 1.65 or −1.65  1.96
Statistical Errors

• What is statistical significance?


When evidence results in rejecting the null
hypothesis, it is common to say that the study
has statistical significance.
Statistical Errors

• You decide to role a die 60 times and count


the number of 6s that appear. What can you
use for the decision rule if you decide to test
the die at the 0.05 significance level?
Statistical Errors

• A statistician is testing the claim that a certain


population is one-fourth male, three-fourth
females. She is going to select 80 persons at
random from population. Her decision rule is: if
she gets fewer than 15 or more than 25 males,
she will reject the claim that p = P(a person is
male) = 0.25. Suppose it is true that p does equal
0.25. What is the probability that her results will
lead her to mistakenly reject that fact? That is
What is alpha? Draw a clearly labeled curve.
Statistical Errors

A researcher is beginning to suspect that less


than 3% of all the students have dyslexia.
• State the two hypotheses both in words and
symbols
• If 1000 children are sample, how few must
have dyslexia to convince us that the suspicion
is correct at the 0.01 significance level?
Statistical Errors

• Type II error
– For a fixed value of n, if we decrease alpha, we will
increase beta, and vice versa.
Value of  for n = 40
True value of p  = 0.05  = 0.01
0.60 0.68 0.87
0.70 0.19 0.43
0.80 0.005 0.04
Statistical Errors

• Type II error
– Increasing the sample size decreases the value of
beta without increasing the value of alpha
• Value of  for  = 0.05
True value of p n = 40 n = 60
0.60 0.68 0.55
0.70 0.19 0.06
0.80 0.005 0.0001
Hypothesis Testing Procedures

• A manufacturer claim that no more than 2%


of the women who use his anti-dandruff
shampoo suffer from side effects. We have a
feeling that this estimate is too low. We
decide to test his claim at the 0.01
significance level using a sample of 900
randomly selected women. Find the decision
rule
Hypothesis Testing Procedures

1) Identify the procedure.


2) State the population(s).
3) Define the parameter(s) (if needed) and
state Ha two ways.
4) State H0 two ways.
5) Select .
6) Choose n.
7) Gather sample data.
8) Calculate the critical value(s)
Hypothesis Testing Procedures

9) Terminate the test with the three-step


endings:
a) State the decision rule.
b) State the outcome.
c) State the conclusion two ways
10) Comment on and clarify your results
Hypothesis Testing

Assumptions
– If the null hypothesis is true, then the theoretical
distribution of the sample statistics is known
– If we took many random samples, then the
observed set of statistics would match the
theoretical distribution
Hypothesis Testing

• Two professors read in a paper that 60% of all


first year university students are more interested
in being popular than in doing well at school.
They think that it is too high, so they go around
and interview 100 first year students. They find
that 10 say that they are more interested in being
popular, while 90 say they are more interested in
doing well. Test their results at the 0.05
significance level. Interpret your findings.
• 𝑆𝑐 = 60 − 1.65 4.90 = 51.9
since 𝑆𝑜 < 𝑆𝑐 , reject 𝐻0 ; 60% is too high
Hypothesis Testing

• Two professors read in a paper that 60% of all


first year university students are more interested
in being popular than in doing well at school.
They think that it is too high,
• so they go around and interview 100 first year
students.
• They find that 10 say that they are more
interested in being popular, while 90 say they are
more interested in doing well.
• Test their results at the 0.05 significance level.
Interpret your findings.
Hypothesis Testing

• 𝑆𝑐 = 60 − 1.65 4.90 = 51.9


since 𝑆𝑜 < 𝑆𝑐 , reject 𝐻0 ; 60% is too high
Hypothesis Testing

Project 2
Select a reported fact from a newspaper or
some other source and test it on a population of
your own choice

Das könnte Ihnen auch gefallen