Vous êtes sur la page 1sur 113

t test for two dependent samples

Ivan Jacob Agaloos Pesigan

1
t test for two dependent samples

(Parametric test employed with


interval/ratio data)

2
Outline
Hypothesis evaluated with test
Relevant background information
Example
Null and alternative hypotheses
Test computations
Interpretation of the test results
Eect size
Power
Confidence Interval
t test for two dependent samples in SPSS
t test for two dependent samples in Excel
t test for two dependent samples in R
t test for two dependent samples in STATISTICA
Reporting the results of a t test for two dependent samples

3
Hypothesis evaluated with test

t test for two dependent samples

4
Hypothesis evaluated with test
Do two dependent samples represent two
populations with dierent mean values?

5
Relevant background information

t test for two dependent samples

6
Relevant background information
The t test for two dependent samples, which is
employed in a hypothesis testing situation
involving two dependent samples, is one of a
number of inferential statistical tests that are
based on the t distribution
Throughout the discussion of the t test for two
dependent samples, the term experimental
conditions will also be employed to represent
the dependent samples employed in a study.
Relevant background information
In a dependent samples design, each subject
either serves in all of the k (where k 2)
experimental conditions, or else is matched
with a subject in each of the other (k 1)
experimental conditions. In designs that are
evaluated with the t test for two dependent
samples, the value of k will always equal 2.
Relevant background information
In conducting the t test for two dependent
samples, the means of the two experimental
conditions (represented by the notations M1
(or X-bar 1) and M2 (or X-bar 2) are employed
to estimate the values of the means of the
populations (1 and 2) the conditions
represent
Relevant background information
If the result of the t test for two dependent
samples is significant, it indicates the
researcher can conclude there is a high
likelihood that the two experimental
conditions represent populations with dierent
mean values.

10
Relevant background information
It should be noted that the t test for two
dependent samples is the appropriate test to
employ for contrasting the means of two
dependent samples when the values of the
underlying population variances are unknown
In instances where the latter two values are
known, the appropriate test to employ is the z
test for two dependent samples

11
Relevant background information
The t test for two dependent samples is employed with interval/
ratio data, and is based on the following assumptions:
a. The sample of n subjects has been randomly selected from
the population it represents;
b. The distribution of data in the underlying populations each
of the experimental conditions represents is normal; and
c. The third assumption, which is referred to as the
homogeneity of variance assumption, states that the
variance of the underlying population represented by
Condition 1 is equal to the variance of the underlying
population represented by Condition 2 (i.e., 21 = 22).

12
Relevant background information
It should be noted that the t test for two
dependent samples is more sensitive to
violation of the homogeneity of variance
assumption than is the t test for two
independent samples. If any of the
aforementioned assumptions of the t test for
two dependent samples are saliently violated,
the reliability of the test statistic may be
compromised.
13
Relevant background information
When a study employs a dependent samples design, the following
two issues related to experimental control must be taken into
account:
a. In a dependent samples design in which each subject serves
in both experimental conditions, it is essential that the
experimenter control for order eects (also known as
sequencing or carryover eects). An order eect is where an
obtained dierence on the dependent variable is a direct
result of the order of presentation of the experimental
conditions, rather than being due to the independent
variable manipulated by the experimenter. Order eects can
be controlled through the use of a technique called
counterbalancing
14
Relevant background information
b. When a dependent samples design
employs matched subjects, within each pair
of matched subjects each of the two
subjects must be randomly assigned to one
of the two experimental conditions. Non
random assignment of subjects to the
experimental conditions can compromise
the internal validity of a study.

15
Example

t test for two dependent samples

16
Example
A psychologist conducts a study to determine whether or not people exhibit more
emotionality when they are exposed to sexually explicit words than when they are
exposed to neutral words. Each of ten subjects is shown a list of 16 randomly arranged
words, which are projected onto a screen one at a time for a period of five seconds.
Eight of the words on the list are sexually explicit and eight of the words are neutral. As
each word is projected on the screen, a subject is instructed to say the word softly to
himself or herself: As a subject does this, sensors attached to the palms of the subjects
hands record galvanic skin response (GSR), which is used by the psychologist as a
measure of emotionality. The psychologist computes two scores for each subject, one
score for each of the experimental conditions: Condition 1: GSR/Explicit The average
GSR score for the eight sexually explicit words; Condition 2: GSR/Neutral The
average GSR score for the eight neutral words. The GSR/Explicit and the GSR/
Neutral scores of the ten subjects follow. (The higher the score, the higher the level of
emotionality.) Subject 1 (9, 8); Subject 2 (2, 2); Subject 3 (1, 3); Subject 4 (4, 2); Subject
5 (6, 3); Subject 6 (4, 0); Subject 7(7, 4); Subject 8 (8, 5); Subject 9 (5, 4); Subject 10
(1,0). Do subjects exhibit dierences in emotionality with respect to the two categories
of words?
17
Null and alternative hypotheses

t test for two dependent samples

18
Null and alternative hypotheses
H0: 1 = 2 or 1 2 = 0
The mean of the population Condition 1 represents equals the
mean of the population Condition 2 represents.
H1: 1 2 or 1 2 0
The mean of the population Condition 1 represents does not
equal the mean of the population Condition 2 represents. This is
a nondirectional alternative hypothesis and it is evaluated with a
two-tailed test. In order to be supported, the absolute value of t
must be equal to or greater than the tabled critical t we tailed t
value at the pre-specified level of significance. Thus, either a
significant positive t value or a significant negative t value will
provide support for this alternative hypothesis.

19
Null and alternative hypotheses
H1: 1 > 2 or 1 2 > 0
The mean of the population Condition 1
represents is greater than the mean of the
population Condition 2 represents. This is a
directional alternative hypothesis and it is
evaluated with a one-tailed test. It will only be
supported if the sign of t is positive, and the
absolute value of t is equal to or greater than
the tabled critical one-tailed t value at the pre-
specified level of significance.)
20
Null and alternative hypotheses
H1: 1 < 2 or 1 2 < 0
The mean of the population Condition I represents
is less than the mean of the population Condition
2 represents. This is a directional alternative
hypothesis and it is evaluated with a one-tailed
test. It will only be supported if the sign of t is
negative, and the absolute value of t is equal to or
greater than the tabled critical one-tailed t value at
the pre-specified level of significance.)

