Hypothesis Testing - Somerville Public Schools

Download Report

Transcript Hypothesis Testing - Somerville Public Schools

Hypothesis Testing
Terminology
• Hypothesis Testing: A decision making process for
evaluating claims about a population. Every situation
begins with a statement of a hypothesis.
• Statistical Hypothesis: A conjecture about a population
parameter. The conjecture may or may not be true.
• Two types of statistical hypotheses: Null hypothesis and
Alternative hypothesis.
• Null: Symbolized by H₀, is a statistical hypothesis that
states that there is no difference between parameter and a
specific value.
• Alternative: Symbolized by H₁, is statistical hypothesis that
states a specific difference between parameter and a specific
value.
Stating Hypotheses
• Here are few illustrations on how hypothesis
should be stated.
• #1. Medical researcher wants to know if the
weight of an individual will increase, decrease, or
remain the same after taking an ADHD
medication. The mean weight of the population
under the study is 176 pounds. Hypotheses for
this situation are as follows.
• H₀: 𝜇 = 176 H₁: 𝜇 ≠ 176
• This is called a two-tailed test since the researcher
is not sure if it weight will rise or fall.
Stating Hypotheses
• #2. A food manufacturer wants to add a
preservative to increase the shelf life of their
product. The mean shelf life of their product is 6
weeks. Hypotheses for this situation are as
follows.
• H ₀: 𝜇 ≤ 6
H ₁: 𝜇 > 6
• In this situation the company is only interested in
increasing the shelf life of the product.
• This is called a right-tailed test since the interest
is to increase.
Stating Hypotheses
• #3. A homeowner wishes to lower their heating
bill by installing a programmable thermostat.
Their average monthly bill is $93. Hypotheses for
this situation are as follows.
• H₀: 𝜇 ≥ $93 H₁: 𝜇 < $93
• In this situation the homeowner is only interested
in lowering their monthly heating bills.
• This is called a left-tailed test, since the interest is
to decrease.
Your Turn
• State the null and alternative hypotheses for each
conjecture:
• #1. The average income of a CEO is $85,500.
• #2. A SHS teacher hypothesizes that grades will
increase on a student’s SAT score if they enroll in a
prep class. The average SAT score of students enrolled
in a SAT Prep class is less than 1200.
• #3. A homeowner hypothesizes that if his township
hires a land surveyor he might be able to lower his
yearly flood insurance premium. The average amount
of flood insurance paid in his neighborhood exceeds
$3,200 a year.
Designing the Study
• After the hypotheses are formulated the researcher now
selects the correct statistical test, chooses an
appropriate level of significance and formulates a plan
for conducting the study.
• Using first example: A group of patients using ADHD
drug are selected and after a few weeks their weights
are measured again. If the mean weight turns out to be
178 pounds then researcher may conclude difference
due to chance and not reject null hypothesis. If avg. is
185 pounds then researcher would conclude it does
increase weight and reject the null hypothesis.
• Question is now “Where do you draw the line?”
Statistical Test
• Statistical test: Uses the data obtained from a
sample to make a decision about whether or not to
reject the null hypothesis.
• Test value: The numerical value obtained from
the statistical test.
• In this type of test the mean is computed from the
sample and compared with the population mean.
• A decision is then made to keep the null
hypothesis or reject it.
Types of Errors
• The are four possible outcomes from the
testing situation. You will notice that there are
2 correct possibilities and 2 incorrect
possibilities.
Types of Errors
• Type 1 Error: Occurs if one rejects the null hypothesis and it is true.
• Type 2 Error: Occurs if one does not reject the null hypothesis and it
is not true.
• In our example: The medication may not change the weight of all
users in the population but it might, by chance, change the weight in
the sample causing the researcher to reject the null when it’s true.
This is type 1 error.
• On the other hand the meds might not change the weight much for
the sample but when given to population it might cause significant
increases or decreases in weight. The researcher therefore does not
reject the null and this is considered a type 2 error.
• Decision to reject or not reject does not prove anything. The
decision is made based on probability. So when there is a large
difference between parameters then null hypothesis is probably not
true.
• So now the question is how large a difference is necessary to reject
it?
Level of Significance
• Level of Significance: The maximum probability of
committing a type 1 error. This probability is
symbolized by ∝. Therefore P(type 1 error) = ∝.
Probability of type 2 error is symbolized by
𝛽. Therefore P(type 2 error) = 𝛽.
• Generally use 3 significance levels: 0.10, 0.05, and
0.01. Therefore if the null is rejected the probability of
type 1 error will be 10%, 5%, and 1% and probability
of being correct is 90%, 95% and 99%.
• Any level of significance can be chosen.
• After a level of significance is chosen a critical value is
selected from a table for the appropriate test. Possibly
the z table or the t table.
Critical Value
• Critical Value: Separates the critical region from the
noncritical region. The symbol for critical value is C.V.
• The critical or rejection region: The range of values of
the test value that indicates that there is a significant
difference and that the null hypothesis should be
rejected.
• The noncritical or non rejection region: The range of
values of the test value that indicates that the difference
was probably due to chance and that the null hypothesis
should not be rejected.
• The critical values can be on the right side, left side, or
both sides of the mean depending on the inequality sign
of the alternative hypothesis.
One and Two-Tailed Tests
• One tailed test: Indicates that the null
hypothesis should be rejected when the test
value is in the critical region on one side of the
mean. Depending on direction of inequality
symbol they are classified as right-tailed or
left-tailed.
• Two-tailed test: The null hypothesis should be
rejected when the test value is in either of the
critical regions.
How to find C.V.
• Step 1: Draw the figure and indicate the appropriate area.
• Step 2: Researcher chooses an alpha level. For our
example 3 about heating costs lets say we choose 𝛼 = .05
(H₀: 𝜇 ≥ $93 H₁: 𝜇 < $93)
• Step 3: We find the z-value by subtracting .05 from .5 and
use that area to find the z-value. What is z-value of area
.4500?
• Step 4: Since this is a left-tailed test the z-value will be
negative. The region to the right is noncritical region and
area to left is the critical region.
• If we have two-tailed test we must divide 𝛼 by 2 first and
then find appropriate z-values. One will be positive and the
other negative. Region in middle is noncritical and regions
in both tails is critical.
C.V. Examples
• #1 A right-tailed test with 𝛼 = .01
• #2 A left-tailed test with 𝛼 = .06
• #3 A two-tailed test with 𝛼 = .10
High Five
The Z-Test
• Z-Test: A statistical test for the mean of a
population. Used when n ≥ 30, or when
population is normally distributed and 𝜎 is
known.
• Formula:
• X = Sample mean, 𝜇= hypothesized population
mean, 𝜎= population deviation (standard), n =
sample size
Z-Test Example
• Going to follow the 5 steps that were mentioned in
previous slide to solve problem.
• #1: A researcher reports that the average yearly income
for a firefighter is more than $44,000. A sample of 40
firefighters has a mean of $45,650. At ∝ = .05 test the
claim that the firefighters earn more than $44,000 a
year. The standard deviation is $5,100.
• Step 1: State hypotheses and identify the claim.
• Step 2: Find critical value/s.
• Step 3: Compute test value by using Z-Test.
• Step 4: Make decision to reject or to not reject the null.
• Step 5: Summarize results.
Z-Test Example
• #2: A newspaper claims that the average college
student watches less television than the general public.
The national average is 25.7 hours per week with a
standard deviation of 3 hours. A sample of 30
teenagers has a mean of 28 hours. Is there enough
evidence to support the claim at ∝ = .01?
• Step 1: State hypotheses and identify the claim.
• Step 2: Find critical value/s.
• Step 3: Compute test value by using Z-Test.
• Step 4: Make decision to reject or to not reject the null.
• Step 5: Summarize results.
Your Turn
• #3: A shoe-store manager claims that the
average price for a pair of sneakers is $89.95.
A sample of 68 sneakers has an average of
$90.26. The standard deviation of the sample
is $3.00. At ∝ = .05, is there enough evidence
to reject the manager’s claim.
Outcomes of Hypothesis
Testing
• If the claim is the null hypothesis there are 2
possibilities:
• #1: If rejected: There is enough evidence to reject the
claim.
• #2 If not rejected: There is not enough evidence to
reject the claim.
• If the claim is the alternative hypothesis there are 2
possibilities:
• #1 If null is rejected than there is enough evidence to
support the claim.
• #2 If null is not rejected than there is not enough
evidence to support the claim.
P-Values
• Statisticians usually test at a common ∝ level. (0.10, 0.05,
and 0.01)
• Sometimes computer statistical packages give a P-Value.
This is the actual probability of getting a sample mean value
or more extreme value in the direction of the alternative
hypothesis if the null is true.
• Example: Let’s say the null hypothesis is H₀: 𝜇 ≤ 40 and
the mean of a sample is 43. A computer can print a P-Value
of 0.0356 for a statistical test, then the probability of getting
a sample mean of 43 or greater is 0.0356 if the true mean is
40. Therefore the null hypothesis would be rejected at ∝ =
0.05 but not at ∝ = 0.01.
• When hypothesis test is two-tailed the area corresponding to
the P-Value must be doubled. In example above 2(0.0356) =
0.0712.
Steps to finding P - Values
• Step 1: State the hypotheses and identify the
claim.
• Step 2: Compute the test value for the problem.
• Step 3: Use Table to find corresponding area for
the z-value .
• Step 4: Subtract the area from .5000 to find area
in the correct tail. This step determines the P –
Value.
• Step 5: Make a decision to reject the null
hypothesis or not reject it.
• Step 6: Summarize the results.
P – Value Examples
• A researcher wishes to test the claim that the average age of
doctors in a certain city is 37 years. She selects a sample of
40 doctors and finds the mean to be 37.8 years with a
standard deviation of 2 years. Is there evidence to support
the claim at ∝ = 0.05? Find the P-Value.
• Step 1: State the hypotheses and identify the claim.
• Step 2: Compute the test value for the problem.
• Step 3: Use Table to find corresponding area for the zvalue.
• Step 4: Subtract the area from .5000 to find area in the
correct tail. This step determines the P – Value.
• Step 5: Make a decision to reject the null hypothesis or not
reject it.
• Step 6: Summarize the results.
Your Turn
• A college professor claims that the average
cost of a book is greater than $27.50. A
sample of 50 books has an average of $29.30.
Standard deviation of the sample is $5.00.
Find the P – Value for the test. On the basis of
the P – Value should the null be rejected at
∝ = 0.05?
∝ Value vs. P-Value
• There is a clear distinction between ∝ value and P –
Value.
• ∝ value: chosen before the statistical test is conducted.
• P – Value: Is computed after the sample mean has been
found.
• 2 schools of thought on P – Values.
– 1. Some researchers do not choose an ∝ value but report
the P – Value and allow the reader to decide whether to
reject the null or not.
– 2. Others decide on the ∝ value in advance and use the P –
Value to make the decision.
The T- test
• T – test: A statistical test for the mean of a
population and is used when the population is
normally or approximately distributed, 𝜎 is
unknown, and n < 30.
• Formula:
• Basically same as z – test but here the sample
standard deviation (s) is used.
Finding critical t value
• Step 1: Find the correct ∝ using the top row
and determine if the test is a one-tailed test or a
two-tailed test.
• Step 2: Determine the d.f and where they
intersect each other that become the critical
value for the problem.
• If test is right-tailed answer is positive, if lefttailed answer is negative, if two-tailed answer
is both positive and negative.
T – test examples
• Going to use same procedures as z – test.
• Example 1: A machine is supposed to fill jars
with 16 ounces of coffee. A consumer
suspects that the machine is not filling the jars
completely. A sample of 8 jars has mean of
15.6 ounces and a standard deviation of 0.3
ounces. Is there enough evidence to support
the claim at ∝ = 0.10?
T – test example
• Example 2: A physician claims that a joggers’
maximal volume oxygen uptake is greater than
the average of all adults. A sample of 15
joggers has a mean of 43.6 milliliters per
kilogram and a standard deviation of 6 ml/kg.
If the average of all adults is 36.7 ml/kg, is
there enough evidence to support the
physician’s claim at ∝ = 0.01?
Your turn
• The average amount of rainfall for the
Northeast, during the summer, is 11.52 inches.
A researcher selects a random sample of 10
cities and finds that the average amount of
rainfall was 7.42 inches. The standard
deviation for the sample is 1.3 inches. At ∝ =
0.05, can it be concluded that for the summer
the mean rainfall was below 11.52 inches?
P – Values for t - tests
• Are computed the same way as they are in the z-test but
with a twist.
• Table F gives t – values for only selected value of ∝. To
compute the exact P – Values for a t- test one would
need a table similar to Table E for each d.f
• Suppose test value is 2.056 for a sample size of 11. To
get the P – Value you need to look in Table F across the
row with d.f. 10 and find 2.056 falls between 1.812 and
2.228. Since it is a one-tailed test look at row labeled
“One tail, ∝” and 2.056 falls between 0.05 and 0.25.
Therefore the P – Value would be contained in the
interval 0.025 < P – Value <0.05.
The Proportion Test
• Many hypothesis testing situations involve
proportions.
• Examples: 85% of people over 21 have entered
a sweepstakes, 51% of Americans buy generic
products.
• Formula for the z – test of proportions.
• Z = X – np where np = 𝜇 and 𝑛𝑝𝑞 = 𝜎
𝑛𝑝𝑞
Steps for Proportion Problems
• Step 1: State the hypotheses and determine the
claim.
• Step 2: Find the mean and standard deviation for
the problem. np = 𝜇 and 𝑛𝑝𝑞 = 𝜎
• Step 3: Find the critical value/s using our z-table.
Remember to divide ∝ by 2 if two-tailed test.
• Step 4: Compute the test value using formula just
stated.
• Step 5: Summarize.
Proportion Test Examples
• The 𝜇 symbol for proportion problems turns into a p
when creating the hypotheses.
• Example 1:An educator estimates that the dropout rate
for seniors at high schools in Ohio is 15%. Last year, 38
seniors from a random sample of 200 withdrew. At ∝ =
0.05, is there enough evidence to reject the claim?
• Example 2: A telephone company rep. estimates that
40% of its customers want call waiting service. To test
the hypothesis, she selected a sample of 100 customers
and found that 37% had call waiting. At ∝ = 0.01 is her
estimate appropriate?
Your turn
• A statistician read that at least 77% of the
population oppose replacing the $1 bills with
$1 coins. To see if the claim is valid, he
selected a sample of 80 people and found that
55 were opposed to replacing the $1 bills. At
∝ = 0.01, can it be concluded that at least 77%
of the population are opposed to the change?
Variance or Standard
Deviation Test
• In Chapter 8 we used the Chi-Square distribution
to construct confidence intervals for a single
variance or standard deviation. It can also be
used to test a claim about them as well.
• 3 cases to consider for these types of problems.
• Finding the chi-square critical value for a specific
∝ when they hypothesis test is right-tailed.
• Finding the chi-square critical value for a specific
∝ when the hypothesis test is left-tailed.
• Finding the chi-square critical value for a specific
∝ when the hypothesis test is two-tailed.
Chi-Square C.V. for
Right-Tailed Test
• Example: Find the critical chi-square value for
16 d.f. when ∝ = 0.05.
• Find the ∝ value at the top of the Table and
find the d.f. along the left column. Where they
intersect becomes our C.V.
• What is it for our problem?
Chi-Square C.V. for
Left-Tailed Test
• When we have a left tailed test we are going to have to
subtract the ∝ from 1. The reason for this is because
the Chi-Square Table gives the area to the right of the
C.V. and the Chi-Square statistic can’t be negative.
• Example: Find the critical chi-square value for 11 d.f.
when ∝ = 0.01.
• Subtract 1 – 0.01 = 0.99, which is the area to the right of
the C.V.
• Now we look for .99 on top of table and the d.f. = 11 on
the side. Intersection becomes our C.V.
• What is our C.V.?
Chi-Square C.V. for
Two-Tailed Test
• When a two-tailed test is conducted the area must be
split.
• Example: Find the critical chi-square value for 18
d.f. when ∝ = 0.10.
• Therefore the area to the right of the larger value is
0.05 and the area to the right of the smaller value is
0.95 (1 – 0.05).
• Now look at intersections of d.f. = 18 and 0.05 and
0.95.
• What are our C.V.?
Larger than 30?
• After d.f. reach 30, the table only gives values
at multiples of 10 (40,50,60, etc.)
• When d.f. are not specifically given we will
use the closest SMALLER value.
• Example: d.f. = 47. We will then use the d.f. =
40.
Chi-Square Test for a
Single Variance
• The 𝜇 symbol for proportion problems turns into a 𝜎 ²
symbol when creating the hypotheses.
• Formula:
• n = sample size
• s² = sample variance
• 𝜎 ² = population variance
Why test Variances or
Standard Deviations?
• A couple of reasons:
1. In any situation, where consistency is required, one
would like to have the smallest variation possible in
the products. Example: If we manufacture car parts
we need to make sure that the holes vary in diameter
minimally or other pieces may not come together
properly.
2. In education if a test is given to a group of students, to
check for understanding of the subject, the overall
deviation should be large so that we can determine
which students have learned the subject and which
students have not.
Variance or Standard Deviation
Examples
• Going to use the same 5 steps we have been using
for hypothesis testing.
• Example 1: An instructor wishes to see if the
variation in scores of the 23 students in her class
is less than the variance of the population. The
variance of the class is 198. Is there enough
evidence to support the claim that the variation of
the students is less than the population variance of
225 at ∝ = 0.05? Assume scores are normally
distributed.
Variance or Standard Deviation
Examples
• Example 2: A medical researcher believes that
the standard deviation of the temperatures of
newborn infants is greater than 0.6℉. A
sample of 15 infants was found to have a
standard deviation of 0.8℉. At ∝ = 0.10, does
the evidence support the researcher’s belief?
Assume that the variable is normally
distributed.
Your turn 
• A manufacturer claims that the standard
deviation of the strength of wrapping cord is 9
pounds. A sample of 10 wrapping cords
produced a standard deviation of 11 pounds.
Can it be concluded that at ∝ = 0.05, the claim
is correct?