You are on page 1of 48

TEST FOR TWO

RELATED SAMPLES

PA 303
Ramy Lloyd L. Lotilla, EDD
The paired sample t-test, sometimes called the
dependent sample t-test, is a statistical procedure
used to determine whether the mean difference
between two sets of observations is zero.

In a paired sample t-test, each subject or entity is


measured twice, resulting in pairs of observations.

Common applications of the paired sample t-test


include case-control studies or repeated-measures
designs.

PA 303
The Paired Samples t Test compares the means of two
measurements taken from the same individual, object, or
related units. These "paired" measurements can represent things
like:
 A measurement taken at two different times (e.g., pre-test
and post-test score with an intervention administered
between the two time points)

 A measurement taken under two different conditions (e.g.,


completing a test under a "control" condition and an
"experimental" condition)

 Measurements taken from two halves or sides of a subject or


experimental unit (e.g., measuring hearing loss in a subject's
left and right ears).
PA 303
The purpose of the test is to determine
whether there is statistical evidence
that the mean difference between
paired observations is significantly
different from zero. The Paired
Samples t Test is a parametric test.

PA 303
This test is also known as:
Dependent t Test
Paired t Test
Repeated Measures t Test

The variable used in this test is known as:


Dependent variable, or test variable (continuous),
measured at two different times or for two related
conditions or units.

PA 303
Common Uses
The Paired Samples t Test is commonly used to test the following:

 Statistical difference between two time points

 Statistical difference between two conditions

 Statistical difference between two measurements

 Statistical difference between a matched pair

PA 303
Data Requirements

 Your data must meet the following requirements:


 Dependent variable that is continuous (i.e., interval or ratio level)
 Note: The paired measurements must be recorded in two separate variables.
 Related samples/groups (i.e., dependent observations)
 The subjects in each sample, or group, are the same. This means that the subjects
in the first group are also in the second group.
 Random sample of data from the population
 Normal distribution (approximately) of the difference between the paired
values
 No outliers in the difference between the two related groups

PA 303
Hypotheses
The hypotheses can be expressed in two different ways that express the same
idea and are mathematically equivalent:

 H0: µ1 = µ2 ("the paired population means are equal")