21
Null and alternative hypotheses
Note: Only one of the above noted alternative
hypotheses is employed. If the alternative
hypothesis the researcher selects is supported,
the null hypothesis (H0) is rejected.

22
Test computations

t test for two dependent samples

23
Mean plot with 95% CI

6
5
GSR

4
3
2

n=10 n=10

Condition 1 - Explicit Condition 2 - Neutral

Condition 24
Boxplot of GSR scores

8
6
GSR

4
2
0

Condition 1 - Explicit Condition 2 - Neutral

Experimental conditions 25
Test computations
As is the case with an independent samples design, in
a dependent samples design the homogeneity of
variance assumption evaluates whether or not there is
evidence to indicate that an inequality exists between
the variances of the populations represented by the
two experimental conditions.
The null and alternative hypotheses employed in
evaluating the homogeneity of variance assumption
are as follows:

26
Test computations
H0: 21 = 22
The variance of the population Condition 1 represents
equals the variance of the population Condition 2
represents.
H1: 21 22
The variance of the population Condition 1 represents
does not equal the variance of the population Condition
2 represents. This is an nondirectional alternative
hypothesis and it is evaluated with a two-tailed test. In
evaluating the homogeneity of variance assumption, a
nondirectional alternative hypothesis is always employed.
27
Test computations
It should be noted that the FMax is not
appropriate to use with a dependent samples
design, since it does not take into account the
correlation between subjects scores in the two
experimental condition (i.e., correlation
between X1 and X2).

t=
( s2
L
s2
S ) (n 2)
2 2
4s s 1 r
L S ( 2
X 1X 2 ) 28
t=
( sL2 sS2 ) (n 2)
2 2
4s s 1 r
L S ( 2
X 1X 2 )
sL2 = Larger of the estimated population variances
2
s = Smaller of the estimated population variances
S
2
r
X 1X 2
= Pearson correlation between Condition 1
and Condition 2 squared

