You are on page 1of 30

Lecture Statistics

Two samples Related


Concerns those situations in which persons, objects or events are closely
matched or the phenomena are measured twice.

Ex: before and after measurement of the same sampling unit.


Two samples Related
Hypothesis Testing
• Nominal Data: Mc Nemar Test (Non-parametric
test)

• Ordinal Data: Wilcoxon Signed-Rank Test (Non-


Parametric Test)

• Interval/Ratio Data: Paired t-test (Parametric test)


Related Populations
The Paired t-Test
Tests Means of 2 Related Populations
Related – Paired or matched samples
samples – Repeated measures (before/after)
– Use difference between paired values:

Di = X1i - X2i

• Eliminates Variation Among Subjects


• Assumptions:
– Both Populations Are Normally Distributed
– Or, if not Normal, use large samples
Related Populations
The Paired Difference Test (continued)
The ith paired difference is Di ,
where D =X -X i 1i 2i

n
The point estimate for the
paired difference
D i

population mean μD is D : D =
i =1
n
n
The sample standard  i
(D − D ) 2

deviation is SD SD = i=1
n −1

n is the number of pairs in the paired sample


The Paired Difference Test:
Finding tSTAT
• The test statistic for μD is:
Paired
samples
D − μD
t ST AT =
SD
n

◼ Where tSTAT has n - 1 d.f.


The Paired Difference Test:
Possible Hypotheses
Paired Samples
Lower-tail test: Upper-tail test: Two-tail test:

H0: μD =0 H0: μD =0 H0: μD = 0


H1: μD < 0 H1: μD > 0 H1: μD ≠ 0

a a a/2 a/2

-ta ta -ta/2 ta/2


Reject H0 if tSTAT < -ta Reject H0 if tSTAT > ta Reject H0 if tSTAT < -ta/2
or tSTAT > ta/2
Where tSTAT
Chaphas
10-6 n - 1 d.f.
Paired Difference Test:
Example
Assume you send your salespeople to a “customer service” training
workshop. Has the training made a difference in the number of
complaints? You collect the following data:

Number of Complaints: (2) - (1)  Di


Salesperson Before (1) After (2) Difference, Di D = n
C.B. 6 4 - 2 = -4.2
T.F. 20 6 -14
M.H. 3 2 - 1
R.K. 0 0 0
SD =
 i
(D − D ) 2

M.O. 4 0 - 4
n −1
-21
= 5.67
Paired Difference Test:
Solution
• Has the training made a difference in the number of complaints (at
the 0.01 level)?
Reject Reject
H0: μD = 0
H1: μD  0
a/2 a/2
a = .01 D = - 4.2 - 4.604 4.604
- 1.66
t0.005 = ± 4.604
d.f. = n - 1 = 4
Decision: Do not reject H0
(tstat is not in the reject region)
Test Statistic:
D − μ D − 4.2 − 0 Conclusion: There is not a
t STAT = = = −1.66 significant change in the
S D / n 5.67/ 5 number of complaints.
Wilcoxon Signed-Rank Test
This test is the nonparametric alternative to the
parametric paired t-test .

The methodology of the parametric paired t-test


requires:
• interval data, and
• the assumption that the population of differences
between the pairs of observations is normally
distributed.
If the assumption of normally distributed differences is
not appropriate, the Wilcoxon signed-rank test can be
used.
Wilcoxon
Signed Rank Test
• Tests probability distributions of two related
populations
• The test uses ranks of sample data consisting of
matched pairs
• The null hypothesis is that the population of
differences from the matched pairs has a median
equal to zero
• Can use normal approximation if n  25
Wilcoxon Signed-Rank Test