H1: µ1 ≠ µ2 ("the paired population means are not equal")
OR
 H0: µ1 - µ2 = 0 ("the difference between the paired population means is equal
to 0")
H1: µ1 - µ2 ≠ 0 ("the difference between the paired population means is not
0")

where
 µ1 is the population mean of variable 1, and
 µ2 is the population mean of variable 2.

PA 303
Test Statistic
The test statistic for the Paired Samples t Test, denoted t, follows the same formula as
the one sample t test.

or

The calculated t value is then compared to the critical t value with df = n - 1 from
the t distribution table for a chosen confidence level. If the calculated t value is greater
than the critical t value, then we reject the null hypothesis (and conclude that the
means are significantly different).
x¯diff = Sample mean of the differences
n= Sample size (i.e., number of observations)
sdiff= Sample standard deviation of the differences
sx¯ = PA 303Estimated standard error of the mean (s/sqrt(n))
Data Set-Up

 Data should include two continuous numeric variables


(represented in columns) that will be used in the analysis.
 The two variables should represent the paired variables for
each subject (row). If your data are arranged differently (e.g.,
cases represent repeated units/subjects), simply restructure
the data to reflect this format.

PA 303
HOW TO RUN A
PAIRED SAMPLES T TEST
IN SPSS?

PA 303
To Run a Paired Samples t Test in SPSS

To run a Paired Samples t Test in SPSS,


click Analyze > Compare Means > Paired-Samples T Test.

PA 303
To Run a Paired Samples t Test in SPSS
The Paired-Samples T Test window opens where you will
specify the variables to be used in the analysis. All of the
variables in your dataset appear in the list on the left side.
Move variables to the right by selecting them in the list and
clicking the blue arrow buttons. You will specify the paired
variables in the Paired Variables area.
A Pair: The “Pair” column represents the number of Paired
Samples t Tests to run. You may choose to run multiple Paired
Samples t Tests simultaneously by selecting multiple sets of
matched variables. Each new pair will appear on a new line.
B Variable1: The first variable, representing the first group
of matched values. Move the variable that represents the
first group to the right where it will be listed beneath the
“Variable1” column.
C Variable2: The second variable, representing the
second group of matched values. Move the variable that
represents the second group to the right where it will be
listed beneath the “Variable2” column.
D Options: Clicking Options will open a window where you
can specify the Confidence Interval Percentage and how
the analysis will address Missing Values (i.e., Exclude cases
analysis by analysis or Exclude cases listwise).
Click Continue when you are finished making specifications.
PA 303
To Run a Paired Samples t Test in SPSS

•Setting the confidence interval percentage does not have any impact on the calculation
of the p-value.
•If you are only running one paired samples t test, the two "missing values" settings will
produce the same results. There will only be differences if you are running 2 or more
paired samples t tests. (This would look like having two or more rows in the main Paired
Samples T Test dialog window.)

Click OK to run the Paired Sample t Test


PA 303
Example # 1
In this example 10 students saw five
pictures of attractive people and
five pictures of unattractive people.
For each picture, the students rated
the friendliness of the person on a 10
point scale (where 1 was very
unfriendly and 10 was very friendly.)
The mean friendliness rating for the
attractive and unattractive pictures
was calculated. The researcher
wants to know whether the
attractiveness of the picture affects
the perceived friendliness of the
person.

PA 303
Step 1: State the null and Alternative means is equal to 0")
Hypotheses H1: µ1 - µ2 ≠ 0 ("the difference
Ho: There is no significant difference between the paired population
in the perceived friendliness for means is not 0")
attractive and unattractive
pictures of people. Step 2: Identity the test procedure
Ha: There is a significant difference in Test Procedure: Paired Sample t-test
the perceived friendliness for
attractive and unattractive Step 3: Identify the level of significance
pictures of people. a= 0.05
 H0: µ1 = µ2 ("the paired population
means are equal") Step 4: Write the Decision Rule
H1: µ1 ≠ µ2 ("the paired population
means are not equal") Reject Ho if the sig < a; Otherwise, fail
OR to reject Ho.
 H0: µ1 - µ2 = 0 ("the difference
between
PA 303 the paired population Step 5: Solve
RUNNING THE TEST
Click Analyze > Compare Means > Paired-Samples T Test... on the top menu, as shown
below:

PA 303
Transfer the variables into the Paired Variables: box. There are two ways to do this: (a) click
on both variables whilst holding down the shift key (which highlights them) and then pressing
the Right arrow button; or (b) drag-and-drop each variable separately into the boxes. You
will end up with a screen similar to the one shown below:

Note:
button shifts the pair of variables you
have highlighted down one level.

button shifts the pair of variables you


have highlighted up one level.

button shifts the order of the variables


within a variable pair.

PA 303
If you need to change the confidence level limits or exclude cases, click on the Options
button. You will be presented with the Paired-Samples T Test: Options dialogue box, as
shown below:

Click on the button. You will be returned to the Paired-Samples T Test dialogue box.

Click on the button.


PA 303
OUTPUT OF
PAIRED SAMPLE T-TEST
IN SPSS
PA 303
OUTPUT OF PAIRED SAMPLE T-TEST IN SPSS
There are three tables appear as an
otput: Paired Sample Statistics Table
The first table, titled Paired Samples Statistics, gives
 Paired Samples Statistics
univariate descriptive statistics (mean, sample size,
 Paired Samples Correlations, standard deviation, and standard error) for each
 Paired Samples Test. variable entered. You could use the results here to
describe the characteristics of the first and second
jumps in your write-up.

PA 303
 This tells us that for the mean friendliness rating for the attractive faces
is 7.100 (mean column and attractive row), the sample standard
deviation (s) is 1.663, and the standard error of the means (sM) is
0.5265 (which should and does equal s / √N = 1.663 / √10). Likewise,
this tells us that for the unattractive faces there were 10 scores (in the
N column of the unattractive row), that the sample mean (𝑋 ) is 5.900
(mean column and the unattractive row), the sample standard
deviation (s) is 1.969, and the standard error of the means (sm) is
0.623 (which should and does equal s / √N = 1.969 / √10).

PA 303
OUTPUT OF PAIRED SAMPLE T-TEST IN SPSS

The second table in the SPSS output is Paired Samples Correlations tells us how
the two conditions relate to one another. This table is not necessary for the
interpretation of the t-test results, so feel free to ignore it at this point!

PA 303
OUTPUT OF PAIRED SAMPLE T-TEST IN SPSS
Paired Samples Test Table
The third table in the SPSS output Paired Samples Test table is where the results of the
dependent t-test are presented. A lot of information is presented here and it is important to
remember that this information refers to the differences between the two jumps (the subtitle
reads "Paired Differences"). As such, the columns of the table labelled "Mean", "Std.
Deviation", "Std. Error Mean" and "95% Confidence Interval of the Difference" refer to the
mean difference between the two jumps and the standard deviation, standard error and 95%
confidence interval of this mean difference, respectively. The last three columns express the
results of the dependent t-test, namely the t-value ("t"), the degrees of freedom ("df") and the
significance level ("Sig. (2-tailed)").

PA 303
OUTPUT OF PAIRED SAMPLE T-TEST IN SPSS
Reading from left to right:

The third table is Paired Samples Test gives the 1. First column: The pair of variables
hypothesis test results. being tested, and the order the
subtraction was carried out. (If you
have specified more than one variable
pair, this table will have multiple rows.)

2. Mean: The average difference


between the two variables.
3 5 7
4 6 8 3. Standard deviation: The standard
2
deviation of the difference scores.
1

4. Standard error mean: The standard


error (standard deviation divided by the
square root of the sample size). Used in
computing both the test statistic and
PA 303
the upper and lower bounds of the
confidence interval.
OUTPUT OF PAIRED SAMPLE T-TEST IN SPSS

Paired Samples Test gives the hypothesis test


results. 5. Confidence Interval for the
Difference: The confidence interval for
the difference between the specified
test value and the sample mean. Does
not have any impact on the
calculation of the p-value.

3 5
6
7
8 6. t: The test statistic (denoted t) for the
2 4
paired T test.
1
7. df: The degrees of freedom for this
test.

8. Sig. (2-tailed): The p-value


PA 303
corresponding to the given test
statistic t with degrees of freedom df.
HOW TO INTERPRET THE KEY
RESULTS FOR PAIRED T-TEST

PA 303
There are two types of significance to consider when interpreting the results of a paired
sample t-test, statistical significance and practical significance.
 Statistical Significance
To determine whether the difference between the population means is statistically
significant, compare the p-value to the significance level. Usually, a significance level
(denoted as α or alpha) of 0.05 works well. A significance level of 0.05 indicates a 5% risk of
concluding that a difference exists when there is no actual difference.
 P-value ≤ α: The difference between the means is statistically significant (Reject Ho)
If the p-value is less than or equal to the significance level, the decision is to reject the null
hypothesis. Use your specialized knowledge to determine whether the difference is practically
significant.
 P-value > α: The difference between the means is not statistically significant (Fail to reject
Ho) If the p-value is greater than the significance level, the decision is to fail to reject the
null hypothesis. You do not have enough evidence to conclude that the difference
between the population means is statistically significant. You should make sure that your
test has enough power to detect a difference that is practically significant.

 Practical Significance
Practical significance depends on the subject matter. It is not uncommon, especially with
large sample sizes, to observe a result that is statistically significant but not practically
significant. In most cases, both types of significance are required in order to draw meaningful
conclusions.
PA 303
Reporting the Output of the Paired T-Test

 You might report the statistics in the following format: t(degrees


of freedom) = t-value, p = significance level.
 In our case this would be: With t(9) = 2.571, p < 0.05, due to the
means of the perceived friendliness and the direction of the t-
value, we can conclude that there was a statistically significant
difference in the perceived friendliness of the person for
attractive and unattractive pictures of people.

PA 303
Example # 2
Research question: Is there a difference in marks following a teaching intervention?
The marks for a group of students before(pre) and after(post) a teaching intervention are
recorded below:
Student Before mark After mark
1 18 22
2 21 25
3 16 17
4 22 24
5 19 16
6 24 29
7 17 20
8 21 23
9 23 19
10 18 20
11 14 15
12 16 15
13 16 18
14 19 26
15 18 18
16 20 24
17 12 18
18 22 25
PA 303
19 15 19
20 17 16
Step 1: State the null and Alternative Hypotheses
Ho: There is no significant difference in means of
Research question: Is there a difference in
before and after marks
marks following a teaching intervention?
Ha: There is a significant difference in means of
The marks for a group of students before and after marks
before(pre) and after(post) a teaching
intervention are recorded below: Step 2: Identity the test procedure
Student Before mark After mark Test Procedure: Paired Sample T-test
1 18 22
2 21 25
3 16 17 Step 3: Identify the level of significance
4 22 24 a= 0.05
5 19 16
6 24 29
7 17 20
8 21 23 Step 4: Write the Decision Rule
9 23 19
10 18 20 Reject Ho if the sig < a; Otherwise, fail to reject
11 14 15
12 16 15 Ho.
13 16 18
14 19 26
15 18 18
16 20 24 Step 5: Solve
17 12 18
18 22 25
19 15 19
20 PA 303
17 16
Solving Using the SPSS Software
Procedure: Analyze > Compare Means > Paired Sample T-test

PA 303
Solving Using the SPSS Software

 Click Ok

Select your paired


variables.
Click Ok

PA 303
Solving Using the SPSS Software

Decision: The null hypotheses is rejected, since p <0.05 (in fact p =0.004)
Conclusion: With t (19) = 3.3231, p < .05, there is a strong evidence that the teaching intervention improves
marks of the students.
PA 303 In this data set, it improved marks, on average, by approximately 2 points. Of course, if we
were to be take other sample marks , we could get a ‘mean paired difference’ in marks different from 2.05.
Activity 9

Using test_scores.sav, is there a difference in pretest and posttest scores of the


students following a teaching intervention? Use α=0.05
1. State the null and alternative hypothesis
2. Identify the test procedure
3. Identify the level of significance
4. Write the decision rule
5. Solve (show paired samples statistics, paired samples correlations, paired
samples test)
6. Write the decision
7. Write the conclusion

PA 303
Activity 10
A researcher is interested in infants' attention to their mothers' voices. The Day 1 Day 7
research wants to know if the infant's attention increases to the mother's voice
after spending the first week of life with the mother. The researcher selects 10 5 8
full-term infants with normal health who experienced uncomplicated 6 9
deliveries and tested the number of seconds that the infant oriented in the
direction of the mother's voice on Day 1 and on Day 7 after delivery. These
fictional data appear below. Use an α=0.01
2 7
 State the null and alternative hypothesis
7 8
 Identify the test procedure 6 9
 Identify the level of significance 5 8
 Write the decision rule 8 7
 Solve (show paired samples statistics, paired samples correlations, paired 3 9
samples test)
 Write the decision
6 10
 Write the conclusion 7 6

PA 303
Wilcoxon Signed Rank
Test
Ramy Lloyd Lotilla, EDD

PA 303
Wilcoxon Signed Rank Test (Non-parametric
equivalent to paired t-test)

A Wilcoxon test is used when we have two interval or ratio level


variables measured for a set of observations and we want to test if the
distribution is different for the two variables but we are unable to assume
normality for one or both of the variables. It can also be to compare
ordered categorical variables. It is the nonparametric equivalent of the
paired t-test but unlike the t-test, it tests differences in the median rather
than the mean. The test does not assume any distribution for the two
variables.

PA 303
Wilcoxon Paired Signed-Rank Test in
SPSS
Exercise 1: Twelve adult males were put on a liquid diet in a weight-reducing
plan. Weights were recorded before and after the diet. The data are shown
in the table below. Use the Wilcoxon Signed-Rank Test to ascertain if the plan
was successful. Use α=0.05.

PA 303
Research question: Is the weight-reducing
plan successful, that is, is there a reduction in
the weights of the participants following a
weight-reducing plan? Step 2: Identity the test procedure
Test Procedure: Wilcoxon Signed
Rank Test
Step 1: State the null and alternative Hypotheses
Ho: There is no reduction in the weights of the
participants following the weight-reducing plan Step 3: Identify the level of significance
Ha: There is a reduction in the weights of the α = 0.05
participants following the weight-reducing plan
Step 4: Write the Decision Rule
Reject Ho if the sig < α; Otherwise, fail to reject
Ho.

Step 5: Solve

PA 303
Procedure: Analyze > Nonparametric Tests > Legacy Dialogs > 2 Related Samples

PA 303
Select your paired
variables.
Click Ok

PA 303
p-value = ½ Asymp.Sig (2-tailed) = ½(.6240) = .3120
[If the test were two-tailed, the p-value would be Asymp. Sig. (2-tailed).]
Decision: SincePAp303>0.05, we fail to reject the null hypothesis.
Conclusion: With Z = .490, p > .05, there is not enough evidence to conclude that the weight-reducing plan was
successful
Activity 11

A study assessed the effectiveness of a new drug designed to reduce


repetitive behaviors in children affected with autism. A total of 8 children with
autism enroll in the study and the amount of time that each child is engaged
in repetitive behavior during three hour observation periods are measured
both before treatment and then again after taking the new medication for a
period of 1 week. The data are shown below. Is there is a difference in
repetitive behaviors in children after 1 week of treatment as compared to
before? Use Wilcoxon Signed Rank Test with α = 0.05

PA 303
After 1
Before
Child Week of
Treatment
Treatment
1 85 75
2 70 50
3 40 50
4 65 40
5 80 20
6 75 65
7 55 40
8 20 25
PA 303
Activity 12

A study is run to evaluate the effectiveness of an exercise program in reducing


systolic blood pressure in patients with pre-hypertension (defined as a systolic
blood pressure between 120-139 mmHg or a diastolic blood pressure between
80-89 mmHg). A total of 15 patients with pre-hypertension enroll in the study,
and their systolic blood pressures are measured. Each patient then
participates in an exercise training program where they learn proper
techniques and execution of a series of exercises. Patients are instructed to do
the exercise program 3 times per week for 6 weeks. After 6 weeks, systolic
blood pressures are again measured. The data are shown below. Is there is a
difference in systolic blood pressures after participating in the exercise
program as compared to before? Use Wilcoxon Signed Rank Test with α =
0.05

PA 303
Systolic Blood Systolic Blood
Pressure Pressure
Patient
Before Exercise After Exercise
Program Program
1 125 118
2 132 134
3 138 130
4 120 124
5 125 105
6 127 130
7 136 130
8 139 132
9 131 123
10 132 128
11 135 126
12 136 140
PA 303
13 128 135
14 127 126
Good luck!!!
PA 303

You might also like