29
Condition 1 Condition 2
X1 X21 X2 X22 X1X2
Subject 1 9 81 8 64 72
Subject 2 2 4 2 4 4
Subject 3 1 1 3 9 3
Subject 4 4 16 2 4 8
Subject 5 6 36 3 9 18
Subject 6 4 16 0 0 0
Subject 7 7 49 4 16 28
Subject 8 8 64 5 25 40
Subject 9 5 25 4 16 20
Subject 10 1 1 0 0 0
2 2
X 1
= 47 X 1
= 293 X 2
= 31 X 2
= 147 X X
1 2
= 193

30
X 47
1
MX = X 1 = = = 4.7
1
n 10
X 2 31
MX = X 2 = = = 3.1
2
n 10
2 2

2(
X n
X ) 1
293
( 47 )
1
2
s = = 10 = 8.01
X1
n1 10 1
2

2(
X n
X ) 2
( 39)
2

2 347
2
s =
X2
= 10 = 5.66
X2
n1 10 1
31
X X
( X ) ( X )
1 2
1 2
rX X = n
1 2
# 2 &# 2 &
%
X 2

( X ) 1 (%
X 2

( X ) 2 (
% 1
n (% 2
n (
%$ ('%$ ('

193
( 47 ) ( 31)
rX X = 10 = .78
1 2
# 2 &# 2&
% ( )
47 (% 31 ( ( )
%293 10 (%147 10 (
%$ ('%$ (' 32
t=
( 2
s
L
2
-s
S ) (n - 2)
2 2
4s s 1 - r
L S ( 2
X 1X 2 )
t=
(8.01 - 5.66) (10 2) = .79
" 2 %
4 ( 8.01) ( 5.66) $ 1 (.78) '
# &
df = n 2 = 10 2 = 8

33
df = 8 blue = .05 two tailed

red = .01 two tailed

34
tobtained = .79
= .05 two-tailed
tcritical = 2.306
= .01 two-tailed
tcritical = 3.355
tobtained < tcritical = variances are equal
35
Test computations
Now that the assumption of homogeneity of
variances is met, we can proceed with the t test
for two dependent samples analysis.

36
Condition 1 Condition 2
X1 X2 D D2
Subject 1 9 8 1 1
Subject 2 2 2 0 0
Subject 3 1 3 2 4
Subject 4 4 2 2 4
Subject 5 6 3 3 9
Subject 6 4 0 4 16
Subject 7 7 4 3 9
Subject 8 8 5 3 9
Subject 9 5 4 1 1
Subject 10 1 0 1 1
2
X1 = 47 X2 = 31 D = 2 = 54
D

X X2 31
D+ = 18
1 47
MX = = = 4.7 MX = = = 3.1 D = 16
1
n 10 2
n 10
37
Test computations
Note that there are n = 10 subjects, and that there
is a total of 2n = (2)(10) = 20 scores, since each
subject has two scores.
The score of a subject in the column labeled X1 is
the average GSR score of the subject for the eight
sexually explicit words (Condition I), while the
score of a subject in the column labeled X2 is the
average GSR score of the subject for the eight
neutral words (Condition 2)

38
Test computations
Dierence score for each subject (designated
by the notation D) is computed by subtracting
a subjects X2 score from his XI score (i.e., D =
XI X2).
D2 score for each subject is obtained by
squaring a subjects D score.

39
Test computations
The summary value D = 16 is obtained by adding
D+ = 18, the sum of the positive dierence scores
(i.e., all those dierence scores with a + sign), and D
= 2, the sum of the negative dierence scores (i.e.,
all those dierence scores with a sign)
Take note of the fact that whenever X1 > X2 (and
consequently M1 > M2), the value D will be a
positive number, whereas whenever X1 < X2 (and
consequently M1 < M2), the value D will be a
negative number
40
MD D MD
t= =
sM sM
D D

MD represents the mean of the


difference scores
D represents the null value of
no difference between
population conditions
sM represents the standard error
D

of the mean difference 41


D 16
MD = = = 1.6
n 10
2 2
(
D n
D)
2
54
( 16)
sD = = 10 = 1.78
n1 10 1
sD 1.78
sM = = = .56
D
n 10
MD 1.6
t= = = 2.86
sM .56
D
42
Sampling distribution of the difference between means

0.4
Distributions
Note:
df=1 Standard
df=3
df=8
error of the
df=30 dierence
0.3

normal
between the
means is
estimated
Density

using sample
0.2

data

sM
D
0.1

estimated
M M
D D
0.0

-4 -2 0 2 4

Mean 1 - M
Mean 2
D 43
Interpretation of the test results

t test for two dependent samples

44
Interpretation of the test results
The obtained value t = 2.86 is evaluated with
Table of Students t Distribution. The degrees
of freedom for the t test for two dependent
samples are computed as follows:
df = n 1 = 10 1 = 9
notice the difference between df for t test for
two independent samples and the df for t test
for two dependent samples
45
blue = .05 two tailed

red = .01 two tailed

df = 9 yellow = .05 one tailed

green = .01 one tailed
46


Interpretation of the test results
Student's t distribution

0.4
Distributions
df=9
normal
0.3
Density

0.2
0.1

tcri8cal = 2.26
tobtained = 2.86
0.0

-4 -2 0 2 4

x value

For a nondirectional hypothesis with = .05


Reject the H0
47
Interpretation of the test results
Student's t distribution

0.4
Distributions
df=9
normal
0.3
Density

0.2
0.1

tcri8cal = 3.25
tobtained = 2.86
0.0

-4 -2 0 2 4

x value

For a nondirectional hypothesis with = .01


Retain the H0
48
Interpretation of the test results
The following guidelines are employed in
evaluating the null hypothesis for the t test for
two dependent samples.
a. If the nondirectional alternative hypothesis
Hl: l 2 is employed, the null hypothesis
can be rejected if the obtained absolute
value of t is equal to or greater than the
tabled critical two-tailed value at the pre-
specified level of significance.

49
Interpretation of the test results
b. If the directional alternative hypothesis Hl:
l > 2 is employed, the null hypothesis can
be rejected if the sign of t is positive, and
the value of t is equal to or greater than the
tabled critical one-tailed value at the pre-
specified level of significance.

50
Interpretation of the test results
c. If the directional alternative hypothesis Hl:
l < 2 is employed, the null hypothesis can
be rejected if the sign of t is negative, and
the absolute value of t is equal to or greater
than the tabled critical one-tailed value at
the pre-specified level of significance.

51
Interpretation of the test results
Employing the above guidelines, the following
conclusions can be reached. The nondirectional
alternative hypothesis H1: l 2 is supported at
the .05 level, since the computed value t = 2.86 is
greater than the tabled critical two-tailed value t.
05 = 2.26. The latter alternative hypothesis,
however, is not supported at the .0 1 level, since t
= 2.86 is less than the tabled critical two-tailed
value t.01 = 3.25.
52
Interpretation of the test results
The directional alternative hypothesis Hl: l >
2 is supported at both the .05 and .0l levels,
since the obtained value t = 2.86 is a positive
number which is greater than the tabled
critical one-tailed values t.05 = 1.83 and t.01 =
2.82.
Note that when the directional alternative
hypothesis Hl: l > 2 is supported, it is
required that M1 > M2.

53
Interpretation of the test results
The directional alternative hypothesis Hl: l < 2 is not
supported, since the obtained value t = 2.86 is a
positive number. In order for the directional
alternative hypothesis Hl: l < 2 to be supported, the
computed value of t must be a negative number (as
well as the fact that the absolute value of t must be
equal to or greater than the tabled critical one-tailed
value at the pre-specified level of significance). In
order for the data to be consistent with the directional
alternative hypothesis Hl: l < 2 it is required that M1
< M2.
54
Interpretation of the test results
A summary of the analysis of the example with
the t test for two dependent samples follows: It
can be concluded that the average GSR
(emotionality) score for the sexually explicit
words is significantly higher than the average
GSR score for the neutral words. This result can
be summarized as follows (if a = .05 is
employed): t(9) = 2.86, p < .05.

55
Eect size

t test for two independent samples

56
critical t = 2.2622

0.3

0.2

0.1
2
0
-4 -3 -2 -1 0 1 2 3 4

57
MX M MX X
z test Cohen's d = =
X X
MX M MX X
single sample t test Cohen's d = =
sX sX
MX MX
t test for two independent samples Cohen's d = 1 2

sp2
MD MD
t test for two dependent samples Cohen's d = =
sD2 sD
1.6
Cohen's d = = .90
1.78
58
Cohen's Standard Eect Size Percentile Standing Percent of Nonoverlap

2 97.7 81.10%
1.9 97.1 79.40%
1.8 96.4 77.40%
1.7 95.5 75.40%
1.6 94.5 73.10%
1.5 93.3 70.70%
1.4 91.9 68.10%
1.3 90 65.30%
1.2 88 62.20%
1.1 86 58.90%
1 84 55.40%
0.9 82 51.60%
LARGE 0.8 79 47.40%
0.7 76 43.00%
0.6 73 38.20%
MEDIUM 0.5 69 33.00%
0.4 66 27.40%
0.3 62 21.30%
SMALL 0.2 58 14.70%
0.1 54 7.70% 59
0 50 0%
Eect size
Cohen (1988) hesitantly defined eect sizes as small, d = .2, medium, d = .5, and
large, d = .8, stating that there is a certain risk in inherent in oering conventional
operational definitions for those terms for use in power analysis in as diverse a field of
inquiry as behavioral science (p. 25). Eect sizes can also be thought of as the average
percentile standing of the average treated (or experimental) participant relative to the
average untreated (or control) participant. An ES of 0.0 indicates that the mean of the
treated group is at the 50th percentile of the untreated group. An ES of 0.8 indicates
that the mean of the treated group is at the 79th percentile of the untreated group. An
eect size of 1.7 indicates that the mean of the treated group is at the 95.5 percentile of
the untreated group. Eect sizes can also be interpreted in terms of the percent of
nonoverlap of the treated group's scores with those of the untreated group, see Cohen
(1988, pp. 21-23) for descriptions of additional measures of nonoverlap. An ES of 0.0
indicates that the distribution of scores for the treated group overlaps completely with
the distribution of scores for the untreated group, there is 0% of nonoverlap. An ES of
0.8 indicates a nonoverlap of 47.4% in the two distributions. An ES of 1.7 indicates a
nonoverlap of 75.4% in the two distributions.

60
Mean plot with 95% CI

6
5
GSR

4
3
2

n=10 n=10

Condition 1 - Explicit Condition 2 - Neutral

Condition 61
GSR Explicit per participant

9
8
7
6
GSR

5
4
3
2
1

1 2 3 4 5 6 7 8 9 10

Participant
62
GSR Neutral per participant

8
7
6
5
GSR

4
3
2
1
0

1 2 3 4 5 6 7 8 9 10

Participant
63
Mean plot with 95% CI

6
5
GSR

4
3
2

n=10 n=10

Condition 1 - Explicit Condition 2 - Neutral

Condition 64
Explicit

2 4 6 8 10

2
4

Subject
6
8
10
Neutral

2 4 6 8 10

2
4

Subject
6
8
10
Scatter plot of the two dependent samples

8
7
6
5
GSR Neutral

4
3
2
1
0

1 2 3 4 5 6 7 8 9

GSR Explicit 66
2
2
r = 2
t
=
( 2.86 )
2
= .48
2
t + df ( 2.86 ) + 9
2
) ,
+ .
+
+ X1X2
(
X1 X 2 )( .
.
)
rX21X2 =+ n 2
. = (.78) = .61
+ # 2 &# 2&
.
+ ( )
% X 2 1 (% X 2 2 ( .
X X ( )
++ % 1 n ( % 2
n ( ..
* %$ ('%$ (' -

Using the value of the calculated t will underestimate the eect size because of the correlation
between the two conditions. Calculating the Pearson correlation r and squaring it will produce a
more accurate measure of eect size.
67
68
Eect size

Size of Eect /
r r2 (% of variance)
Magnitude

small 0.1 0.01 (1%)

medium 0.3 0.09 (9%)

large 0.5 0.25 (25%)


69
Power

t test for two dependent samples

70
Power
critical t = 2.2622

0.3

0.2

0.1

2
0
-4 -3 -2 -1 0 1 2 3 4

Nondirectional Hypothesis
Cohens d = .90
= .05
n = 10
= .28
1- (power) = .72
71
Power

t tests - Means: Difference between two dependent means (matched pairs)


Tail(s) = Two. Effect size dz = 0.9

0.8
Power (1- err prob)

err prob
0.6
= 0.1

0.4 = 0.05

0.2

0
5 6 7 8 9 10 11 12 13 14 15
Total sample size

Relationship of sample size and power:


The larger the sample size, the greater the power obtained.For an alpha level of .05, the sample
size needed to get the recommended power of .80 is 12.
72
Power

critical t = 2.201

0.3

0.2

0.1
2
0
-3 -2 -1 0 1 2 3 4 5 6

Nondirectional Hypothesis
Cohens d = .90
= .05
n = 12
= .19
1- (power) = .81
73
Confidence interval

t test for two dependent samples

74
Confidence interval
( )
MD
lower
(
= MD - tcritical sM
D
) Notice that the
interval estimate did
not contain the null
(
= 1.6 - 2.262.56 ) value of 0. This means
that given a sample
size of n = 10, means
= 1.6 - 1.26672 of the two
populations that the
= .33 two samples represent
are not equal.
( )
MD
upper
(
= MD + tcritical sM
D
) = .05
= 1.6 + 1.26672 nondirectional

= 2.87
95% CI = .33 < M < 2.87
D
75
t test for two dependent samples
in SPSS
t test for two dependent samples

76
Define your variables in the Variable View
Participant for Participant ID number, Condition_1 for GSR/Explicit scores,
and Condition_2 for GSR/Neutral
77
Encode your data in the Data View
78
Go to Analyze / Compare Means / Independent-Samples T Test

79
Move Condition_1 to Variable1 and Condition_2 to Variable2

80
See single-sample t test slides for information on Options
81
The first table displays the descriptive statistics (sample
size, mean, and standard deviation) and the estimated
standard error of the mean (sM) per group.The second
table displays paired samples correlations (sample size,
Pearson correlation, and p value). The third table displays
the paired samples test. The first section displays paired
dierences (Mean dierence, standard deviation of the
dierence, standard error of the dierence between means,
95% CI of the dierence). The last three columns display
the results of the t test for two dependent samples. The
result is evaluated by looking at the p value. If p < we
reject the null. Otherwise, we retain the null. In this case,
since p = .019, we reject the null.

82
t test for two dependent samples
in Excel
t test for two dependent samples

83
To perform a t test for two dependent samples go to Data /Data Analysis
84
Select t-test: Paired Two Sample for Means and click OK.

85
Click on the buttons above to properly reference you data
for Variable 1 (Condition_1) and Variable 2 (Condition_2)
86
87
88
Check Labels if you wish to use the first cells in your range for each group as a
variable label. You can define the null value (the default setting is zero). You can
define the alpha level (the default value is .05). You can customize the way the
results are outputted. The default setting is fine for this analysis. Click OK to run
the analysis.
89
The results of the analysis are displayed in a new spreadsheet.

The t test is significant using a nondirectional (two-tailed) test at = .05.

90
t test for two dependent samples
in R
t test for two dependent samples

91
t test for two dependent
samples in R
The t.test( ) function produces a variety of t
tests. Unlike most statistical packages, the
default assumes unequal variance and applies
the Welsh df modification
You can use the var.equal = TRUE option to
specify equal variances and a pooled variance
estimate. You can use the alternative="less" or
alternative="greater" option to specify a one
tailed test.

92
t test for two dependent
samples in R
Usage
t.test(x, ...)

## Default S3 method:
t.test(x, y = NULL,
alternative = c("two.sided", "less", "greater"),
mu = 0, paired = FALSE, var.equal = FALSE,
conf.level = 0.95, ...)

## S3 method for class 'formula'


t.test(formula, data, subset, na.action, ...)
t test for two dependent
samples in R
> # paired t-test
> t.test(y1,y2,paired=TRUE) # where y1 & y2
are numeric

94
t test for two dependent
samples in R
> # dependent samples t-test
> # non-directional hypothesis
> Explicit <- c(9, 2, 1, 4, 6, 4, 7, 8, 5, 1) # Condition 1
> Neutral <- c(8, 2, 3, 2, 3, 0, 4, 5, 4, 0) # Condition 2
> t.test(Explicit, Neutral, paired = TRUE)

Paired t-test

data: Explicit and Neutral


t = 2.8483, df = 9, p-value = 0.01914
alternative hypothesis: true dierence in means is not equal to 0
95 percent confidence interval:
0.3292483 2.8707517
sample estimates:
mean of the dierences
1.6
t test for two dependent
samples in R
> # dependent samples t-test
> # directional hypothesis
> Explicit <- c(9, 2, 1, 4, 6, 4, 7, 8, 5, 1) # Condition 1
> Neutral <- c(8, 2, 3, 2, 3, 0, 4, 5, 4, 0) # Condition 2
> t.test(Explicit, Neutral, paired = TRUE, alternative="greater") #H1: > 0

Paired t-test

data: Explicit and Neutral


t = 2.8483, df = 9, p-value = 0.009571
alternative hypothesis: true dierence in means is greater than 0
95 percent confidence interval:
0.5702611 Inf
sample estimates:
mean of the dierences
1.6
t test for two dependent samples
in STATISTICA
t test for two dependent samples

97
Go to Statistics / Basic
Statistics / t-test,
dependent samples

98
99
Click on
Variables and
define the
first variable
(Condition 1)
and the
second
variable
(Condition 2)
100
101
Click summary: T-tests
to view the results of
the analysis.

102
Aside from the results of the t test, this output provides descriptive
statistics, and the 95% CI. The t test is significant using a nondirectional
hypothesis at = .05.

103
t test for two dependent samples
in SAS
t test for two dependent samples

104
Generate Data
data MYDATA;
input Subjects Explicit Neutral;
cards;
1 9 8
2 2 2
3 1 3
4 4 2
5 6 3
6 4 0
7 7 4
8 8 5
9 5 4
10 1 0
;
run;
Normality Test
Title;
ods noproctitle;
ods graphics on;

data work._paired_diffs_;
set WORK.MYDATA;
_Difference_=Explicit - Neutral;
label _Difference_="Difference: Explicit - Neutral";
run;

**************************;
*** Test for normality ***;
**************************;
ods select TestsForNormality;

proc univariate data=work._paired_diffs_ mu0=0 normal;


var _Difference_;
run;
t Test
ods select all;
**************************;
*** t Test ***;
**************************;

proc ttest data=WORK.MYDATA sides=2 h0=0 plots(only


showh0)=(summaryPlot
intervalPlot qqplot agreement profiles);
paired Explicit*Neutral;
run;

**************************;
*** Clean up ***;
**************************;

proc delete data=work._paired_diffs_;


run;
Reporting the results of a t test
for two dependent samples
t test for two dependent samples

112
Reporting the results of a t test for two
dependent samples
A t test for two dependent samples was performed to
determine if there was a significant dierence in emotionality
measured using galvanic skin response (GSR) with respect to
the two categories of words presented to test subjects
(Condition 1: sexually explicit words, and Condition 2: neutral
words). There was a significant dierence between Condition 1
(M = 4.70, SD = 2.83) and Condition 2 (M = 3.10, SD = 2.38)
with t(9) = 2.86, p < .05. The average GSR (emotionality) score
for the sexually explicit words was significantly higher than the
average GSR score for the neutral words. The eect size was
large with Cohens d = .90 and r2 = .61.

t(df) = tobtained, p > or < or the exact p value



113

Vous aimerez peut-être aussi