0% found this document useful (0 votes)
23 views

Lecture8-Two Sample T Tests

Uploaded by

Ricx Rosco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Lecture8-Two Sample T Tests

Uploaded by

Ricx Rosco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Two Sample T-Test

•••••••••••••••••••••••••••••
•••••
When the means of two groups are to be
compared (where each group consists of
subjects that are not related) then the excel
two-sample t-test procedure is used
to perform these calculations.
NOTE: If your observations are related
across “group” as paired or repeated
measurements, this in an INCORRECT
version of the t-test. For that case, see the
tutorial on the Paired t-test.
Assumptions:
Subjects are randomly assigned to one of two groups.
The distribution of the means by group is normal with
equal variances.
Sample sizes between groups do not have to be equal.
Test:
The hypotheses for the comparison of means from
two independent groups are:
Ho: m1 = m2 (means of the two groups are equal)
Ha: m1 ¹ m2 (means are not equal)

 The test statistic is a student’s t-test with N‑2


degrees of freedom, where N is the total
number of subjects.
 A low p‑value indicates evidence to reject the
null hypothesis in favor of the alternative. In
other words, there is evidence that the means
are not equal.
Group Scores
For example, suppose we are
1 20
interested in comparing SCORES
1 23
across GROUPS, where there are
1 32
two groups. The purpose is to 1 24
determine if the mean SCORE on 1 25
a test is different for the two 1 28
groups tested (i.e., control and 1 27.5
treatment groups). 2 25
2 46
2 56
In the example, GROUP contains
2 45
two values, 1 or 2, indicating
2 46
which group each subject was in. 2 51
The t-test will be performed on 2 34
the values in the variable 2 47.5
(column) named SCORE.
An independent group t-test is
done in two steps:
Step
1
Decide if the variances are equal in both
groups, which determines the type of t-test
to perform (one that assumes equal
variances or one that doesn’t make that
assumption.)
A conservative approach suggested in some
texts is to always assume unequal variances.
 Another approach is to do a statistical test
to determine equality.
Step
2
Depending on your decision about the
equality of variances you either perform
the version of the t-test that assumes
equality of variances or other one that
doesn’t make that assumption.
Determine Equality of
Variance
If you take the conservative approach, skip
this test and proceed to the version of the
t-test that does not assume equality of
variance.
The test for equality of variances is an F-
test.
To do a statistical test to determine equality
of variance, follow these instructions:

1. In Excel,

F-Test
Two
Data
Select Sample
Analysi
Tools for
s
Varianc
e
2. In the F-Test Two Sample for Variance
dialog box:
For the Input
Range for
Variable 1, For the input
range for Leave the
highlight the
Variable 2, other items
seven values
highlight the at their
of Score in
eight values of default
group 1
Score in group selections.
(values from
20 to 27.5). 2 (values from
25 to 47.5).
This dialog box is shown below. Click
OK.
3. The following results are produced by Excel:
F-Test Two-Sample
for Variances
Notice the highlighted
probability p=0.01937.
Variable 1 Variable 2
This is a one-tail p-value
Mean 25.64285714 43.8125 associated with the test
Variance 15.22619048 96.42410714 for equality of variance.
Observations 7 8
Generally, if this value is
less than 0.05 you
df 6 7
assume that the
F 0.157908545 variances are NOT equal.
P(F<=f) one-tail 0.019378053

F Critical one-tail 0.23771837


a. If the variances are assumed to NOT
be equal, proceed with the t-test that
assumes non-equal variances.
b. If the variances are assumed to be
equal, proceed with the t-test that assumes
equal variances.
Determine Equality of
Variance
The process of doing the t-test in Excel is similar
for both the equal and unequal variances case – the
main difference is which version you select from
the menu. Suppose you select the unequal version
of the two-sample t-test – this is how you proceed:
1. t-Test:
Two
Sample
Select Data
assuming
Tools Analysis Unequal
Variance
s
2. In the t-Test Two Sample assuming
Unequal Variances dialog box:

For the Input


