Statistic 6
In this document we will discuss 2 – sample T- Paired or Matched hypothesis
testing and confidence intervals that used a mean and sample SD.
There are still 3 different hypothesis scenarios with a 2 – Sample Paired
Hypothesis Test.
Lower Tail Test (1 tail):
Ho: �̅�𝑑𝑖𝑓𝑓 = 0
Ha: �̅�𝑑𝑖𝑓𝑓 < 0
Upper Tailed Test (1 tail):
Ho: �̅�𝑑𝑖𝑓𝑓 = 0
Ha: �̅�𝑑𝑖𝑓𝑓 > 0
Two Tailed Test:
Ho: �̅�𝑑𝑖𝑓𝑓 = 0
Ha: �̅�𝑑𝑖𝑓𝑓 ≠ 0
The hypothesized value is 0 and the same key words apply from a 1 – sample
hypothesis test to determine which scenario to use. �̅�𝑑𝑖𝑓𝑓 is the average of the
difference column. Paired samples are samples that share something in common.
They are dependent on one another. Since they share something in common the
samples go from 2 to 1. This will be very similar to the 1-sample T hypothesis test
in the discussion forum.
The T – Test Statistic = �̅�𝑑𝑖𝑓𝑓−0
𝑆𝐷𝑑𝑖𝑓𝑓
√𝑛
Where 𝑆𝐷𝑑𝑖𝑓𝑓 this is SD of the difference column
We can use =T.DIST, =T.DIST.RT and =T.DIST.2T to find the p-values. These should
look familiar from the discussion forum.
Example:
Blood plasma cancer is characterized by increased blood vessel formulation in the
bone marrow that is a predictive factor in survival. One treatment approach used
for blood plasma cancer is stem cell transplantation with the patient’s own stem
cells. Measurements were taken immediately prior to the stem cell transplant
and at the time complete response was determined. The estimate of the mean
difference, in bone marrow microvessel density before and after the stem cell
transplant. There are 7 patients that are sampled. Is the blood vessel formulation
in the bone marrow different after the stem cell transplant? Use alpha = .05.
Before After
187 168 199 183
175 155 177 160
193 180 188 175
179 166
Here we see that these sample “share” something in common because it is the
same patient and measurements were taken before and after treatment.
First step is to state the hypothesis scenario. Because the key word says different
this means it is a two tailed test.
Ho: �̅�𝑑𝑖𝑓𝑓 = 0
Ha: �̅�𝑑𝑖𝑓𝑓 ≠ 0
Before we start calculating anything by hand and because we are given the raw
data set, we can actually run this hypothesis test in Excel. And since you installed
the Data Analysis Toolpak it is easy to do.
Go to Data -> Data Analysis -> and scroll to where it says t-Test Paired Two
Samples for Means and click OK
Under Input:
Variable 1 Range: you will highlight the Before column and make sure you include
the top row where the Label is located.
Variable 2 Range: you will highlight the After column and make sure you include
the top row where the Label is located.
Check the “Labels” box because we did include the first row of labels. For Alpha
out 0.05 but this can be change depending on what significance level you use.
Then make sure the bubble for New Workbook Ply: highlight and click OK. It
should look similar to the screenshot below.
Once you click OK in a new Worksheet this should populate.
t-Test: Paired Two Sample for Means
Before After Mean 185.4285714 169.5714286
Variance 78.61904762 106.2857143 Observations 7 7
Pearson Correlation 0.963199569
Hypothesized Mean Difference
0
df 6
t Stat 14.13506279
P(T<=t) one-tail 3.91511E-06
t Critical one-tail 1.943180281
P(T<=t) two-tail 7.83022E-06
t Critical two-tail 2.446911851 Here we have all the values we need to state a conclusion.
We see the T- Test Statistic = 14.135 and because we ran a two tailed test the
p-value = 7.83022E-06. The “E-06” means scientific notation. We can rewrite this
as 7.83 x 10-6, then to convert this to decimal form we need to move the decimal
6 places to the left.
p -value = .00000783 < .05. This p-value is less than .05 which means we Reject
Ho. Yes, there is statistical evidence that blood vessel formulation in the bone
marrow different after the stem cell transplant.
If we were running a 1-tailed test, we are given the p-value which is 3.91511E-06.
Converting this to a decimal we get .000003915. The T-Test Statistic is the same
and so is the conclusion for a 1-tailed test.
Now that we ran a hypothesis test, let calculate a confidence interval and draw
the same conclusion.
The equation for a 2 – paired confidence interval:
�̅�𝑑𝑖𝑓𝑓 ±𝑇𝛼 2
∗ ∗ 𝑆𝐷𝑑𝑖𝑓𝑓
√𝑛
Where Standard Error (SE) = 𝑆𝐷𝑑𝑖𝑓𝑓
√𝑛
Margin of Error (ME) = 𝑇𝛼 2
∗ ∗ 𝑆𝐷𝑑𝑖𝑓𝑓
√𝑛
Before we can start plugging values into our equation we need to find the
Difference Column. We will subtract Before – After to get the Difference Column
and then calculate the average and SD based on that column.
Before After Diff Column 187 168 19
199 183 16
175 155 20 177 160 17
193 180 13
188 175 13
179 166 13
Average 15.85714286 SD 2.968084199
Plugging in what we know:
15.85714 ±𝑇𝛼 2
∗ ∗ 2.96808
√7
The last thing we need to find is the T- Critical Value. We will use the =T.INV.2T
function to find this. This function should look familiar from Week 4.
If we want to find a 95% confidence interval, then alpha = .05. We will use this
value in our Excel function and the DF is n – 1 = 7 – 1 = 6.
=T.INV.2T(.05,6)
We see the T – Critical Value is 2.44691. We will plug this into the equation and
solve. BUT if we look at our output when we ran the Test, the T-Critical Value was
also given to us as well.
t-Test: Paired Two Sample for Means
Before After Mean 185.4285714 169.5714286
Variance 78.61904762 106.2857143 Observations 7 7
Pearson Correlation 0.963199569
Hypothesized Mean Difference
0
df 6
t Stat 14.13506279
P(T<=t) one-tail 3.91511E-06
t Critical one-tail 1.943180281
P(T<=t) two-tail 7.83022E-06
t Critical two-tail 2.446911851
15.85714 ±𝑇𝛼 2
∗ ∗ 2.96808
√7
15.85714 ±2.446911∗ 2.96808
√7
15.85714 ±2.446911∗ 1.121828
15.85714 ±2.74501
(13.112, 18.60215)
The confidence interval goes from 13.112 to 18.60215. This interval goes from a
positive value to a positive value. This means that 0 is NOT in this interval.
Because 0 is NOT in the interval it is Significant, and we Reject Ho. This is the
same conclusion that we got with the hypothesis test.