Summary
• Compute the differences between the paired
observations.
• Discard any differences of zero.
• Rank the absolute value of the differences from
lowest to highest. Tied differences are assigned
the average ranking of their positions.
• Give the ranks the sign of the original difference
in the data.
• Sum the signed ranks.
Hypothesis Testing 18
Signed Rank Test
Example
You work in the finance department. Is the new
financial package faster (α = .05)? You collect the
following data entry times:
User Current New
Donna 9.98 9.88
Santosha 9.88 9.86
Sam 9.90 9.83
Tamika 9.99 9.80
Brian 9.94 9.87
Jorge 9.84 9.84
Signed Rank Test
Computation Table
X1i X2i Di |Di | Ri Sign Sign Ri
9.98 9.88 +0.10 0.10 4 + +4
9.88 9.86 +0.02 0.02 1 + +1
9.90 9.83 +0.07 0.07 2 2.5 + +2.5
9.99 9.80 +0.19 0.19 5 + +5
9.94 9.87 +0.07 0.07 3 2.5 + +2.5
9.84 9.84 0.00 0.00 ... ... Discard
Total T+= 15, T–= 0
Wilcoxon Signed Rank
Table (Portion)
One-Tailed Two-Tailed n=5 n=6 n=7 ..
a = .05 a = .10 1 2 4 ..
a = .025 a = .05 1 2 ..
a = .01 a = .02 0 ..
a = .005 a = .01 ..
n = 11 n = 12 n = 13
: : : :
Signed Rank Test
Solution
• H0: Identical Distrib.
Test Statistic:
• Ha: Current Shifted T– = 0
Right
• a = .05
• n' = 5 (not 6; 1 elim.)
• Critical Value(s): Decision:
Reject at a = .05
Do Not
Reject
H0 Reject Conclusion:
H0 There is evidence new
1 T0 package
© 2011 Pearson Education, Inc is faster
Mc Nemar Test
• The Mc Nemar test is a non-parametric test for paired
nominal data. It’s used when you are interested in finding a
change in proportion for the paired data and is especially
useful with before-after measurement of the same subjects.

• The McNemar test is used to determine if there are


differences on a dichotomous dependent variable between
two related groups. A dichotomous variable is a categorical
variables with two categories only.

• This test is sometimes referred to as McNemar’s Chi-Square


test because the test statistic has a chi-square distribution.
Calculating the test
Test the significance of any observed change by setting up a fourfold
table of frequencies to represent the first and second set of responses:
After
Before Do not favor Favor

Do not Favor a b
Favor c d

b +c represents the total no of people who changed ( a+d are no change


responses). Cells b and c are discordant. The expectation under Ho is
that ½ of (b+c) cases change in one direction and the same proportion
in the other direction.
The McNemar test uses the following transformation of the chi-square
test:
With df=1
A management decided to tell employees of the values of teamwork in an
internal education campaign. Managers took a random sample of their
employees before the campaign, asking them to complete a
questionnaire on their attitudes on this topic. On the basis of their
responses, the workers were divided into equal groups reflecting their
favorable or unfavorable views of team work. After the campaign, the
same 200 employees were sled again to complete the questionnaire. They
were again classified as to favorable or unfavorable attitudes. Conduct
the appropriate test.

After
Before Unfavorable Favorable
Favorable 10 90
Unfavorable 60 40
H0: same change in proportion
Ha: Change in proportion not the same

Mc Nemar test is chosen because nomainal data are used and


the study involves before-after measurements of two related
samples

= 30*30/50=18 ; df=1

Critical value=3.84 with 5% level of significance

We reject the null hypothesis and conclude there has been a change in
attitude.
Example: Express Deliveries
A firm has decided to select one
of two express delivery services to
provide next-day deliveries to its
district offices.
To test the delivery times of the two services, the
firm sends two reports to a sample of 10 district
offices, with one report carried by one service and the
other report carried by the second service. Do the data
on the next slide indicate a difference in the two
services? Use a non-parametric test.
District Office OverNight NiteFlite
Seattle 32 hrs. 25 hrs.
Los Angeles 30 24
Boston 19 15
Cleveland 16 15
New York 15 13
Houston 18 15
Atlanta 14 15
St. Louis 10 8
Milwaukee 7 9
Denver 16 11
Example:
Compare the two years of sales data for 10 companies. Is there a
significant difference between the two years of sales? Use both a
parametric and a non-parametric test.
Company Sales Year 2 Sales Year 1
A 126932 123505
B 54574 49662
C 86656 78944
D 62710 59512
E 96146 92300
F 36112 35173
G 50220 48111
H 35099 32427
I 53794 49975
J 23966 20779
Example:

A researcher wants to investigate the impact of an intervention on


smoking. In this hypothetical study, 50 participants were recruited to
take part, consisting of 25 smokers and 25 non-smokers. All
participants watched an emotive video showing the impact that
deaths from smoking-related cancers had on families. Two weeks
after this video intervention, the same participants were asked
whether they remained smokers or non-smokers. Conduct the
appropriate test

You might also like