Range for For the input
Variable 1, range for
Leave the
highlight the Variable 2,
other items
seven values highlight the
at their
of Score in eight values of
default
group 1 Score in group
selections.
(values from 2 (values from
20 to 27.5). 25 to 47.5).
This dialog box is shown below. Click
OK.
3. The following output is created:
t-Test: Two-Sample Notice that the two
Assuming Unequal sample mean values
Variances
(variance) are 25.64(15.23)
Variable 1 Variable 2 and 43.81(96.42).
Mean 25.64285714 43.8125 The two tailed calculated
Variance 15.22619048 96.42410714 t-statistic is 4.82 and
Observations 7 8 the highlighted p-value for
Hypothesized Mean this test is p=0.001
0
Difference
Df 9
(0.000951012). Since the
t Stat -4.816944724
p-value is less than 0.05,
P(T<=t) one-tail 0.000475506
this provides evidence to
t Critical one-tail 1.833112923 reject the null hypothesis
P(T<=t) two-tail 0.000951012 of equal means.
t Critical two-tail 2.262157158
As an example of how this might
be reported in a journal article:
Methods:
A preliminary test for the equality of variances indicates
that the variances of the two groups were significantly
different F=.157, p=.02.
Therefore, a two-sample t-test was performed that does
not assume equal variances.
Results:
The mean score for group 1 (M=25.64, SD= 3.9021,
N=7) was significantly smaller than the scores
for group 2 (M=42.81, SD=9.82, N= 8.) using the
two-sample t-test for unequal variances, t(9) = -
4.82, p <= 0.001. (Technically, the degrees of
freedom for this unequal variances t-test should
be 9.4 instead of 9, but Excel unfortunately
rounds off the DF, so it is reported incorrectly.
Years ago, it used to be conventional to round
down if you were constructing a table for a
probability level, but most statistical programs
now calculate the correct p-value using a
fractional DF through interpolation.)
Notice that the variance is reported
rather than the standard deviation, as
shown in the Excel results table. You can
calculate the standard deviation using :
Descriptiv
Data
Tools e
Analysis
Statistics
When the variances are assumed equal,
the analysis is similar:
t-Test: Two
Sample
Data
Tools assuming
Analysis Equal
Variances
One Sample t-Test
Because Excel doesn’t have a function for one sample t-Tests,
you can manipulate the program by creating the second
sample which would be the population mean that you are
testing.
A one sample t-Tests looks to see if the sample mean is equal
to the population mean.
You are only given one sample, and then the send second data
set would be the population mean that you chose.
Two Tail Test

Two-tailed test allots half of your alpha to


testing the statistical significance in one
direction and half of your alpha to testing
statistical significance in the other
direction.
This means that .025 is in each tail of
the distribution of your test statistic.
When using a two-tailed test, regardless of
the direction of the relationship you
hypothesize, you are testing for the possibility
of the relationship in both directions.
For example, we may wish to compare the
mean of a sample to a given value x using a t-
test. Our null hypothesis is that the mean is
equal to x. A two-tailed test will test both if
the mean is significantly greater than x and if
the mean significantly less than x. The mean
is considered significantly different from x if
the test statistic is in the top 2.5% or bottom
2.5% of its probability distribution, resulting
in a p-value less than 0.05.
One-Tailed Tests
If you are using a significance level of .05, a one-tailed
test allots all of your alpha to testing the statistical
significance in the one direction of interest. This means
that .05 is in one tail of the distribution of your test
statistic.
When using a one-tailed test, you are testing for the
possibility of the relationship in one direction and
completely disregarding the possibility of a relationship
in the other direction.
Let's return to our example comparing the
mean of a sample to a given value x using a t-
test. Our null hypothesis is that the mean is
equal to x. A one-tailed test will test either if
the mean is significantly greater than x or if
the mean is significantly less than x, but not
both. Then, depending on the chosen tail, the
mean is significantly greater than or less
than x if the test statistic is in the top 5% of its
probability distribution or bottom 5% of its
probability distribution, resulting in a p-value
less than 0.05. The one-tailed test provides
more power to detect an effect in one direction
by not testing the effect in the other direction.

You might also like