Anda di halaman 1dari 38

Chapter 12

Quantitative Data Analysis:


Hypothesis Testing
One sample T test
Two samples T test
F test
Z test
Errors!
Type 1 = false positive
Type 2 = false negative
Testing a hypothesis about a single
mean
A professor wants to know if her
introductory statistics class has a good
grasp of basic math. Six students are chosen
at random from the class and given a math
proficiency test. The professor wants the
class to be able to score above 70 on the
test. The six students get scores of 62, 92,
75, 68, 83, and 95. Can the professor have
90 percent confidence that the mean score
for the class on the test would be above 70?
null hypothesis:H0: = 70
alternative hypothesis:Ha: >
70
First, compute the sample mean and
standard deviation:
Next, compute thetvalue:

To test the hypothesis, the


computedtvalue of 1.71 will be
compared to the critical value in
thettable.
A 90 percent confidence level is equivalent to
an alpha level of 0.10. Because extreme values
in one rather than two directions will lead to
rejection of the null hypothesis, this is a one
tailed test, and you do not divide the alpha level
by 2. The number of degrees of freedom for the
problem is 6 1 = 5. The value in thettable
fort.10,5is 1.476. Because the computedtvalue
of 1.71 is larger than the critical value in the
table, the null hypothesis can be rejected, and
the professor has evidence that the class mean
on the math test would be at least 70.
T-Test
T = differences between sample
means / standard error of sample
means
Degrees of freedom = sample size -
1 x1 x2
t
s x1 x2
Two Sampled T-Tests: Pre
and Post
Hypothesise
H0 = There is no difference in brain
size before or after giving birth
H1 = The brain is significantly
smaller or significantly larger after
giving birth (difference detected)
Absolute Brain Volumes cm3

T=(1271-1236)/(119-113)
Results: p=.003

Women have a significantly larger brain after giving birth

http://www.danielsoper.com/statcalc/calc08.aspx
2-Mean T-Test?

Another example: A salesman in car


sales wants to find the difference
between two types of cars in terms of
mileage:
Mid-Size Vehicles

Sports Utility Vehicles


Car Salesmans Sample
The salesman took an independent
SRS from each population of
vehicles:
Level n Mean StDev
Mid-size 28 27.101 mpg 2.629 mpg
SUV 26 20.423 mpg 2.914 mpg
If a 2-Mean TTest were done on this
data:
T = 8.15 P-value = ~0
T test two related means

pooled estimator of 2
is
What if the salesman wanted to
compare another type of car, Pickup
Trucks in addition to the SUVs and Mid-
size vehicles?

Level n Mean StDev


Midsize 28 27.101 mpg 2.629 mpg
SUV 26 20.423 mpg 2.914 mpg
Pickup 8 23.125 mpg 2.588 mpg
This is an example of when we
would use the ANOVA Test.
In a 2-Mean TTest, we see if the
difference between the 2 sample
means is significant.
The ANOVA is used to compare
multiple means, and see if the
difference between multiple
sample means is significant.
Yes, we see that no two of these
confidence intervals overlap,
therefore the means are significantly
different.
This is the question that the ANOVA
test answers mathematically
ANOVA
(ANalysis Of VAriance)
Idea: For two or more groups, test
difference between means, for
quantitative normally distributed
variables.
Just an extension of the t-test (an
ANOVA with only two groups is
mathematically equivalent to a t-
test).
ANOVA Test Hypotheses
H0: 1 = 2 = 3 (All of the means are equal)
HA: Not all of the means are equal
For Our Example:
H0: Mid-size = SUV = Pickup
The mean mileages of Mid-size vehicles, Sports
Utility Vehicles, and Pickup trucks are all equal.
HA: Not all of the mean mileages of Mid-size
vehicles, Sports Utility Vehicles, and Pickup
trucks are equal.
F Statistic
Like any other test, the ANOVA test
has its own test statistic
The statistic for ANOVA is called
the F statistic, which we get from
the F Test
The F statistic takes into
consideration:
number of samples taken
x x (I) x
sample size of each sample (n1, n2, ,
n I)
means of the samples ( 1, 2, , I)
Explaining the F-Statistic
The F statistic determines if the variation
between sample means is significant

Variation Among Sample Means


Variation Among Individuals In Each Sample

This is what we are doing when we look at


the 95% confidence intervals.
F Statistic Equation
Rewritten as a formula, the F
Statistic looks like this:
Means (Squared)
Weighing

n1 ( x1 x ) 2 n2 ( x2 x ) 2 ... nI ( xI x ) 2
F I 1
(n1 1) s12 (n2 1) s22 ... (nI 1) s I2
N I

Weighing Standard Deviations


(Squared)
The F Statistic
Degrees of Freedom
The ANOVA test has 2 degrees of
freedom:
N-I (Total number sampled Number of
Groups)
I-1 (Number of Groups 1)
Some sample distributions with different
degrees of freedom.
How About Our Example:
Data:
Level n Mean StDev
Midsize 28 27.101 mpg 2.629 mpg
SUV 26 20.423 mpg 2.914 mpg
Pickup 8 23.125 mpg 2.588 mpg
F value = 40.05
P-value = ~0 (Found from a table or
using the Fcdf calculator command).
Conditions
As useful as the ANOVA test is, we can only
use it if a number of conditions are met:
We must take an independent SRS
(simple Random Sample) from each
population that we sample
All populations have the same standard
deviation. (No populations standard
deviation is double anothers)
All of the populations must be normally
distributed
Testing the Conditions
The salesman had originally taken
independent SRSs.
The second condition is fulfilled since no
sample has more than twice the
standard deviation of any other.
To test the third condition, whether the
populations being sampled are normally
shaped, we must look at the histograms
of each sample:
Try a Problem
Researchers are trying to see if the
English AP scores from four different
Massachusetts private schools are
different. From each school, a
random sample of students in the
past year was taken and compared.
Here are the results from the
samples:
Results
School n Mean StDev
BB&N 23 4.3 0.4
Roxbury Latin 25 3.9 0.6
Winsor 26 4.2 0.3
Belmont Hill 29 3.1 0.3

Is there any significant difference between


these schools AP English scores? (Assume
that the populations are normally
distributed)
Hypotheses
H0: = BB&N RL = Winsor = BelHill
The mean AP English Test scores in
BB&N, Roxbury Latin, Winsor, and
Belmont Hill are all the same.

HA: The mean AP English Test scores


in BB&N, Roxbury Latin, Winsor, and
Belmont Hill are not all the same.
Conditions
Random samples taken
All of the standard deviations are the
same
No standard deviation is more than
twice any other.
All of the populations are normally
distributed
Doing out the F Statistic
Interpretation
Since all the conditions were met, we
have conclusive evidence (df = 3,99,
p = 0) to reject the null hypothesis
that the mean AP English Test scores
in BB&N, Roxbury Latin, Winsor, and
Belmont Hill are all the same.
Populations versus Samples
Z - test

T - test
Z-Test mean for
the group
Population you are
looking at,
the mean
x for the

z population
and the
standard
variance for
the
population
to get a Z
Some Problems with a Population-
Based Study
Cost
Not able to include everyone
Too time consuming
Ethical right to privacy

Realistically researchers can only do


sample based studies

Anda mungkin juga menyukai