Hypothesis Testing

Download Report

Transcript Hypothesis Testing

 A statistical hypothesis is an assumption about a
population parameter.
 This assumption may or may not be true
http://stattrek.com/Lesson5/HypothesisTesting.aspx?Tutorial=Stat
 The Null Hypothesis (H0)
 Sample observations are resulting purely from chance
 H0 always contains an “equals” statement
 The null hypothesis is assumed to be true
 We need strong statistical evidence to reject it
 The Alternative Hypothesis (Ha)
 This is usually what we’re trying to prove
 Everything that’s not the null hypothesis
 Sample observations are influenced by some non-
random cause
 For example
Null
Hypothesis
Alternative
Hypothesis
H0: µ=$10
Ha: µ≠$10
µ is $10 or it isn’t
H0: µ≥$10
Ha: µ<$10
µ is at least $10, or it is less
Ha: µ>$10
µ is no more than $10, or it
is more
H0: µ≤$10
 We want to know if a coin is fair and balance.
 H0: Probability of each coin toss coming up heads = 0.5.
 Ha: Probability of each coin toss coming up heads ≠ 0.5.
 Suppose we test this hypothesis by flipping the coin 50
times.
 What would we conclude?
 Consider the following hypotheses.
 The director of a city’s transit system claims that 35% of
the system’s riders consists of senior citizens. In a recent
study, researchers found that only 23% of the riders were
seniors. Is the director’s claim wrong? (Transit example)
 A parts supplier claims that no more than 20% of the
parts he delivers are defective. But a random sample of a
recent delivery shows that 25% of the parts were defects.
Is the suppliers claim wrong? (Parts example)
 Transit example
 Assertion: 35% of the riders are senior citizens
 Null hypothesis: H0: π = 0.35
 The null hypothesis is identical to the transit manager’s
statement since he claimed an exact value for the parameter.
 Alternative hypothesis: Ha: π ≠ 0.35
 If the null is incorrect, the proportion must be something
other than 0.35.
 Parts example
 Assertion: Not more than 20% of the parts are defective
 Null hypothesis: H0: π ≤ 0.20
 Alternative hypothesis: Ha: > 0.20
1.
State the hypotheses
 Null
 Alternate
2.
Formulate an analysis plan
 How to use the sample data
 Significance level
 Test method
 Mean, proportion, difference between means, z-score, tscore, etc.
3.
Analyze sample data
 Test statistic =
𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐 −𝑝𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟
𝑆𝑡𝑎𝑛𝑑𝑎𝑟𝑑 𝑑𝑒𝑣𝑖𝑎𝑡𝑖𝑜𝑛 𝑂𝑅 𝑆𝑡𝑎𝑛𝑑𝑎𝑟𝑑 𝑒𝑟𝑟𝑜𝑟
 p-value
4.
Interpret the result
 A research firm claims that 62% of women age 40-49
participate in a 401(k) retirement account.
 We want to test this percentage by randomly selecting
a group of 300 women.
 What are the null and alternative hypotheses?
 Type I Error
 A Type I error occurs when the researcher rejects a null
hypothesis when it is true.
 The probability of committing a Type I error =
the significance level (α).
 Type II Error
 A Type II error occurs when the researcher fails to reject
a null hypothesis that is false.
 The probability of committing a Type II error is called Beta,
and is often denoted by β.
 The probability of not committing a Type II error is called
the power of the test.
 When a robot welder is in adjustment, its mean time
to perform a task is 1.325 minutes.
 Past experience tells us the standard deviation for the
cycle time is 0.0396 minutes.
 Using a recent random sample of 80 jobs, the mean
cycle time for the welder was 1.3229 minutes.
 Do we need to adjust the machine?
 Our company produces light bulbs with a mean life of
1030.0 hours and a standard deviation of 90.0 hours.
 We’re approached by a salesman who says he can sell
us a process that will extend the life of our bulbs.
 We decide to test this product and, using a sample of
40 bulbs, we discover that the mean life for our bulbs
using the new process is 1061.6 hours.
 Should we invest in this new process?
 When set properly, a machine produces nails that are 2
inches long with a standard deviation of 0.070 inches.
 We took a sample of 35 nails and found that their
mean length was 2.025 inches.
 Using a significance level of 0.01, is the machine
properly adjusted?
 The p-value is the probability that we would get a test
statistic as extreme as the one observed, if the null
hypothesis was true.
 In practice, all statistical software packages calculate a
p-value and return that value as part of the data.
 If p-value is ≤ our level of significance, we have
evidence to reject H0
 I took a random sample (n=30) from a population with a
known standard deviation (σ=1) and a known mean (μ=0)
-1.6239
-0.08742
0.3558 1.33541 0.23904
-0.6836 -2.03171
-0.3557 0.03744
0.0539 0.30906 -2.37686
-1.59076 -0.58299 1.71301 -1.58793 0.40806
-0.2797
-0.58236 -1.72333 1.21996 -0.79786 0.77308 1.34005
-1.07465 -1.15515 -0.98725 -1.71128 0.58343 -1.74421
 I then used a statistical package (Minitab®) to run a
1-sample z-test. Here are my results:
Test of mu = 0 vs not = 0
The assumed standard deviation = 1
Variable N
Mean
StDev
C1
30 -0.420281 1.113508
Variable P
C1
0.021
 What happened?
SE Mean
95% CI
Z
0.182574 ( -0.778120, -0.062442) -2.30
 The credit manager of a department store claims that
the mean balance for the store’s charge account
customers is $410.
 An independent auditor selects 18 accounts at random
and finds a mean balance of $511.33 and a standard
deviation of $183.75.
 The population of account balances is assumed to be
normally distributed.
 Is the credit manager correct?
 An inventor developed an, energy-efficient lawn
mower engine. He claims that the engine will run
continuously for 5 hours on one 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.
 We want to test this claim (α = .05)
 State the hypotheses
 Formulate an analysis plan
 Analyze sample data
 Interpret results
 Bon Air Elementary School has 300 students. The
principal of the school thinks that the average IQ of
students at Bon Air is at least 110. To prove her point,
she administers an IQ test to 20 randomly selected
students. Among the sampled students, the average IQ
is 108 with a standard deviation of 10. Based on these
results, should the principal accept or reject her
original hypothesis? Assume a significance level of
0.01.
 State the hypotheses
 Formulate an analysis plan
 Analyze sample data
 Interpret results
 Two sample t-test
 The sampling method for each sample is simple random
sampling
 The samples are independent.
 Each population is at least 20 times larger than its
respective sample.
 Each sample is drawn from a normal or near-normal
population.
 Within a school district, students were randomly assigned
to one of two Math teachers - Mrs. Smith and Mrs. Jones.
After the assignment, Mrs. Smith had 30 students, and
Mrs. Jones had 25 students.
 At the end of the year, each class took the same
standardized test. Mrs. Smith's students had an average
test score of 78, with a standard deviation of 10; and Mrs.
Jones' students had an average test score of 85, with a
standard deviation of 15.
 Can we determine if Mrs. Smith and Mrs. Jones are equally
effective teachers. Use a 0.10 level of significance. (Assume
that student performance is approximately normal.)
Two-Sample T-Test and CI
Sample N Mean StDev SE Mean
1
30 78.0 10.0
1.8
2
25 85.0 15.0
3.0
Difference = mu (1) - mu (2)
Estimate for difference: -7.00
90% CI for difference: (-12.91, -1.09)
T-Test of difference = 0 (vs not =): T-Value = -1.99
P-Value = 0.053 DF = 40