Statistics 203 - people.stat.sfu.ca

advertisement
Topics for Today
Hypothesis tests for 2 independent
samples with unequal variances
Independent versus Dependent Samples
Stat203
Fall 2011 – Week 9 Lecture 1
Page 1 of 22
Unequal Variances
The 2-sample t-test has two forms.
1. Variability (ie: standard deviations) are
approximately equal in the two
populations
2. Variability (ie: standard deviations) are not
equal in the two populations
We can use the sample standard deviations to
decide which version to use.
The rule of thumb is that we assume the
population standard deviations are equal
unless one is double the other.
Or … let SPSS do the work.
Stat203
Fall 2011 – Week 9 Lecture 1
Page 2 of 22
2-sample t-test for Unequal Variances
The t-statistic part is identical for equal and
unequal variances:
X1  X 2
tn 1 
sX1 X 2
… it’s just the standard deviation of the
difference that changes:
s
sX 1 X 2 
2
1
s
2
s2

n1 1 n 2 1
… and as before, we won’t calculate this by
hand, but SPSS can do it for us if necessary.
Stat203
Fall 2011 – Week 9 Lecture 1
Page 3 of 22
2-sample t-test Example
Example (Q18 pg255): Comparing sociability
of teenagers by comparing # of BFFs. We
started this in the last section of notes.
Recall, the Statistical Hypotheses:
H 0 :  females   males
vs
H1 :  females   males

Let’s look at this data in SPSS and do a 2sample t-test.
 output from a t-test of 2 independent
The
samples is ..
Stat203
Fall 2011 – Week 9 Lecture 1
Page 4 of 22
Stat203
Fall 2011 – Week 9 Lecture 1
Page 5 of 22
Some questions:
Does it appear safe to assume the variability is
the same between the two populations based
on the rule of thumb?
SPSS helps out and gives an actual test …
null hypothesis for Levene’s test is:
H0 : 1  2
What’s the p-value for Levene’s test in this
example?
So, do we accept or reject the null hypothesis
for Levene’s test?
Stat203
Fall 2011 – Week 9 Lecture 1
Page 6 of 22
Now for the t-test.
What is the test-statistic?
What is the p-value?
Do we accept or reject the Null Hypotheses of
equal BFFs for men and women?
Is the difference in BFFs between men and
women statistically significant?
Conclusion:
Stat203
Fall 2011 – Week 9 Lecture 1
Page 7 of 22
Example (Q19 p255): Sick time for hourly vs
hourly employees.
(SPSS output on the following page)
Can we assume equal variances in the hourly
and salaried populations? Why?
What is the test statistic for the t-test?
What is the p-value for the t-test?
Is the difference in mean # days absent
statistically significant?
Conclusion?
Stat203
Fall 2011 – Week 9 Lecture 1
Page 8 of 22
Stat203
Fall 2011 – Week 9 Lecture 1
Page 9 of 22
Paired Samples or
the Same Sample Measured Twice
Obtaining and measuring individuals is
expensive.
Imagine if we wanted to measure children’s
hostility before and after watching a video
depicting violence.
We could take 100 children, and randomly
divide them into 2 groups; one who watch the
video and the other that doesn’t … so 50
under each condition.
… or we could increase our sample size by
measuring the same children twice; once
before the video and once after.
another example:
http://www.youtube.com/watch?v=OyxBLgtLB-U
Stat203
Fall 2011 – Week 9 Lecture 1
Page 10 of 22
Why and how?
The ultimate motivation to repeatedly measure
the same sample (ie: same individuals), is to
‘artificially’ increase the sample size.
It’s a very powerful tool, and if your research
question could be structured in a way to take
advantage of “pairing” you can.
Identifying a ‘Paired’ t-test is quite easy.
Ensure you know the Individual that’s being
measured. If the same individual is being
measured more than once, you have a paired
situation.
Stat203
Fall 2011 – Week 9 Lecture 1
Page 11 of 22
Example (Q29 p260): Police were interested
in whether the number of 911 calls would
decrease for regions of the city that have a
neighborhood watch. They measured the
number of 911 calls in 6 ‘blocks’ before and
after neighborhood watches were set up.
Research Hypothesis:
Individuals:
Populations:
Variable of Interest:
Parameter:
Statistical Hypotheses:
Stat203
Fall 2011 – Week 9 Lecture 1
Page 12 of 22
SPSS Output:
Test-Statistic:
P-value:
Conclusion:
Stat203
Fall 2011 – Week 9 Lecture 1
Page 13 of 22
Note … most paired t-tests arise in ‘before’ &
‘after’ or ‘pre’ and ‘post’ situations.
Also, sometimes two samples are paired even
though they’re not the same individuals.
This is done when samples are ‘matched’. A
specific description should be very clear on
when a sample is ‘matched’.
Stat203
Fall 2011 – Week 9 Lecture 1
Page 14 of 22
Comparison – What’s the difference?
Let’s consider another example to
demonstrate the difference between an
independent 2-sample t-test and a paired ttest.
A medical study measured the number of
years in remission for patients given drug A
and patients give drug B. The researchers
were interested in which drug was superior.
Research Hypothesis:
Individuals:
Populations:
Variables:
Parameters:
Statistical Hypotheses:
Stat203
Fall 2011 – Week 9 Lecture 1
Page 15 of 22
Here’s the data:
Should we use a t-test
for 2 independent
samples?
That would seem
correct .. the people in
the drug A group had
nothing to do with the
people in the drug B
group, so let’s do that.
Stat203
Fall 2011 – Week 9 Lecture 1
Page 16 of 22
Variance equal?
Independent Samples test statistic:
p-value:
Conclusion:
Stat203
Fall 2011 – Week 9 Lecture 1
Page 17 of 22
Now … what if we learned that for each
individual that received drug A, the
researchers had measured a person who
received drug B, and
- was the same age
- was the same gender
- was the same ethnicity and race
- lived in the same town
… the samples are no longer independent!
People who received drug B are included
because of the people who received drug A
So, dependent samples can occur when the
values of variables in one group influence the
individuals that are included in another group
… so there are occasions when we need a
paired t-test that aren’t before/after scenarios.
Stat203
Fall 2011 – Week 9 Lecture 1
Page 18 of 22
Let’s reanalyze the results as a paired t-test.
Do any of
- Research Hypothesis,
- Individuals,
- Populations,
- Variables,
- Parameters or
- Statistical Hypotheses change?
No.
Only the Test Statistic, p-value, and possibly
the conclusions change.
From SPSS:
Stat203
Fall 2011 – Week 9 Lecture 1
Page 19 of 22
Test Statistic:
P-value:
Is the remission time
significantly different between
the drugs?
Conclusion:
Stat203
Fall 2011 – Week 9 Lecture 1
Page 20 of 22
Why did we get a different result?
The main reason is that we’re actually using
the ‘right’ test … the data was matched.
But what’s going on is that the variability from
person to person doesn’t influence our
analysis as much.
Stat203
Fall 2011 – Week 9 Lecture 1
Page 21 of 22
Today’s Topics
2-sample t-test for un-equal variances
- similar test statistic, but new standard Sd
calculation
- Can use rule of thumb or Levene’s test
from SPSS to decide which test statistic
to look at
paired t-test
- often used in ‘before’ and ‘after’ situations
- be sure samples are ‘matched’
- can offer better tests of significance if the
samples aren’t independent
New Reading
Remainder of Chapter 7
Stat203
Fall 2011 – Week 9 Lecture 1
Page 22 of 22
Download