0% found this document useful (0 votes)
130 views93 pages

Mod 2 Transcript PDF

This document provides an overview of testing for differences in means between two populations or groups. It begins with examples of questions that can be addressed by comparing means, such as whether exercising leads to longer life than not exercising. The document then discusses how to set up the hypotheses and test statistics to evaluate whether observed differences in sample means indicate real differences between populations. It provides an example comparing the mean lifetimes of store brand and national brand batteries to test the store brand's claim of equal lifetimes. The process of hypothesis testing outlined includes stating hypotheses and significance level, calculating a test statistic and p-value, and making a conclusion.

Uploaded by

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

Mod 2 Transcript PDF

This document provides an overview of testing for differences in means between two populations or groups. It begins with examples of questions that can be addressed by comparing means, such as whether exercising leads to longer life than not exercising. The document then discusses how to set up the hypotheses and test statistics to evaluate whether observed differences in sample means indicate real differences between populations. It provides an example comparing the mean lifetimes of store brand and national brand batteries to test the store brand's claim of equal lifetimes. The process of hypothesis testing outlined includes stating hypotheses and significance level, calculating a test statistic and p-value, and making a conclusion.

Uploaded by

reshma thomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module 2 Inferential and Predictive Statistics

for Business
Lesson 2-1 Testing for No Difference in Means

Lesson 2-1.1 Testing for No Difference in Means


Media Player for Video

Does it Make a Difference? - Slide 1

Will you live longer if you exercise a little vs. not exercising at all?

Will customers use their credit cards more if you give them cash back rewards or if you give points
for free travel?

Transcript

In the last module, we looked at comparing a single mean or proportion against a fixed value. In
this module, we extend this by comparing two means or two proportions against one another. In
most settings, we often wonder if doing one thing differently will change an outcome versus not
doing anything at all. Some examples are will you live longer if you exercise versus not exercising
at all, or will customers use their credit cards more if you gave them cash back or points for free
travel as a reward. Clearly, some, if not most of us, exercise because we want its health benefits,
but how do we get to have such belief. Well, it's because scientists have compared the health and
longevity of those who exercise versus those who don't, or why companies decide to use one
promotional tactic versus another. It's because of comparing results under each tactic has given
them cause to think that one outperforms the other. That is what we will be learning in this
module. Basically, we will learn how to correctly conduct comparisons between groups, and then
how to decide if we see significant differences between groups.
Morrow Plots at UIUC - Slide 2

A century of learning

Photo of Morrow Plots, the corn crop field at the University of Illinois.

Image Citation: University of Illinois. (n.d.). Morrow plots [Online image]. UIHistories Project.
Retrieved from http://uihistories.library.illinois.edu/cgi-bin/viewimg?ID=21876

Transcript

I'm proud to tell you that what we are about to learn has deep roots at the University of Illinois
right here across from my office. From my office window, I can see the Morrow's plot, which looks
beautiful during summer months with its growing field of corn, kind of like what you see in this
picture.

In 1876, George Morrow and another researcher, Manley Miles, used this plot to conduct
experiments. They wanted to know how to increase the yield for corn. They applied fertilizer to
some parts and not to others, and then compared the two to establish what type and how much
fertilizer to use for a better harvest. They repeated the experimentation for other crops as well.
They did many more experiments and analyzed all the results using statistics, and through their
studies came many important findings that improved farming significantly.

Everything they did was based on two sciences: an understanding of plant science and statistics.
Back in the 1800s, statistics was mostly used in the field of agriculture, and the statistical analysis
they used more than a century ago is applied the same way to other disciplines today. So, let's
see how we do the comparisons between two groups.

How to Evaluate? - Slide 3


We have to establish that an observed difference in sample means indicates a real difference.

Transcript

You know by now that if I take a sample from a population and take another sample from the
same population, more than likely the two samples will have means that will be different. Then it
comes as no surprise that when I take a sample from two different populations, I would see a
difference between them. The real question here is when a difference is a real difference and not
just a random and acceptable natural variation. We do this by doing the hypothesis testing and by
the observed differences at some given level of significance.

Hypothesis Test of Two Means - Slide 4

1. State H0  and HA
2. Specify the significance level α
3. Calculate the p-value for the sample data
4. Reject or not reject H0

Transcript

When comparing means of two populations through samples we have taken from each
population, the process of hypothesis testing is the same as we have seen in the last module; that
is that we start by stating the null and alternate hypothesis, then specify the level of significant
level, α, calculate the p-value, and then based on the results we either reject or not reject the null
hypothesis.

Example 1 - Slide 5
A store brand battery claims that it lasts as long as a more expensive national brand. A consumer
watch dog group wants to make sure the claim being made by the store brand is not false, at 5%
level of significance. The batteries were tested continuously by equipment mimicking normal use,
and elapsed time until the batteries were no longer functioning was recorded.

Transcript

To take you through this lesson we will begin with an example. A store brand battery claims that it
lasts as long a more expensive national brand. The consumer watchdog group wants to make
sure that the claim being made by the store brand is not false and they would like to test this at
5% level of significance. Consumer Report is one such organization which tests many consumer
goods and then publishes the results to help consumers find best value for their budget when
shopping for new products.

Comparing the Two Brands (1 of 8) - Slide 6

Difference in the mean life of two brands of battery

Let’s call:

The store brand: A

The national brand: B

μA : Mean lifetime for brand A

μB : Mean lifetime for brand B

Transcript

Since here we are concerned about the mean time the batteries last, we can frame the problem
as the difference between the two populations.

Let's call the store brand A and the national brand B. Then μ sub A represents the mean time
brand A lasts. We will record this in hours. And μ sub B represents the mean time brand B lasts.
Comparing the Two Brands (2 of 8) - Slide 7

Step 1- State the Hypotheses

Claim: Store brand batteries last as long as national brand batteries


μA = μB

H0 : μ A − μ B = 0

HA : μ A − μ B ≠ 0

Transcript

The claim that the store brand makes is that it lasts as long as the national brand. In another
word, μ sub A is equal to μ sub B. To rewrite this as a set of null and alternate hypotheses, it will
be for null the difference between the mean is 0 and the alternate will be that the difference is not
equal to 0. Just like it was for a single sample hypothesis testing, this is a two-tail test.

We can also have one-tail test, and I will do an example for that later on. For now, we need to look
at the collected data to settle this question.

Comparing the Two Brands (3 of 8) - Slide 8

Step 2- State the level of significance

H0 : μ A − μ B = 0

HA : μ A − μ B ≠ 0

α = 0.05
Transcript

The watchdog group wants to check on this at 5% level of significance.

Comparing the Two Brands (4 of 8) - Slide 9

Data for Comparison

Random independently from two populations

Transcript

Before we can move on to step three, we need to have data for comparing these two brands. Just
a reminder that this part, gathering of the data, is not a trivial task. You are comparing two different
brands and you would want to make sure that somehow, as they say, you're comparing apples to
apples, and not to oranges. You have to be very careful in collecting this data. For example, as
best as you can, the method used for testing should be similar, or the set of batteries tested like
AAA or D, in each group are about the same.

One thing that is not required is the number of observations in each sample. We can have
different sizes of sample, but here, since the agency is doing the testing, they will use the same
sample size for both brands. But if you were giving a survey, you may not get the same number of
responses back, and that would be okay.

For now, we will assume that the data has been produced based on batteries which were selected
randomly and independently from the two populations.

Comparing the Two Brands (5 of 8) - Slide 10

Step 3- Calculate the p-value


The p-value can be found by knowing how many standard errors separate an estimate from the
null hypothesis. (test statistic)
x̄−μ0
For a single population: Test statistics: t = s

√n

Transcript

Like before, when we did hypothesis tests for one sample, the p-value is going to be the
probability of finding sample results like the ones we have found. This probability, which we call p-
value, is found by knowing how many standard errors separates our estimate for the difference
from the hypothesized difference, which we refer to as the test statistics, and that is denoted by t.

Remember that when we did the hypothesis testing about the mean of one population? This is
how we calculated the t-value. When comparing two populations, we used the same structure.

Comparing the Two Brands (6 of 8) - Slide 11

Step 3- Calculate the p-value


x̄−μ0
For a single population:Test statistics: t = s

√n

( x̄1 −x̄2 ) −D0


For comparing two populations: t =
2 2
s s
1 2
√ +
n n
1 2

Excel Results:

t-Test: Two-Sample assuming unequal variances - Brand A/B


Brand A Brand B
Mean 9.992972973 9.927567568
Variance 0.053700353 0.276790247
Observations 185 185
Hypothesized Mean Difference 0
df 253
t-stat 1.547461849
P(T ≤ t) one-tail 0.061500928
T critical one-tail 1.650898678
P(T ≤ t) two-tail 0.123001856
T critical two-tail 1.969384804

Transcript

But rather than use a single mean, it uses the difference between the two-sample means.

Just let's take a moment and dissect the second equation and see how it relates to the first
equations, which you have seen before. In the numerator we have the difference between the
two-sample means, each coming from their respective populations, and is the first argument,
replacing the single sample mean which you see in the first equation.

The second argument in the numerator is D sub-0. This is the hypothesized difference between
the two population, and it's replacing the hypothesized mean that you see in the first equation. In
this example, we hypothesized this difference to be 0.

The denominator is the measure of standard error. Calculating standard error can get quite
complicated, but fortunately, software programs can do this with a few commands so I am not
going to focus on how to calculate the standard error. Instead, I will rely on Excel to give me the
answers. So, I will use Excel outputs in these slides to solve for our examples. And, of course, you
can watch the Excel demo videos, later on, to see how I get these outputs you see here.

I just want you to see that the logical steps of comparing two populations is pretty much the same
as we did when we had only one population and one sample. Math gets a little bit more complex,
but that's it.

Okay, now let's use this within our example using the data we had, we use Excel to analyze the
data for these two brands. This is the output. The t-value is highlighted here and is 1.547. Excel
will give you all values, one-tail as well as the two-tail. You need to focus on what is appropriate
for a given problem. Here we are doing a two-tail test, so we will only focus on those values in the
output.

For a two-tail test p-value here is 0.123. So, these are the numbers, but what do they imply? So,
let's better understand what we have here.

Comparing the Two Brands (7 of 8) - Slide 12

Excel Results:

The slide contains the same t-Test: Two-Sample assuming unequal variances table presented in
Slide 11 - Comparing the Two Brands (6 of 8) with the t-stat row highlighted, where the value is
1.547461849.
Transcript

Based on this result, the mean time brand A, the store brand, lasts 9.99 hours, and for brand B,
the national brand, it is 9.92 hours. Wow, looks like the cheaper brand is a better brand.

But wait, this could only be because of national brand and variations, so don't pass a judgment
yet. The t-value for how far is the difference that we observe from the hypothesized difference of 0
is 1.547. Then at 5% level of significance what is the probability of observing what we have
observed in our sample, that is the p-value for two-tail test, which is 0.123. So now let's go back to
our formulation and make a decision.

Comparing the Two Brands (8 of 8) - Slide 13

Step 4- Reject or not Reject

H0 : μ A − μ B = 0

HA : μ A − μ B ≠ 0

α = 0.05

p-value is: 0.123

p > α → Don’t Reject the Null Hypothesis

The slide contains the mean of Brand A (9.992) and Brand B (9.927) presented in the t-Test: Two-
Sample assuming unequal variances table from Slide 11 - Comparing the Two Brands (6 of 8)

Transcript

Looking at p-value of 0.123, it's greater than the α of .05, we will not reject the null hypothesis.

This means that our sample data did not produce a result which will lead us to think that the less
expensive store brand is of a lesser value and quality than the more expensive national brand.
This is good news for consumers. We can save money while getting the same quality.

Now, if you'll recall, the mean time of brand A was slightly higher than brand B, but based on our
complete analysis, we find no meaningful difference between the two brands. The difference you
see here is considered "noise" and statistically insignificant, which means don't go and advertise
in national tests our brand did better than the more expensive brand. That is not the case, at least
not based on this data set.
Let's Practice - Slide 14

The manager of a store would like to know if the average daily sales (measured in dollars) through
her website are any different than her in-store sales. The data has been collected and an analysis
has been performed at 5% level of significance. Help her understand the results.

Start by stating the hypotheses and the significance level.

Transcript

So, now let's practice. Manager of a store would like to know if the average daily sales measured
in dollars through her website is any different than her in-store sales. The data has been collected
and an analysis has been performed at 5% level of significance.

Example Question: What are Hypotheses? - Slide 15

The manager of a store would like to know if the average daily sales (measured in dollars) through
her website are any different than her in-store sales. The data has been collected and an analysis
has been performed at 5% level of significance. Help her understand the results.

What are the hypotheses?

1. H0 : μonline − μinStore ≠ 0 and HA = μonline − μinStore = 0

2. H0 : μonline − μinStore = 0 and HA = μonline − μinStore ≠ 0

3. H0 : μonline − μinStore ≥ 0 and HA = μonline − μinStore < 0

4. H0 : μonline − μinStore ⩽ 0

Transcript

No instruction provided on this slide


Let's Practice - Solved (1 of 2) - Slide 16

H0 : μonline − μinStore = 0

HA : μonline − μinStore ≠ 0

α = 0.05

Transcript

Since the manager is interested in knowing if these two channels of sales are different or not, we
will formulate the null and alternate hypothesis as a two-tail test, which means the null states
difference between the average sales through the online is not different than in-store, and the
significant level is at 5% level.

Let's Practice - Solved (2 of 2) - Slide 17

t-Test: Two-Sample assuming unequal variances - Online/In


Store
Online In Store
Mean 863.7380769 969.4619231
Variance 17374.14664 81505.48446
Observations 52 52
Hypothesized Mean Difference 0
df 72
t-stat −2.424494522
P(T ≤ t) one-tail 0.008920545
T critical one-tail 1.666293696
P(T ≤ t) two-tail 0.01784109
T critical two-tail 1.993463567

p-value < 0.05

Reject H0

Transcript

Here's the analysis of her data, it has weekly sales for 52 weeks. What do you think; will you
reject the null hypothesis or not? What does it mean if you say reject or do not reject?

So again, this is a two-tail test and we should focus on the part of the analysis that is for two-tail
tests. I am just going directly to the p-value and comparing that to α of .05 to make a decision.
Here the p-value is .0178 and that is less than α of .05, so reject the null hypothesis. This means
that the average weekly sales are not the same for the two channels of sales.

In this example we just saw, we came to an interesting revelation. There is a difference between
average weekly sales of online and in-store, so now one natural question will be what is the
difference? Most people are not just satisfied to know that there is a difference. They want to
know the magnitude of difference as well. Clearly, this matters. Is there a dollar difference or
thousands of dollars of difference? So, let's explore how we would answer this question.

How Much is the Difference? - Slide 18

The slide contains the same t-Test: Two-Sample assuming unequal variances table presented in
Slide 17 - Let's Practice - Solved (2 of 2) with the Mean row highlighted.

Difference = 969.46 − 863.74 = $105.72

Transcript

Looking at the output from our analysis we see that the average sales for in-store is a little bit
higher, $105.72, based on the sample data we have. But we know that if I took another sample, I
would get different results. So, a better way of estimating the difference is by using a confidence
interval. We can develop the 95% confidence interval based on the results we have here.
Confidence Interval for the Mean Differences - Slide 19

One Sample:

Sample Mean ± Margin of error

s
[x̄ ± t α ]
2 √n

Two Samples:
2 2
s s
1 2
[(x̄1 − x̄2 )±t α √ + ]
2 n1 n2

Transcript

Once again, I want you to relate what we need to do here when we have two samples to what we
learn in creating the confidence interval for one sample. When we had one sample, the
confidence interval was calculated by taking the sample mean and adding and subtracting the
margin of error, which was represented by this equation.

For two samples the idea remains the same; that is you are going to add and subtract the margin
of error to the observed difference. And the equation will now look like this. Do you see the
resemblance between the two? We are essentially doing the same thing. We'll now go back to our
example and calculate the 95th percentile confidence interval for the manager.

How Much is the Difference? (1 of 5) - Slide 20

The slide contains the same t-Test: Two-Sample assuming unequal variances table from Slide 17
- Let's Practice - Solved (2 of 2). In addition, the following formula is shown:
2 2
s s
1 2
[(x̄1 − x̄2 )±t α √ + ]
2 n1 n2

81505.48 17374.14
(969.46 − 863.74)±(1.993)√ + = 105.72 ±(1.993 × 43.6)
52 52

Transcript

We can find the values for all the notations in the same output and do the math to get the
confidence interval. Please pay attention to the equation on the right as I substitute values for
notation.

How Much is the Difference? (2 of 5) - Slide 21

The slide contains the same t-Test: Two-Sample assuming unequal variances table from Slide 17
- Let's Practice - Solved (2 of 2) with the following formula:
2 2
s s
1 2
[(x̄1 − x̄2 )±t α √ + ]
2 n1 n2

81505.48 17374.14
(969.46 − 863.74)±(1.993)√ + = 105.72 ±(1.993 × 43.6)
52 52

Red arrows connect the mean amount in each column to the first section of the equation: (969.46
− 863.74)

Transcript

So first the value of mean spending in each sample is substituted to get the mean difference. It
doesn't matter which one is written first, by the way.
How Much is the Difference? (3 of 5) - Slide 22

The slide contains the same t-Test: Two-Sample assuming unequal variances table from Slide 17
- Let's Practice - Solved (2 of 2) with the following formula:
2 2
s s
1 2
[(x̄1 − x̄2 )±t α √ + ]
2 n1 n2

81505.48 17374.14
(969.46 − 863.74)±(1.993)√ + = 105.72 ±(1.993 × 43.6)
52 52

The center section of the formula — t of α over two — is circled in red.

Transcript

Then we need the value for t of α over two. That is also known as the critical value, which is the
terminology Excel uses in its output. In our case, we want the 95% confidence interval and using
the t-value for a two-tail test, will be used, and that is 1.993.

How Much is the Difference? (4 of 5) - Slide 23

The slide contains the same t-Test: Two-Sample assuming unequal variances table from Slide 17
- Let's Practice - Solved (2 of 2) with the following formula:
2 2
s s
1 2
[(x̄1 − x̄2 )±t α √ + ]
2 n1 n2

81505.48 17374.14
(969.46 − 863.74)±(1.993)√ + = 105.72 ±(1.993 × 43.6)
52 52
The final section of the formula for the standard error is circled in red.

Transcript

Now, the values for the standard error, the notations here are the variance of each sample divided
by each sample size added together and then we take the square root of the sum. In this case, we
are taking the variants of in-store and dividing it by the sample size, and then variants of online
divided by its sample size. Now we can proceed with performing the operations to get the final
result.

How Much is the Difference? (5 of 5) - Slide 24

The slide contains the same t-Test: Two-Sample assuming unequal variances table from Slide 17
- Let's Practice - Solved (2 of 2). In addition, the continuation of the previous formula is presented:

105.72 ± (1.993 × 43.6) = 105.72 ± 86.93

[$18.80, $192.65]

Transcript

So, if everything is done correctly, we get the mean difference of $105.72 plus or minus the
margin of error of $86.93, which means the 95% confidence interval for average weekly sales for
in-store, as compared to online, is a value between $18.80 and $192.65. Any value in this interval
is likely value for the true differences between the two channels of sales.

Now, a manager may look at this and say, sure, there is a difference between the two, but if the
true difference is only about $19, then I would personally consider that not that important, and that
is what I want you to pay attention to. Just because we find significant differences doesn't
necessarily mean that we have found something substantive. The decision maker who
understands statistics now can apply their own insight and decide for themselves what to do.

Lesson 2-1.2 Testing for No Difference in Means in Excel


Media Player for Video
Excel Worksheet (1 of 9) - Slide 25

A store brand battery claims that it lasts as long as a more expensive national brand. A consumer
watchdog group wants to make sure the claim being made by the store brand is not false, at 5%
level of significance. The batteries were tested continuously by equipment mimicking normal use,
and elapsed time until the batteries were no longer functioning was recorded.

Transcript

A store brand battery claims that it lasts as long as a more expensive national brand. A consumer
watchdog group wants to make sure the claim being made by the store brand is not false, at 5%
level of significance. The batteries were tested continuously by equipment mimicking normal use
and elapsed time until the batteries were no longer functioning was recorded. So, we're going to
test this by using a hypothesis discussing comparing two means from two samples. One sample is
coming from a national brand and one is coming from a store brand.

Excel Worksheet (2 of 9) - Slide 26

A: Store Brand

B: National Brand

H0 :  μA = μB   →  μA − μB = 0

HA :  μA ≠ μB   →  μA − μB ≠ 0
Transcript

So, in this case, what we have to do first is to state our hypothesis. So, if I say A is the store brand
and B is the national brand, then one easy way of coming up with your hypothesis is to think
about it this way. The fact is that I think that the lifetime of the store brand and the national brand
are the same. And therefore, the alternate would be that it is different. Once you write it this way
it's easier to now write it in a way that the software can handle.

So, software is looking for what you think is the difference between the two. So now you can
rewrite these as we see the difference between the two batteries lifetime to be equal to zero, and
obviously, the other choices that they are different so, therefore, they would have something other
than zero as their distance. So, once we have the hypothesis stated, then you will know if you are
doing a one-tail test or a two-tail test. So, this would be an example of the two-tail because again,
they're not saying the store brand is worse than the national brand or better than the national
brand. They're just saying it's the same. So, we will reject this hypothesis if we find out that the
store brand is indeed better or if the store brand is worse. So, on either side of the tail, if we
deviate too much from that distance of zero that we expect, then we will end up rejecting the null
hypothesis. Otherwise, we will not.

Excel Worksheet (3 of 9) - Slide 27

The slide contains the Store Brand data set. The data includes two columns: Brand A and Brand
B. Here, the Brand A column is selected.

Download the Battery Life Excel file (Refer to Data - First worksheet)

Transcript

Now let's go back to our data and see how we did here. So, this is what we have for the data and
if I look down I will see that I have 186 and I have the same number of batteries tested for Brand A
and Brand B, by the way, that is not a requirement.

We don't have to have the same sample size, these are two independent samples coming from
two independent populations that are being randomly selected. So, they don't have to be the
same. Now, here, if I'm doing batteries it probably is the case that I would just pick up the same
numbers. The thing about it if I had sent surveys out, to two different types of populations, I can't
control that one population might return more of their surveys back to me versus another sample.
So, the fact that they don't have to be equal is a great thing for us here.
Excel Worksheet (4 of 9) - Slide 28

The slide contains how to select the t-Test Two Sample option in the Data Analysis section. Once
selecting the Brand A column, go to the Data tab in the main menu and choose the Data Analysis
option. Here, a pop-up window appears with a list of analysis tools such as: histogram, regression,
sampling, and t-test: paired assuming unequal variance, among others. Select t-test: paired
assuming unequal variance.

Transcript

Let me show you how we will do this in Excel. You will go to Data, you will go to Data Analysis.
When the pop-up window comes scroll down until you see three different t-tests. The first one is a
Paired Two Sample for Means. I will discuss this later on in one of my examples. And the next two
are Two Samples Assuming Equal Variances and Unequal Variances.

So, let me just talk about this a little bit. When you do assumption that they have equal variances,
which means that I expect that population A, so Brand A, and population B, Brand B, within
themselves, they have some variability. But I'm going to assume that the variability within their
own population is about the same. The reason we have this is because when you were doing this
manually, the degrees of freedom that we have to come up with for t-test is lot simpler or if I
assume equal variances. So, assumption of equal variances may or may not be true. So, when
you're using a computer program, and we're actually not doing the difficult work of calculating
everything manually, there is really no reason for you to assume equal variances.

So, always run this kind of a test as assuming unequal variances. Okay? Because if they have
equal variances, the answers will be the same. But if you do the other way around, which is I
assume equal variances, but then, in reality, they're not equal, then my analysis is not right. So,
be safe and always go for the most generalized form, because for you, when you're using a
software, it really does not make a difference. The calculations are coming right in, in a split of a
second, so you won't know the difference at all. So, I'm going to say that I'm going to do a t-test.
That t-test is going to tell me the significant differences between these do exist or not. I'm using
two samples assuming unequal variances. I'm going to click okay.
Excel Worksheet (5 of 9) - Slide 29

This slide is a continuation of the instructions began on Slide 28 - Excel Worksheet (4 of 9). The
slide contains a pop-up window. The window consists of two sections: Input and Output. In the
Input section, the Variable 1 range is $A$1:$A$186, the Variable 2 range is $B$1:$B$186, the
Labels checkbox option is selected, and Alpha is set to 0.05. In the Output section, Output range
is selected and filled with $E$3.

Transcript

OK, then it says, "What is your range one?" I like to take my labels because then my analysis with
show the labels as a variable one. So, I'm going to put my cursor on A 1, hold my control shift
down, pick the entire data set, remember to scroll back up, put it on Brand B, take the entire cell,
remember to say that you have labels. If you don't, you'll get an error message that says you have
non-numeric values. That's usually the case when you forget to click this. So, if you get that, just
open it up and click your labels.

Then it says, "What is your Hypothesized Mean Difference?" Here, I can put zero or I can just
ignore it because these are zero, and as you can see, α is .05, that's again, a default value. You
can change this to .10, you can change this to whatever that you want to have. I like to put my
output on the same page, but as soon as I click this, my cursor jumps here, graying this out, so if I
go and click on anywhere in the spreadsheet, I will lose that drop-down thing, so before you do
clicking on anywhere on your spreadsheet, make sure you click here. And then, picks a place, and
say okay.

Excel Worksheet (6 of 9) - Slide 30

The slide contains a screen shot of an Excel worksheet with the following data:

t-Test: Two-Sample assuming unequal variances - Brand


A and Brand B
Brand A Brand B
Mean 9.992973 9.927567568
Variance 0.0537 0.276790247
Observations 185 185
Hypothesized Mean Difference 0
df 253
t-stat 1.547462
P(T ≤ t) one-tail 0.061501
T critical one-tail 1.650899
P(T ≤ t) two-tail 0.123002
T critical two-tail 1.969385

Transcript

Now, you can see that everything is kind of smooshed up, so I'm first going to do some formatting
so it will be easy to read. The best thing to do is put your cursor here and double click and it will
increase the size. And you don't have to worry about it. So same thing, so I can, this one was big,
I'm going to make this small.

What you see is an output, first of all, is that the fact that it gives you a lot of descriptive trial base.
For example, it will tell you that the mean for Brand A is 9.99 hours and Brand B is 9.92 hours.
Now, remember, Brand A is my store brand and Brand B is my national brand. If you want to
change this to remember what it is, you can, by the way. You can then say, okay, Store Brand, so
if it's easier for you to think about it as a Store Brand and then you can just change it to Store
Brand. So that's the nice thing about it.

So, I'm going to go back to what it was. So, looking at this, it looks like Brand A is actually a little
bit better. So, this is the cheaper battery because it's a store brand, it's a generic brand. So, I may
say, "Wow, Brand A is actually better". But remember, we can't say that because, in this case,
they may actually be the same, so that's what you're testing here. So, it tells you also what is the
variance in Brand A and what is the variance in Brand B. Remember, variance is the squared of
your standard deviation. So, if I want a standard deviation, I have to take the square root of this
and I will know what the standard deviation of Brand A.

It says it has 185 observations in Brand A and 185 observations in Brand B. And the
Hypothesized Mean Difference was zero and the degrees of freedom has been calculated by
taking these two values and then going through the process of creating the degrees of freedom
based on the equation that is used for unequal variances. Once it does that, then you will see that
it gives you a value for the t-statistics and then a p-value if you're doing a one-tail test and a p-
value if you're doing a two-tail test. It also tells you where is the t-critical. So, let me show you
what the meaning of the t-critical is.
Excel Worksheet (7 of 9) - Slide 31

This slide contains the same data presented in the t-Test: Two-Sample assuming unequal
variances - Brand A and Brand B table on Slide 30 - Excel Worksheet (6 of 9). In addition, there is
a bell-shaped curve. In the curve, the positive and negative t critical two-tail (1.96 and −1.96) are
highlighted with two vertical lines. The area outside the range is 2.5% to the left and 2.5% to the
right.

Transcript

If you're doing a two-tail test, and your level of significance is 5%, then 2.5% is here, and 2.5% is
here. So, this t-critical would be 1.96 and negative 1.96. So, this is what the critical t-value is.

Excel Worksheet (8 of 9) - Slide 32

This slide contains the same data presented in the t-Test: Two-Sample assuming unequal
variances - Brand A and Brand B table on Slide 30 - Excel Worksheet (6 of 9) with the p(T ≤ t)
two-tail value (0.1230) highlighted. Since this value is larger than 0.05, the null hypothesis is not
rejected.

Download the Battery Life Excel file (Refer to T test 2 Sample - Second worksheet)

Transcript

However, if you were doing the one-tail test, doesn't matter which tail by the way, if it's right tail or
left tail, let's just assume right tail. If you're doing the right tail test, the entire 5% will be here,
right? So, then this is 1.65 which is what you see here. So, it will give you all the values because it
doesn't know if you're doing a one-tail test or a two-tail test. Excel doesn't know, excel gives you
the entire output. You have to pick out what is right.
Then, it will also tell you what is the t-stat. What the t-stat is saying to you, which is this one, t-stat
says you have taken a sample from Brand A and a sample from Brand B. The difference that you
have noticed between these two samples, when you look at hypothesized difference being zero,
your sample is somewhere here, it's 1.54. And therefore, it's going to give you the p-value, and
you have to find out whether or not you will be just a hypothesis or not.

So, in our case, we're doing the two-tail test and that's what we're going to pay attention to. We're
going to only pay attention to this part of the table and looking at this p-value, you will see that it is
greater than .05, therefore, we do not reject the null hypothesis. If we don't reject the null
hypothesis, which means what?

Excel Worksheet (9 of 9) - Slide 33

The slide contains the same information as presented in Slide 25 - Excel Worksheet (1 of 9) and
Slide 26 - Excel Worksheet (2 of 9). Here, the part of the H0 that says "μA − μB = 0 " is
highlighted.

Transcript

Our hypothesis was that these two perform about the same and we ended up basing our data, not
rejecting it. Therefore, the two brands are about the same. So, what they're claiming right now,
based on the data that we have, cannot be disputed.

Lesson 2-1.3 Two-Tail Mean Test for Two Samples and Calculating the
Confidence Interval in Excel
Media Player for Video

Online Instore Excel Worksheet (1 of 10) - Slide 34


The manager of a store would like to know if the average daily sales (measured in dollars) through
her website are any different than her in-store sales. The data has been collected and an analysis
has been performed at 5% level of significance. Help her understand the results.

Start by stating the hypotheses and the significance level.

Transcript

I'm going to show you how to use data analysis and the t-test for two samples, first to do the
hypothesis testing as well as how to come up with the confidence interval for the difference we
see between two populations. The manager of a store would like to know if the average sales
measured in dollars to her websites are any different than her in-store sales. The data has been
collected and we want to do an analysis at 5% level of significance. So, first of all, all she's
wondering that is there a difference between online and in-store.

Online Instore Excel Worksheet (2 of 10) - Slide 35

The slide contains the same information as presented in Slide 34 - Online Instore Excel
Worksheet (1 of 10).

H0 :  μOnline = μInstore → μOnline − μInstore = 0

HA :  μOnline ≠ μInstore → μOnline − μInstore ≠ 0

Here, μOnline = μInstore  is highlighted.

Transcript

So, a null hypothesis is that there is not difference between the two right, this is the online sales is
the same thing as the store sales. And the alternate would be that no, they're not the same, so
this is what we are checking. And again, what I said was if you write it like this it would be easier
for you to see what we are doing, so now we are going to say that the difference between the two,
so if I have to take the two μ, I am saying that these are equal to zero or it is not equal to zero. So,
this is the online and this is the store, my handwriting isn't so good, so I'm not going to follow it.
Now, let's go look at our data and do the analysis.
Online Instore Excel Worksheet (3 of 10) - Slide 36

The slide contains the Online vs. Instore data set. The data includes two columns: Online and In-
store.

Download the Online vs Instore Excel file (Refer to Data - First worksheet)

Transcript

So, here's the data, these are dollars that has been recorded at end of day. For several days we
have taken the observations from, from online and in-store.

Online Instore Excel Worksheet (4 of 10) - Slide 37

The slide contains how to select the t-Test Two Sample option in the Data Analysis section. Once
selecting the Data tab in the main menu and choosing the Data Analysis option, a pop-up window
appears. The window has a list of analysis tools such as: histogram, regression, sampling, and t-
test: two sample assuming unequal variance, among others. Select t-test: two sample assuming
unequal variance

Transcript

So, the first thing we want to do is go to data, go to data analysis, select t-test. Again, unequal
variances I would assume that. I don't want to simplify it, so then I say okay.
Online Instore Excel Worksheet (5 of 10) - Slide 38

This slide is a continuation of the instructions began on Slide 37 - Online Instore Excel Worksheet
(4 of 10). The slide contains a pop-up window. The window consists of two sections: Input and
Output. In the Input section, the Variable 1 range is $A$A, the Variable 2 range is $B$B, the
Labels checkbox is selected, and Alpha is set to 0.05. In the Output section, New Worksheet Ply
is selected.

Transcript

And it will ask for range one and I have shown you that you can click here and do control shift
down. You can actually do this quicker by just selecting the column. This will work in this type of
analysis. If it works in only a few places, not all the time we can use this kind of a selection, but
here you can and that will speed up the selection process.

So, then the second variables will appear in the b column. I assume that there are no differences.
I have no preconceived idea. I'm going to say that we have labels. I'm going to select the output
range, click here, click somewhere here and then say, okay. Here we go. So, once again, I know
that I am doing a two-tail test because it was of equal versus inequality.

Online Instore Excel Worksheet (6 of 10) - Slide 39

The slide contains the same t-Test: Two-Sample assuming unequal variances table presented in
Slide 17 - Let's Practice - Solved (2 of 2) with the p(T ≤ t) two-tail value (0.017) highlighted. Since
this value is smaller than 0.05, the null hypothesis is rejected.
Transcript

So, what I need to do is that I just need to focus on the two-tail part of this output and that would
be right here. So, now looking at the p-value, the p-value is less than 0.05, so I will end up
rejecting the null hypothesis which was, the two are the same.

So, now that I know that they are different, I want to know what is the expected difference
between an online versus the store sales. So, now I can go ahead and use the same output to
develop the confidence interval for the difference that exists between the two channels of sales.

Online Instore Excel Worksheet (7 of 10) - Slide 40

The slide contains the same data presented on Slide 39 - Online Instore Excel Worksheet (6 of
10).

Two labels have been added beneath the table: mean diff and t-value. The mean diff value reads:
-105.7238462.
2 2
s s
(x̄1 − x̄2 )±t α √
n1
1
+
n2
2
.
2

Transcript

So, to develop the confidence of the difference between the two channels of sales, these are the
mean differences between the two, so let me highlight this in red. But this is not enough, so I
cannot just take the difference between these two and say this is what I expect the difference to
be. There is a large enough error. There is some variability from sample to sample. So, what you
want to do is develop that entire difference.

So, right now I can look at the mean differences between the two and say this is x̄ 1 − x̄ 2. So, I
can develop this by saying this minus this value. By the way, it doesn't matter which one you do
first. Your signs will change, but the absolute value of the differences are still the same and that's
what we care about, we either will say right now it looks like mean sales and online is $105 less
than what is in-store. If you did it the other way around, this positive number would say that in
store sales is $105 more than online. So, there's really no difference.

So, going back to the formula that we have, for the confidence interval of the differences, the next
thing that I need to find out is what is my t-value. Now, the confidence interval is always a two-tail.
Margin of error could occur plus or minus, so, the two-tail here is 1.99. That's my t-value, so
again, looking at our formula, the next thing that I need in order for me to come over the margin of
error is the standard error.
Online Instore Excel Worksheet (8 of 10) - Slide 41

The slide contains the same data presented on Slide 39 - Online Instore Excel Worksheet (6 of
10).

The t-vaule now reads: 1.993463567

The label: standard error has been added. In the column next to this label, the formula
=sqrt(E6/E7+F6) is being used, where E6 is 17374.14 (Online variance), E7 is 52 (Online
observations) and F6 is 81505.48 (In-store variance).

Transcript

And the standard based on our equation is just the square root of the variance of the first one
divided by its sample and this case it was 52 plus the second samples variance divided by its
sample size. And once I have the two, I can use the square root and find the standard error. Now,
I'm ready to calculate the margin of error. Margin of error is simply your t-value times the standard
error.

Online Instore Excel Worksheet (9 of 10) - Slide 42

The slide contains the same data presented on Slide 39 - Online Instore Excel Worksheet (6 of
10).

The standard error value now reads: 43.60655189

Three new labels are added below standard error as follows: Margin of error: 86.92807245,
Lower: -192.6519186, Upper: -18.7957737.

Download the Online vs Instore Excel file (Refer to T test 2 Sample - Second worksheet)
Transcript

And now I'm ready to calculate the lower bound and the upper bound of the differences between
these two channels. The lower bound is this value minus the margin of error. And the upper bound
is this value plus.

So, essentially what we are saying is we are 95% confident that the difference that exists between
sales online versus sales in-store, is that the online channel can sale on average of about $18.80
per day up to $192.65 per day less than what we have on sales for our in-store.

Online Instore Excel Worksheet (10 of 10) - Slide 43

Statistical Significance
Label Value
mean diff -105.7238462
t value 1.993463567
standard error 43.60655189
Margin of error 86.92807245
Lower -192.6519186
Upper -18.7957737

Transcript

Now, as I have said before, that is showing a significant difference. Statistically a significant
difference between the two. But in practice, that could be as little as $18 difference between the
two. So, as a manager, you may decide that this is not important to you, it's not enough
differences. So, statistically significant does not mean that you have found something meaningful
at times. Now, if this number was thousands of dollars difference, then nobody would argue that
even in practice you would consider that as an important issue.

What is the threshold when you as a business person would decide that this is significant enough
really depends on the domain and the decisions that has to go along with that domain, so there is
no standard answer for that. This is where your expertise comes into play and is not just about the
statistical values that you are seeing.
Lesson 2-2 One-Tail Test of the Means

Lesson 2-2.1 One-Tail Test of the Means


Media Player for Video

One-tail Test - Slide 44

μ1 ≥  μ2  or μ1 ≤  μ2

H0 :  μ1 − μ2 ≥ 0

HA :  μ1 − μ2 < 0

H0 :  μ1 − μ2 ≤ 0

HA :  μ1 − μ2 > 0

Transcript

There are times that you're interested in knowing if the mean of one population differs from the
mean of another population in certain direction. That would be mean of population one is greater
than or equal than mean of population two or the other way around. In cases like this, we will be
conducting one-tail tests. And the two possibilities are what you see here.

Product Testing (1 of 5) - Slide 45


A fast food company is considering a new lunch item. The company will choose the item based on
the test market results. The item should show a higher weekly demand than one of the regular
items on the menu. The analysis needs to show a difference at 0.01 level of significance to be
selected.

Transcript

Consider this very common scenario for fast food chains. Every time they decide to add a new
menu item, much work and analysis goes into that decision. Every new item added must first
show a significant demand before it is added, every new item added increases the complexity of
procurement of raw material as well as requiring workflow redesign that goes along with it. The
new item is added to menu of several outlets first and then it is benchmarked against the demand
for another regular item on the menu before a decision is made about the new item. So, let's see
how we will conduct and analyze such study.

Product Testing (2 of 5) - Slide 46

The item should show a better demand than one of the regular items on the menu. The analysis
needs to show a difference at 0.01 level of significance to be selected.

H0 :  μnew ≤ μregular → H0 :  μnew − μregular ≤ 0

HA :  μnew > μregular → HA :  μnew − μregular > 0

α = 0.01

Transcript

First, we'd like this new product to do better than another item, so that would be our alternate
hypothesis, which can be written as μ sub new − μ sub regular is greater than zero. So, the
compliment will be the null hypothesis, α here is .01. Once again, data collection is really
important.
Product Testing (3 of 5) - Slide 47

Data is collected (number sold per week) randomly and independently. Some locations have the
new item on their menu and will provide the demand data for the new item. The demand data for
the regular item being benchmarked is collected from locations that don’t have the new item yet.

Transcript

We are going to collect sample data from two populations that are independent. One population
has a new item in their menu and the other population does not.

Product Testing (4 of 5) - Slide 48

H0 :  μnew − μregular ≤ 0

HA :  μnew − μregular > 0

α = 0.01

t-Test: Two-Sample assuming unequal variances -


New/Regular
New Item Regular Item
Mean 17.50666667 16.9444444
Variance 4.037117117 20.8638006
Observations 75 108
Hypothesized Mean Difference 0
df 157
t-stat 2.640045854
P(T ≤ t) one-tail 0.004563106
T critical one-tail 2.350333732
P(T ≤ t) two-tail 0.009126212
T critical two-tail 2.607506474

Transcript

Once they have the data collected, we will conduct our analysis to find the p-value for the
difference we observed based on our data. The results from our data is shown here, the mean
numbers are in thousands. Also, note that we have different sample sizes for the new item. We
have 75 weekly sales data and for regular items, we have 108 weekly sales data. Again, we are
collecting data independently from each population. The sample sizes need not be the same.

Since we are doing a one-tail test, the p-value we use to compare to α is this, and this value of
.0045 is less than α of .01. So, we will reject the null hypothesis.

Product Testing (5 of 5) - Slide 49

H0 :  μnew − μregular ≤ 0

HA :  μnew − μregular > 0

α = 0.01

p value = 0.0045 < 0.01 → Reject H0

Conclusion: The mean weekly demand for the new item is greater than the regular item at 1%
level of significance.

Transcript

Rejecting the null hypothesis in favor of the alternate hypothesis implies that we believe the new
item is doing better than the regular item it was benchmarked against.

Thus, the management should consider adding this new item. Management is happy to hear this,
but they want to know what is the expected difference between these two items before going
nationwide with the new item.
What is the Difference in Demand? (1 of 2) - Slide 50

The slide contains the same t-Test: Two-Sample assuming unequal variances table from Slide 48
- Product Testing (4 of 5). In addition, the following formula is presented:
2 2
s s
1 2
(x̄1 − x̄2 )±t α √ +
2 n1 n2

For mean: (x̄1 − x̄2 )= 17.51 − 16.9 = 1.32

For t critical one-tail: t α = 2.35


2

4.037 20.868
Standard error = √
75
+
108
= 0. 497

Margin of Error: 2.35 × 0.497 = 1.168

Transcript

Given our results, and the equation for the confidence interval of the differences between the two
populations, we can find our answer. When you have conducted a one-tail test, now you're looking
to find the confidence interval for the mean differences where you could be wrong in both
estimating the lower and the upper boundaries of the interval than using the t-value of one-tail, in
this case, 0.01, translates to having 1% chance of getting it wrong in either tail. Thus, the
confidence interval, in this case, will be 98% confidence interval. I am showing you here how to
calculate this difference piece by piece.

First is the difference between the two-sample means. Then, we need the margin of error, which is
t of α over 2 for a one-tail test, in our case, of 2.35 times the standard error which means the
margin of error turns out to be 1.168. So, now we are ready to express the 98% confidence
interval, α here is 0.01.

What is the Difference in Demand? (2 of 2) - Slide 51


x̄1 − x̄2 = 17.51 − 16.9 = 1.32

Margin of Error: 2.35 × 0.497 = 1.168

98% confidence interval is: 1.32 ± 1.168 = [0.1517, 2.488]

Since the weekly sales were recorded in thousands, then we can rewrite this as: [151.7, 2,488.22]

Transcript

We find the 98% confidence interval to be 0.1517 to 2.488 and since the weekly sales were
recorded in thousands, then we rewrite this as 151.7 to 2,488.22. In other words, we can be 98%
confident that the difference between average weekly demand for the new item is at the minimum,
151.7 units more than the regular item.

Look at how wide the width of this interval is, you may not like the width of this interval. This is in
part because of the desired level of confidence we asked for. Remember that the larger the level
of confidence, the wider this interval will be. But by and large, we expect this new item to sell
better than the regular item we checked against.

Let's Practice - Slide 52

A training program promises to increase the sales performance for most employees. The manager
of the sales department sends 80 of his employees to be trained through this program. If the
results are shown to be better, at 5% level of significance, than a control group selected at
random, then everyone will be put through the program.

State the null and alternative hypothesis for this problem.

Group 1: Control group

μ1 : average weekly sales of the control group

Group 2: Trained Employees

μ2 : average weekly sales of the employees who went through the training
Transcript

So, now let's practice. A training program promises to increase the sales performance for most
employees. The manager of sales department sends 80 of his employees to be trained through
this program. If the results are shown to be better at 5% level significance, then a control group
selected at random, then everyone will be put through the program. State the null and alternate
hypothesis for this problem.

Let's set μ one to represent the average weekly sales for the control group and μ two represent
the weekly sales for those employees who got the training.

Example Null Hypothesis - Slide 53

A training program promises to increase the sales performance for most employees. The manager
of the sales department sends 80 of his employees to be trained through this program. IF the
results are shown to be better, at 5% level of significance, than a control group selected at
random, then everyone will be put through the program.

State the null and alternative hypotheses for this problem.

μ1 : average weekly sales of the control group

μ2 : average weekly sales of the employees who went through the training

1. H0 : μ1 − μ2 = 0 and HA : μ1 − μ2 ≠ 0

2. H0 : μ1 − μ2 ≥ 0 and HA : μ1 − μ2 < 0

3. H0 : μ 1 − μ 2 ≤ 0

Transcript

No instruction provided on this slide


Let's Practice - Solved - Slide 54

A training program promises to increase the sales performance for most employees.

μ1 :  average weekly sales of the control group

μ2 :  average weekly sales of the employees who went through the training

H0 : μ 1 ≥ μ 2 → H0 : μ 1 − μ 2 ≥ 0

HA : μ 1 < μ 2 → H0 : μ 1 − μ 2 ≤ 0

Transcript

Since the training program promises to increase the sales performance for most employees, then
we want our data to show that μ one will be less than μ two. So, that is our alternate hypothesis
and the compliment will be the null.

Let's Practice - Slide 55

H0 : μ 1 ≥ μ 2

HA : μ 1 < μ 2

Training program results


Group 1 (Control Group) Group 2 (Newly Trained)
Mean 1419.580645 1664.575
Variance 69082.15919 67313.69051
Observations 93 80
Hypothesized Mean Difference 0
df 168
t-stat −6.155248397
P(T ≤ t) one-tail 2.66462E-09
T critical one-tail 1.653974208
P(T ≤ t) two-tail 5.32925E-09
T critical two-tail 1.974185191

Transcript

Now, the data has been analyzed and is presented here. What is your conclusion at 5% level of
significance?

Example Table - Slide 56

The data has been analyzed and is presented here. What is your conclusion at 5% level of
significance? (See the data of the table from Slide 55 - Let's Practice.)

1. Reject the null hypothesis


2. Not reject the null hypothesis

Transcript

No instruction provided on this slide

Let's Practice - Solved - Slide 57

H0 : μ 1 ≥ μ 2
HA : μ 1 < μ 2

The slide contains the Training program results table from Slide 55 - Let's Practice with the P(T ≤
t) one-tail row highlighted. Since the value (2.66462E-09) of this statistic is smaller than 0.05, the
null hypothesis (H0 ) is rejected.

Transcript

This is a one-tail test. At 5% level of significance, p-value for seeing a result like this is very small,
which will lead us to reject the null hypothesis in favor of the alternate.

It does appear that the training has helped the sales agent to become more effective. Managers
should consider the training program for everyone.

Let's Practice - Slide 58

The training program costs a lot of money. Before deciding to commit to this program, the
manager wants to know the difference in weekly sales to expect from this training. Develop the
90% confidence interval for the difference.

Transcript

Now, let's extend on this. The training program costs a lot of money. Before deciding to commit to
this program, the manager wants to know the difference in weekly sales one can expect from this
training. Now recall, that for confidence interval, the 5% will be in both tails, thus our confidence
interval we track right here will be a 90% confidence interval. So, now develop the 90%
confidence interval for the difference.

Use this output for calculating the 90% confidence interval.


Let's Practice - Solved - Slide 59

The slide contains the Training program results table from Slide 55 - Let's Practice. In addition, the
following formula is presented:

For Newly Trained Mean: x̄1 − x̄2 = 1419.58 − 1664.58 = −245


For t- critical one-tail: t = 1.654
α

69082.16
Standard Error: √ 93
+
67313.69

80
= 39.8

90% confidence interval: [−245 ± 65.83] = [−310.83, −179.17]

Transcript

Again, for the confidence interval, the 5% will be in both tails, thus the confidence we calculate
here is 90%. Using the output for calculating the 90% confidence interval, first here's the
difference between these two samples, here's the t of α over 2 and here is the standard error and
now we can calculate the margin of error to be 65.83, which makes the 90% confidence interval to
be negative 310.83 to negative 179.17.

What Does It Mean? - Slide 60

90% confidence interval: [−310.83, −179.17]

The employees who didn’t get the training have a lower volume of sales, on average, in terms of
dollars.

The true difference (90% confidence level) is between $179.17 to $310.83 less compared to the
group who received training.
Transcript

So, what exactly does this mean? Recall that this is the average differences between the first
group, our control group, and the trained group. The control group on average had lower sales
than the trained group. That's why we are considering doing the training, but the management
wanted to have a sense of what the difference can be before committing any resources to this. In
this case, the control group average sales is less than the trained group and the true value, the
90% level of confidence is somewhere between $179.17 to $310.83.

What if the manager thinks that while this is good, it is not good enough to justify the cost. Could
we test the hypothesis where we look for a certain level of difference rather than doing it this way?
The answer to that is, yes. And that is what we will learn how to do in the next lesson.

Lesson 2-2.2 One-Tail Test of the Means in Excel


Media Player for Video

Excel Worksheet (1 of 8) - Slide 61

A fast food company is considering a new lunch item. The company will choose the item based on
test market results. The item should show a higher weekly demand than one of the regular items
on the menu. The analysis needs to show a difference at 0.01 level of significance to be selected.

Transcript

The fast food company is considering a new lunch item. The company will choose the item based
on test market results. The item should show a higher weekly demand than one of the regular
items on the menu. The analysis needs to show a difference at .01 level of significance to be
selected. So, we're going to do a hypothesis testing to see whether or not this new item is indeed
– has a higher demand than the regular item it's being benchmarked against.
Excel Worksheet (2 of 8) - Slide 62

The slide contains the same information as the one presented in Slide 61 - Excel Worksheet (1 of
8). In addition, there is some information presented as follow:

H0 :  μNew ≤ μCurrent → μNew − μCurrent ≤ 0

HA :  μNew > μCurrent → μNew − μCurrent > 0

Transcript

First thing to do is to write our hypothesis. So, in this case, we will select this new item if it has an
average. So, μ of the new item is more than the μ of the current item that we are benchmarking it
against. Therefore, the null hypothesis should be that it's actually either less or the same as the
current. Now once I have it written this way, I know that we're looking for μ of the new minus μ of
the current is less than or equal to zero. And the alternate is the other way around: μ minus
current is greater than zero.

Excel Worksheet (3 of 8) - Slide 63

The slide contains the t-test two sample assuming unequal variances pop-up window, found by
going to the Data tab in the main menu, choosing Data Analysis, and selecting t-test: two sample
assuming unequal variance. The window consists of two sections: Input and Output. In the Input
section, the Variable 1 range is $A$A, the Variable 2 range is $B$B, the Labels option is selected,
and Alpha is set to 0.05. In the Output section, New worksheet ply is selected.

Download the Fast Food Item Excel file (Refer to Data - First worksheet)
Transcript

So, now that we know we are doing this, we know that we are doing a one-tailed test. And we are
right now looking at the differences of being zero. So, let's go to our data. And in our data, we see
that we have recorded weekly demands, so these are in thousands. So, when I say 17, it means
that's 17,000 for that particular time period.

So, we have collected data for new item and regular item and now we can do the analysis. So, go
to data, data analysis, select the t-test two sample assuming unequal variances. Variable one is in
column A, variable two is in column B. Hypothesis difference right now is zero. I'm going to say
that I have labels. I'm going to change my alpha level to .01, and I'm going to select the output
range. Click here then click here and press okay.

Excel Worksheet (4 of 8) - Slide 64

Item sales results


New Item Regular Item
Mean 17.50666667 16.19444444
Variance 4.037117117 620.86838006
Observations 75 108
Hypothesized Mean Difference 0
df 157
t-stat 2.640045854
P(T ≤ t) one-tail 0.004563106
T critical one-tail 2.350333732
P(T ≤ t) two-tail 0.009126212
T critical two-tail 2.607506474

The p(T ≤ t) one-tail and t critical one-tail rows are highlighted.

p(T ≤ t) one-tail value (0.0045) is smaller than 0.05, the null hypothesis is rejected.

Transcript

Okay, so here's our output from our analysis. And what we are looking for is a one-tail test. So, we
have to focus on the one-tail test. And that answer is right here. So, we are going to focus our
attention in a one-tail test. And this is the information I'm looking at, and specifically on a p. And
we see that our p is less than the α of .01, so we'll end up rejecting the null hypothesis. And what
was the null hypothesis? The null hypothesis was that these two items sell about the same. So,
we are rejecting the null, which means the new item has a higher demand than the current item.
Excel Worksheet (5 of 8) - Slide 65

The slide contains the Item sales results table from Slide 64 - Excel Worksheet (4 of 8).

The following data has been added below the table: diff mean: 1.312222222, and t-value:
2.350333732.
2 2
s s
Margin of error formula: (x̄1 − x̄2 )±t α √
n1
1
+
n2
2
.
2

Transcript

Now we can go ahead and actually calculate that difference. Using the equation that we have, the
difference between the means, it's simply the difference between this mean minus this mean.

Excel Worksheet (6 of 8) - Slide 66

The slide contains the same data presented on Slide 65 - Excel Worksheet (5 of 8) with the t
critical one-tail value (2.3503) highlighted.

To the right of the table is a bell curve with mean 0. The t critical values 2.35 and −2.35 are
marked with two vertical lines on the distribution plot, which represent the 98%. Outside the range,
there is 1% to the right and 1% to the left.

Transcript

So, on average, there is about 1.31 in thousands higher demand for new item versus the regular
item. But this is just the middle of my confidence interval. I need to come up with a confidence
interval, for that, I need my t-value.
Let me explain to you that if I use this t-value, what I'm going to get is actually the 98% confidence
interval. This t-value is .01, right, and a one-tail, which means I have the entire .01 here. And if I
have .01 here, that means that you are 2.35 standard errors away from that hypothesis mean
difference of zero. If I use the same t-value, remember confidence interval is a two-sided value
that you get. You get something plus and minus the mean. So, there is a .01 also here. And that is
negative 2.35. So, if I use this, then I am talking about the 98% confidence interval. There is a .01
on this tail and there is a .01 on this tail. So now we can calculate the standard error.

Excel Worksheet (7 of 8) - Slide 67

The slide contains the same data presented on Slide 65 - Excel Worksheet (5 of 8).

The label: standard error was added; next to this label, the formula =sqrt(F7/F8+G7/G8) is being
used, where F7 is New item variance, F8 is New item observations, G7 is Regular item variance,
and G8 is Regular item observations.

Transcript

Standard error is what you see in the equation, which is the square root of variance for the first
variable divided by the sample size for that, and here it's 75, plus variance for the regular item
divided by the sample size that we have for regular item. And, again, if you notice here, I have
different sample sizes. And, as I have mentioned before, you're okay with that. We don't need to
have same.

Excel Worksheet (8 of 8) - Slide 68

Item sales results - Complete


New Item Regular Item
Mean 17.50666667 16.19444444
Variance 4.037117117 620.86838006
Observations 75 108
Hypothesized Mean Difference 0
df 157
t-stat 2.640045854
P(T ≤ t) one-tail 0.004563106
T critical one-tail 2.350333732
P(T ≤ t) two-tail 0.009126212
T critical two-tail 2.607506474
diff mean 1.312222222
t-value 2.350333732
standard error 0.497045239
Margin of error 1.168222192
Lower 0.144000031 144.0000306
Upper 2.480444414 2480.444414

Download the Fast Food Item Excel file (Refer to T test 2 Sample - Second worksheet)

Transcript

So, this is the standard error. So now the margin of error is simply the t-value multiplied by the
standard error. So, this is the second term in that equation.

So now we are ready to calculate the lower bound and upper bound of the 98% confidence
interval, which is the mean difference minus the margin of error and the mean difference plus the
margin of error. And we can make our life much simpler if I take this value and multiply it by 1,000
when I'm talking to people about what we have gotten from our analysis.

What our analysis has shown is that the new item will sell more than the regular item. And it can
sell by as much as 144 or as much as 2480 or anything in between. So, the confidence interval
here is quite large. This seems to be a really, really good addition if this was true, whereas this
might not be as economical because there's a lot of cost that goes along with introducing a new
item into the menu. It can be any value in here. And this might be a little too wide for management
to have useful information when it comes to making a decision based on the data that you have.
They may ask you to improve the accuracy. And, as you know, that comes with increasing the
sample size. So right now, management might feel uncomfortable when you show something that
is this wide.
Lesson 2-3 Testing for a Specific Value in Means

Lesson 2-3.1 Testing for a Specific Value in Means


Media Player for Video

Example - Slide 69

A company’s contract with its maintenance supplier is coming to an end, and it is considering
another company as a possible replacement. Currently, there are some complaints about the time
it takes the current supplier to fix the problems that get reported to them. The new company is
more expensive ($200,000 additional annual cost), but it promises a faster response time.

Should the company switch its supplier?

Transcript

So far, we have looked at comparing two populations where the hypothesized mean difference
has been zero. But what if we were looking for a minimum level difference? How do we test then?
Let me show you how by taking you through this example.

A company's contract with its maintenance supplier is coming to an end and it's considering
another company as a possible replacement. Currently, there are some complaints about the time
it takes the current supplier to fix the problems that get reported to them. The new company is
more expensive, $200,000 additional annual cost, but it promises a faster response time. Should
the company switch their supplier?
Comparing the Two Suppliers (1 of 7) - Slide 70

Difference in the mean time it takes the current supplier to fix problems versus the new supplier.

Let’s call:

The current supplier: Supplier A

The new supplier: Supplier B

μA :  Mean time for Supplier A

μB :  Mean time for Supplier B

Transcript

It says here we are concerned about the mean time to fix the problem. We can frame the problem
as the difference between the two populations. Let's call the current supplier they have Supplier A
and the new supplier being considered Supplier B.

Then μ sub A represents the mean time taken by Supplier A to fix the problem and μ sub B
represents the mean time it takes for Supplier B to fix the problem.

Comparing the Two Suppliers (2 of 7) - Slide 71

Step 1- State the Hypotheses

In order to justify the additional cost for supplier B, the management wants a reduction of at least
5 hours in the repair time.

μB ≤ μA − 5
H0 :  μA − μB ≥ 5

HA :  μA − μB < 5

Transcript

In order to justify the additional cost for Supplier B, management wants a reduction of at least five
hours in the repair time. This five-hour reduction is calculated from the time the problem is
reported to when the problem is resolved. Is that really the case?

So, now we need to collect data to settle this question, then we can answer this question with a
hypothesis test about the mean differences between the two suppliers. This is Step 1.

Here, just as before, the owners will be on Supplier B to show that indeed they are that much
better than Supplier A. If you look at the problem, this is what we want Supplier B to show, that is
their average time will be less than the average time of Supplier A by five hours or less than five
hours. Now, the equality sign has to be in the null so we get the following as the null and the
alternate hypothesis.

Look at the null hypothesis closely, it states that the average time for fixing the problem for
Supplier A as compared to average time for Supplier B will be five hours or more. Otherwise, we
have no reason to believe that they will be faster by this much and thus worth the additional cost.
Once you have the null and the alternate hypothesis will be its compliment and just as before, we
classify this as a one-tail test. If a test for equal versus not equal, then we would have a two-tail
test.

Comparing the Two Suppliers (3 of 7) - Slide 72

Step 2 - State the Level of Significance

H0 :  μA − μB ≥ 5

HA :  μA − μB < 5

α = 0.05

Transcript

The management wants to check on this at 5% level of significance.


Comparing the Two Suppliers (4 of 7) - Slide 73

Data for Comparison

Random independently from two populations

Transcript

Before we can move on to Step 3, we need to have data for comparing these two suppliers,
collecting data at random and independently for each supplier. One way would be if you have a
log of elapsed times from your current supplier and this log should be large enough that includes
some trivial problems as well as some complicated problems. Then selecting a large sample will
make it more likely that you have a good representative sample.

Then from the new supplier, you can ask for similar data, maybe a data of their times for one of
their customers with similar business and volume as yours. Then you take a large sample from
that as well. While this step is really important issue, the technical aspects of this step is beyond
the scope of our course. We will assume here that we have access to representative sample data
that has been collected at random and independently from each population.

Comparing the Two Suppliers (5 of 7) - Slide 74

Step 3 - Calculate the p-Value

The p-value can be found by knowing how many standard errors separate an estimate from the
null hypothesis.
( x̄1 −x̄2 ) −D0
t =
2 2
s s
1 2
√ +
n n
1 2
Transcript

Like before, the p-value is going to be the probability of a finding of sample results like the one we
found. This probability, which we call p-value, can be found by knowing how many standard errors
separates our sample differences from the hypothesized difference, which we refer to as the test
statistics denoted by t.

We have done this in earlier lessons. The difference in this lesson is the value of zero. Till now, all
of our examples have this difference set to zero. Now we will set it to be a specific value, in this
particular case, it will be 5. Again, we are not going to do this manually. We will use Excel. But
now, we have to enter this number as the hypothesized difference.

Comparing the Two Suppliers (6 of 7) - Slide 75

Excel Results

t-Test: Two Sample Assuming Unequal Variances - Supplier A/B


Supplier A (hrs) Supplier B (hrs)
Mean 23.422222222 22.025
Variance 21.439801 20.29348739
Observations 135 120
Hypothesized Mean Difference 5
df 251
t-stat −6.291435152
P(T ≤ t) one-tail 6.95E-10
T critical one-tail 1.650947025
P(T ≤ t) two-tail 1.39019E-09
T critical two-tail 1.969460227

Transcript

Look closely and you will see that we have entered the value of 5 as the hypothesized mean
difference. Based on this result, the mean time for Supplier A for fixing the problem is 23.42 and
for Supplier B is 22.05. So, Supplier B is faster than Supplier A, but are they fast enough for us?

We were looking for differences of 5 or more. The t-value for how far is the difference that we
observe from the hypothesized of 5 is negative 6.29. You should just know that at 5% of
significance, which is 95% confidence level, we can't be more than two standard errors away, but
we are. So, what is the probability of observing what we have? It is practically zero. So now, let's
go back to our formulation and make a decision.

Comparing the Two Suppliers (7 of 7) - Slide 76

Step 4 - Reject or Not Reject

H0 :  μA − μB ≥ 5

HA :  μA − μB < 5

α = 0.05

P-value is 0.000000000695097

p < α → Reject the Null Hypothesis

Transcript

Looking at the p-value, which is extremely small, then we reject the null hypothesis. This means
that Supplier B has failed to show us that we can reduce the repair time by at least five hours so
that we can justify the additional cost of contract. So, if you have a minimum value, we can enter it
and test the difference against this value.
Lesson 2-4 Paired Tests

Lesson 2-4.1 Paired Tests


Media Player for Video

Paired Difference Experiments (1 of 3) - Slide 77

1. Draw one random sample of units and use those units to compare two different treatments. Ask
subjects to try two products and then rate them.

Transcript

Up to now, we have discussed trying two different examples from two different populations. We
will now look at pairing up the samples, this is also known as dependent samples or match
samples. So, what will be the difference in these experiments?

In a paired difference experiment, we draw a single sample, then we can apply two different
treatments to the same sample and record the results from each treatment. For example, ask
subjects to taste two products and rate them both,

Paired Difference Experiments (2 of 3) - Slide 78

2. Draw one random sample of units, apply a single treatment, and compare the before and after
results. Ask subjects to go through training and compare their productivity before and after the
training.
Transcript

or we can apply a single treatment and compare the subjects before and after. For instance, to
assess the effectiveness of training, ask subjects to go through a training and compare their
productivity before and after the training,

Paired Difference Experiments (3 of 3) - Slide 79

3. Draw two samples that are matched on one or more characteristics. Then, compare the
experimental results between the matched groups. Every member of group one is matched with a
child with similar reading abilities to be included in group two. Teach each group with a different
method, and then analyze their differences.

Transcript

or we can draw two samples and match them on certain dimensions and for a given treatment,
compare the results between these two matched samples.

For example, the test, the effectiveness of the reading program, select two groups of children, for
every member of group one is matched with a person with similar reading abilities to be included
in group two, and then teach each group with a different method and analyze their differences.

What you see under these three scenarios presented here is that the two data samples been
compare were not develop independently of one and other, thus we would need to do our analysis
differently than what we have done so far, where we only had independent populations and
samples.

Product Testing - Slide 80


A company is considering two designs for its product. Focus groups across the nation are used to
see if one design ranks higher than the other design. The participants are asked to rate two
products on many dimensions. The results of the ratings are aggregated as a score (100 is the
highest and 0 is the lowest). The analysis is to be done at 1% level of significance to see if one
design outperforms the other.

Transcript

Let's begin with an example: a company is considering two designs for its product, focus groups
across the nation are used to see if one design ranks higher than the other design. The
participants are asked to rate two products on many dimensions. The results of the ratings are
aggregated as a score, 100 is the highest and zero is the lowest. The analysis is to be done at 1%
level of significance to see if one design outperforms the other.

So, the scenario just presented is an example of a pair testing, if we were doing independent test
we would give one product to one sample and other product to a different sample, which would
have been selected randomly and dependently of the first sample. By doing a paired sample, we
were controlling for possible variations that we may get in each sample if they were independently
chosen. For instance, if you have people that were easy to please in one sample as compared to
the other sample. In paired sample, we will be looking for differences of score in each participant
and that is why our way of analyzing the data will be difference than before.

Paired Testing - Slide 81

They hypothesis is about the difference between paired values: d = x1 − x2

Paired testing
H0 HA Type
μd = D μd ≠ D Two-tail

μd ≥ D μd < D One-tail

μd ≤ D μd > D One-tail

Transcript

So, as I just said, in paired testing, we're looking for differences of score in each participant, so
the hypothesis is about this difference. So, every participant will record different for the first and
the second variable. So, the possible sets of hypotheses will be all about this difference; μ of d
versus some hypothesized difference denoted by the capital D.
Product Testing - Slide 82

H0 :  μd = 0

HA :  μd ≠ 0

α = 0.05

Transcript

Now, back to our example: we were testing two products, let's call them product A and product B.
We started off with no clear conceived idea about superiority of one versus the other, so we can
go ahead and assume that they will score about the same. Thus, the null hypothesis will be that
the main difference in rating for both products will be zero, and the alternate will say that is not.
We are testing these hypothesis at 0.05 level of significance.

Product Testing: Excel Results (1 of 4) - Slide 83

t-Test: Paired Two Sample for Means - Product A/B


Product A Product B
Mean 61.752 57.312
Variance 538.1310201 542.9785703
Observations 250 250
Pearson Correlation −0.063074728
Hypothesized Mean Difference 0
df 249
t-stat 2.070791373
P(T ≤ t) one-tail 0.019704445
T critical one-tail 1.6509996152
P(T ≤ t) two-tail 0.03940889
T critical two-tail 1.969536868

H0 : μ d = 0

HA : μ d ≠ 0

α = 0.05

¯
d −D0
t-stat: t = s
d
/
√n

Transcript

Fortunately, we can do the analysis with Excel, which will give the following results. As you can
see, we rounded data through a paired test. The process of rejecting or not rejecting the null
hypothesis is done just as we did before; however, because the testing is done using a paired
test, the t-statistics from which we will find the p-value is found by using the equation you see
here. Now, we can move on to the decision making.

Product Testing: Excel Results (2 of 4) - Slide 84

The slide contains the t-Test: Paired Two Sample for Means table from Slide 83 - Product Testing:
Excel Results (1 of 4) with the P(T ≤ t) two-tail row highlighted.

The value (0.03940889) of this statistic is smaller than 0.05, therefore, the null hypothesis is
rejected.

Transcript

Since we are testing for equality, then this is a two-tail test and we will look at the p-value for the
two-tails, which is about 0.04 and that it's less than 0.05, and thus, we will reject the null
hypothesis.
Product Testing: Excel Results (3 of 4) - Slide 85

H0 : μ d = 0

HA : μ d ≠ 0

α = 0.05

p value = 0.04 < 0.05 → Reject H0

At 5% level of significance the mean ratings for the two products are different.

Transcript

Rejecting the null hypothesis, in plain English, will be that at 5% above significance, the mean
ratings for the two products are different. Well, great! Can we tell from the output which product
did better? The answer to that is yes. Let's look back at the Excel output now.

Product Testing: Excel Results (4 of 4) - Slide 86

The slide contains the t-Test: Paired Two Sample for Means table from Slide 83 - Product Testing:
Excel Results (1 of 4) with the P (T ≤ t) one-tail row highlighted.

The value (0.019704445) of this statistic is smaller than 0.05, therefore, the null hypothesis is
rejected.

H0 : μ d ≤0

HA : μ d >0

α = 0.05
Transcript

Focusing on the mean scores of product A and product B, we can see that the product A scored
better, and we just concluded the difference is significant, that's why they reject the null
hypothesis that they are about the same. If we had started our analysis with the belief that product
A is the better product, then we would have expressed our alternative hypothesis, such that it will
show the disbelief, and this means expressing it as such.

The average rating difference between product A and product B is greater than 0 and the
compliment for the null. In this case, we would have use the p-value of one-tail test, which is 0.019
and that is less than α and we will reject the null hypothesis. Again, meaning that product A is a
better product as compared to B.

Now that you know A is better, you may want to know by how much; to answer this question we
need to develop the confidence interval.

How Much Better? (1 of 2) - Slide 87

The slide contains the t-Test: Paired Two Sample for Means table from Slide 83 - Product Testing:
Excel Results (1 of 4).
Sd
¯
d ± tα
2 √n

¯
d =(61.75 − 57.31)= 4. 44

tα = 1.65
2

Sd = 33.901

Sd 33.901
= = 2.144
√n √250

Transcript

In this case that will be based on this new equation. Again, it is different from before because it is
for a paired test. From the Excel output we will get the mean difference to be 4.44, the t of α over
2 is 1.65, we need to calculate the standard deviation of the differences separately. This is not
done in Excel automatically, I have done this and found it to be 33.901. You can watch the Excel
video demonstration to know exactly how I got this value. Now, we can calculate the standard
error, which is 2.144. Now, we are ready to calculate the margin of error and then confidence
interval for the mean differences.
How Much Better? (2 of 2) - Slide 88

Sd
¯
d ± tα
2 √n

¯
d =(61.75 − 57.31)= 4.44

tα = 1.65
2

Sd 33.901
= = 2.144
√n √250

Margin of error = 1.65 × 2.144 = 3.54

90% interval = 4.44 ± 3.54 = [.90, 7.9799]

Transcript

Margin of error is found by multiplying the critical value with the standard error, which give us 3.54,
then the 90% confidence interval will be 0.90 to about 7.98. This means we can be 90% confident
that the true difference is between 0.90 and 7.98, for the ratings of these two products.

Let's Practice - Slide 89

To know whether or not students will perform better at a standardized test after completing a
preparatory class, a group of 65 students are given a test before and then again after having gone
through the training. Test the claim at 5% level of significance.

What are the null and alternate hypotheses?


Transcript

Now, let's practice. To know whether or not students will perform better at a standardized test after
completing a preparatory class, a group of 65 students are given a test before and then again
after having gone through the training. Test the claim at 5% level of significance. What are the null
and alternate hypotheses?

Example Null Hypothesis - Slide 90

To know whether or not students will perform better at a standardized test after completing a
preparatory class, a group of 65 students are given a test before and then again after having gone
through the training. Test the claim at 5% level of significance.

What are the null and alternate hypotheses?

1. H0 : μd = 0 and HA :  μd ≠ 0

2. H0 : μd ≥ 0 and HA :  μd < 0

3. H0 : μd ≤ 0 and HA :  μd > 0

Transcript

No instruction provided on this slide

Let's Practice - Solved - Slide 91

H0 : μ d ≤0

HA : μ d >0

α = 0.05
Transcript

Since we are testing the same student, pre and post training, this is a paired example: the test
claims that the students will score, will increase, and that is the alternate hypothesis.

So, this is the null hypothesis, and that will be that the difference will be zero or less. Testing at
5% level of significance, we run the data and the output shows the following.

Let's Practice - Slide 92

t-Test: Paired Two Sample for Means - Pre/Post


Pre-Training Score Post- Training Score
Mean 500.9692308 548.6
Variance 7243.936538 6584.93125
Observations 65 65
Pearson Correlation 0.099719694
Hypothesized Mean Difference 0
df 64
t-stat −3.441396891
P(T ≤ t) one-tail 0.000512213
T critical one-tail 1.669013025
P(T ≤ t) two-tail 0.001024426
T critical two-tail 1.997729654

Transcript

What is your conclusion? Will the training help students do better on the test?
Let's Practice - Solved - Slide 93

H0 :  μd ≤0

HA :  μd >0

α = 0.05

The slide contains the t-Test: Paired Two Sample for Means table from Slide 92 - Let's Practice
with the P (T ≤ t) one-tail row highlighted.

The value (0.000512213) of this statistic is smaller than 0.05, therefore, the null hypothesis is
rejected.

Transcript

The p-value of 0.0005 is less than 0.05, which will result in rejecting the null hypothesis. Based on
this data, we can conclude that the mean test scores after the training will be greater than pre-
training at 5% level of significance. Whenever possible, one should use the paired test.

Paired Tests - Slide 94

Using the same individuals eliminates any differences in the individuals themselves and allows for
comparison of the results from the two processes.

We can conduct paired tests by using different individuals as long as the subjects being compared
are matched on some characteristics
Transcript

Using the same individuals eliminates any differences in the individuals themselves and allows for
comparison of the results from the two processes. We can also conduct paired test by using
different individuals as long as the subjects being compared are matched on some characteristics.

The advantage that paired sample has is the ability to control for variability and in comparison, to
independent samples, this will resolve in two major advantages: one is that we can use smaller
sample sizes for our studies and second, the results are more reliable. So, whenever possible, opt
for paired test.

Lesson 2-4.2 Paired Test in Excel


Media Player for Video

Excel Worksheet (1 of 13) - Slide 95

To know whether or not students will perform better at a standardized test after completing a
preparatory class, a group of 65 students are given a test before and then again after having gone
through the training. Test the claim at 5% level of significance.

Transcript

To know whether or not students will perform better at a standardized test after completing a
preparatory class, a group of 65 students are given a test before and then again after having gone
through the training. So, we want to test this claim at 5% level of significance.

This is an example of a paired test because the same people are being given a pre-test, then they
go to a training and then they're given a post-test. We are not comparing two different groups, one
has been trained and the other one has not been trained, it is the same individuals. This makes it
a paired test. And paired tests, by and large, are stronger tests when you're looking for
differences. So, when you're doing this, the hypothesis is just only about the mean difference,
nothing else. Now, in this case, they're saying that the difference would be better.
Excel Worksheet (2 of 13) - Slide 96

The slide contains the same information as presented in Slide 95 - Excel Worksheet (1 of 13). In
addition, the following equations are presented:

H0 :  μd ≤ 0

HA :  μd > 0

Transcript

So, what they're saying is that alternative is that the average difference after going to through the
test is going to be greater than zero, which means that null is that that difference is either zero or
less. So, we're going to test this at 5% level of significance. So, let's see how we would do this
differently using Excel Data Analysis.

Excel Worksheet (3 of 13) - Slide 97

The slide contains the Pre/Post training data set. The data includes three columns: student
numbers, Pre-training score, and Post-training score.

Download the Paired Test Score Excel file (Refer to Data - First worksheet)

Transcript

So, here we are and these are the test scores when the students went through pre-training and
after training. So, each student has a score that is before they went through the training and after
the have gone through training, so, we are going to test these values, the ones that are in column
B and column C.
Excel Worksheet (4 of 13) - Slide 98

The slide contains the Data Analysis pop-up window.

Transcript

So, we go to data, we go to data analysis. Just like before, however, this time we're going to scroll
down and look for the "t-Test Paired Two Samples for Means". So, not the one that's been used
before, so this is the one that we will use the paired two sample for means. So, click ok, the rest of
it is going to look very similar to what we were doing before.

Excel Worksheet (5 of 13) - Slide 99

The slide contains the t-test paired two sample for means pop-up window. Found by going to the
Data tab in the main menu, choosing the Data Analysis, and selecting the t-test: paired two
sample for means option. The window consists of two sections: Input and Output. In the Input
section, the Variable 1 range is $B$B, the Variable 2 range is $C$C, the hypothesized mean
difference is 0, the Labels box option is selected, and Alpha is set to 0.05. In the Output section,
the Output range option is selected and filled with $F$2.

Transcript

Input for variable one is in column B, this is before, and this is the after-test scores, variable two.
I'm going to mention that I have a label and then here I'm going to put a zero. Now, I could have
also given you a value here to test. I could have said the test score goes up at least by 10 points
and that's what you have put here. α is 0.05 and I'm going to output range here, click here and
then I just am going to put it somewhere here.
Excel Worksheet (6 of 13) - Slide 100

The slide contains the data from the t-Test: Paired Two Sample for Means table from Slide 92 -
Let's Practice with the one-tail value (0.0045) highlighted.

Since this value is smaller than 0.05, the null hypothesis is rejected.

Transcript

So, here's our output, one of the things that you notice right away is that right up here it says that
this is a t-test for a paired two sample. And of course, in a paired two sample, we have to have
exactly the same sample size, that's a given because the same people are being tested in pre-test
and after test.

So, now we can say whether or not we have the same test scores or not. So, in our problem, we
had said that it would be greater than zero, which means that this is a one-tail test. So, we are
going to focus on the one-tail test, and that is right here. And this value is extremely small,
definitely smaller than 0.05, so we will reject the null hypothesis, which means what?

A null hypothesis was that the difference would be less than or zero. We will accept the fact that
based on our data, the training seems to increase the test scores for these students. nce again,
we can use the information that we have here to even given what is the confidence interval for the
differences in the means.

Excel Worksheet (7 of 13) - Slide 101

The slide contains the same data from the t-Test: Paired Two Sample for Means table from Slide
92 - Let's Practice
The label: diff mean has been added; next to the label, the formula =H5-G5 is being used, where
H5 is Post-training mean and G5 is Pre-training mean.
Sd
¯
d ± tα .
2 √n

Transcript

So, looking at the equation for the confidence interval, first of all, I need to find out what is the
difference that I see in the means right now and that is relatively simple. I'm going to find the
difference in the mean by taking post-training minus pre-training. Again, it doesn't really make a
difference, but I like to talk about how much we expect the test score to go up, it would be easier
to communicate here.

Excel Worksheet (8 of 13) - Slide 102

The slide contains the same data presented on Slide 101 - Excel Worksheet (7 of 13).

A new label: t-value is added.

Transcript

Then we have the t-value. Now, we did a one-tail test and if I want to use that one-tail test, and for
that, I use the t-value that I see here, this is going to result in the 90% confidence interval.

Excel Worksheet (9 of 13) - Slide 103

The slide contains the same data presented on Slide 101 - Excel Worksheet (7 of 13).

The diff mean now reads: 47.63076923 and the t-value reads: 1.669013025.
To the right of the table, there is a bell curve, where the t critical value for one-tail test (1.669 and
−1.669) is marked with two vertical lines in the plot. Outside the range there is 5% to the right and
5% to the left.

Transcript

Let me again remind you why that is. For a one-tail test, the entire 5% is on one-tail and this is a
value of 1.669, which is what you see right here. We will have the same on the other side because
again confidence interval is going to have a margin of error that is going to be added and
subtracted from it, so we can make a mistake on either end, and there is a 5% chance on either
side. So, if these are 5%, the confidence interval that you're coming up with is going to be a 90%
confidence interval.

So, this t-value, this t of α over 2 is going to be for 90% confidence interval. Now, then the
equation asks for standard deviation of the differences and that part we cannot get from the output
directly, I'm going to have to calculate this, and that's what I'm going to do.

Excel Worksheet (10 of 13) - Slide 104

The slide contains the same data presented on Slide 97 - Excel Worksheet (3 of 13).

A new column labeled "diff" has been placed to the right of the Pre/Post training data set. The
values for this column are filled using the formula: =B2-C2.

Transcript

So, let's go back to the data, which is right here. I'm going to create a column here called
differences. And the differences are just going to be simply for each student, what was the
difference between their score before and after. So, it's the difference between pre-training minus
post-training. Again, it will not make a difference which one you subtract from which, because we
are going to use this column for finding out the standard deviation of the differences so it doesn't
make a difference, so it doesn't make a difference.
Excel Worksheet (11 of 13) - Slide 105

The slide contains the same data presented on Slide 101 - Excel Worksheet (7 of 13).

A new label: std dev of diff is added; next to this label, the formula =STDEV.S(D2,…) is used. The
other values of the function and included by holding Ctrl + Shift + down arrow to select all the
values of the diff column.

Transcript

So, then now that you have it for one, just put your cursor in the corner when you see the plus
sign, double click and the entire thing will be picked up. To find the standard deviation for the
values that you see in this column, column D is what we want, standard deviation of the
differences. Then it's simply stdev.s which we have been using all along of the values you see
from here all the way to the 65th student, close the parentheses and press return. So, the
standard deviation of differences here is 111.58.

Excel Worksheet (12 of 13) - Slide 106

The slide contains the same data presented on Slide 105 - Excel Worksheet (11 of 13).

A new label: margin of error, is added; next to the label, the formula =G18*(G19/sqrt(G7)) is used,
where G18 is 1.669 (t-value), G19 is std dev of diff, and G7 Observations.

Transcript

Now that I have this I can calculate the margin of error. Margin of error is simply equal to t-value
times, as you can see in the formula that you have, standard deviation of differences divided by
square root of sample size, and in this case, you can pick either one of the ones that says 65,
that's all we need. And once I write all of it out, I will find out that the margin of error is 23.1.
Excel Worksheet (13 of 13) - Slide 107

The slide contains the same data presented on Slide 105 - Excel Worksheet (11 of 13).

Two new lables: lower and upper, are added. The new labels now read:

Statistical Significance -
Training Program
Label Value
mean diff 47.63076923
t value 1.669013025
std dev of diff 111.5859491
Margin of error 23.10003082
Lower 24.53073841
Upper 70.73080005

The lower and upper rows are highlighted with the text: 90% confidence interval of diff. written
next to the table.

Download the Paired Test Score Excel file (Refer to T Test Paired 2 Sample - Second worksheet)

Transcript

So, now I can come up with the lower bound and upper bound of the confidence interval. So, the
lower bound is the mean difference minus margin of error and the upper bound is the mean
difference plus the margin of error. What you see here is your 90% confidence interval of the
differences. So, what you expect, we are 90% confident that the average score for the population
of students who will go to this training will go up by 24 points, up to 70 points. So, the difference is
somewhere between 24 and 70. Again, on the average for the student population, the increase at
the minimal will get a 24-point boost, which is not bad, and on the optimistic side is 70.
Remember, any value between 24 and 70 is a plausible value.
Lesson 2-5 Test of Proportions

Lesson 2-5.1 Test of Proportions


Media Player for Video

Comparing Two Proportions - Slide 108

The unemployment rate in April 2016 was 5%. For April of 2015 it was 5.4%.

40% of voters are expected to vote for Hillary Clinton in the May 6th primary in West Virginia vs.
46% for Bernie Sanders.

Margin of error: ± 4%

Clinton: 40% ± 4% = [36% 44%]

Sanders: 46% ± 4% = [42% 50%]

Transcript

We often are correcting, reporting or reading about the proportions of two populations, here are a
couple of examples. Employment rate is reported as the proportion of individuals in the nation who
are unemployed. So, when you look at the unemployment rate of April of 2016, you see that it is
5%. You may want to know if that number is significantly different than April 2015 when it was
5.4%.

Another example is when we here news about how political candidates may when a certain
contest. For example, if 40% are expected to vote for Hillary Clinton and 46% for Bernie Sanders,
does this mean that Hillary Clinton is expected to lose or does it mean that this a toss-up and
either one can win? In political arena, we often hear the phrase, they are in a dead heat which is
not a statistical term at all. But to public, it implies that the candidates are within the margin of
error from each other. Thus, we can't predict the outcome.

In the case of West Virginia primary election, if margin of error was 6%, that would be the case,
but if the margin of error was 4%, then even if Hillary Clinton gets the upper bound of 44% and
Bernie Sanders gets the lower bound of 42%, we can still predict that Bernie Sanders will win the
contest. But of course, we can only be 95% confident about these confidence intervals.
Tests for Proportions - Slide 109

Test for proportions


H0 HA Type
p1 = p2 p ≠ p Two-tail
1 2

p1 ≥ p2 p1 < p2 One-tail

p1 ≤ p2 p1 > p2 One-tail

Transcript

In this lesson, we will learn how to compare proportions for two samples from two independent
populations. As before, we can be testing for two proportions being the same as opposed to being
different which would be a two-tail test or testing for one proportion being equal or greater than the
other or equal or less than the other which will result in one-tail test.

Example 1 (1 of 2) - Slide 110

One study showed that both girls and boys do equally well on math tests. A school district takes a
random sample of 400 boys and another random sample of 360 girls in grade 11 and looks at their
most recent standardized test scores. The math scores of 315 of the boys and 280 of the girls
were at the proficient level. At 5% level of significance, can the school district claim that the boys
and girls do equally well on math tests?
Transcript

Consider this very common concern. Can and do girls do as well as boys in math? One study
shows that both girls and boys do equally well on math tests. A school district takes a random
sample of 400 boys and another random sample of 360 girls in grade 11 and looks at their most
recent standardized test scores. The math score of 350 of the boys and 280 of the girls were at a
proficient level. At 5% of the significance can the school district claim that the boys and the girls
do equally well on math tests?

Example 1 (2 of 2) - Slide 111

Sample 1: Boys

Sample 2: Girls

H0 : p1 = p2

HA : p1 ≠ p2

α=0.05

Transcript

Let's call sample 1 for the boys and sample 2 for the girls. This will be the hypothesis we will be
testing at 5% of the significance.

Find p-value - Slide 112

( p̂ −p̂ ) −D0
Test-statistic (z-test): z =
1

σp̂
2

−p̂
1 2
p1 ( 1−p1 ) p2 ( 1−p2 )
Standard error: σp̂ 1
−p̂ 2 = √
n1
+
n2

Transcript

Now, we need to find the p-value. To find the p-value, we need to find how far is the difference in
the proportion b observed in the two samples from the hypothesized proportion differences. The
test statistics based on our sample is denoted by z and is calculated by using this formula. The
numerator is the difference we observed among the two samples minus hypothesized difference.

This is then divided by the standard error. The standard error itself is calculated by this formula.
Now, luckily, we can automate this with Excel. However, Excel does not provide the built-in
function when it comes to population proportion and hypothesis testing. I have provided a
worksheet where you can enter your sample information and then you get the results. I will use
the output from that to discuss the concepts. And as before, of course, you can watch Excel
videos and you should later on to see how exactly I got the results that I'm sharing with you here.

Excel Output - Slide 113

Excel Output
Output Value
Sample 1 Proportion 78.75%
Sample 2 Proportion 77.78%
Proportion Difference 0.97%
Z α  (One-Tail)
2
1.64485
Z α  (Two-Tail)
2
1.95996
Standard Error 0.02997
Hypothesized Difference 0
Test Statistics (Z-Test) One-Tail (H0 : p1 − p2 ≥ 0) 0.324350049
P-value (one-tail) 0.62716
Test Statistics (Z-Test) One-Tail (H0 : p1 − p2 ≤ 0) 0.324350049
P-value (one-tail) 0.37284
Test Statistics (Z-Test) Two-Tail (H0 : p1 − p2 = 0) 0.32460345
p-value(two-tail) 0.74548

H0 :  p1 − p2 = 0

HA :  p1 − p2 ≠ 0
In the table, the Sample 1 proportion and Sample 2 proportion rows are highlighted.

Transcript

Here, sample 1 is for the boys and 315 out of 400 or about 78.75% and sample 2 are the for girls
where 280 out of 360 or about 77.78% scored at proficient level. We are testing at 5% of
significance and equality for the two groups. So, we will use the output for the two-tail tests. The
p-value is then 0.745.

Conclusion - Slide 114

One study showed that both girls and boys do equally well on math tests. A school district takes a
random sample of 400 boys and another random sample of 360 girls in grade 11 and looks at their
most recent standardized test scores. The math scores of 315 of the boys and 280 of the girls
were at the proficient level. At 5% level significance, can the school district claim that the boys and
girls do equally well on math tests?

H0 :  p1 − p2 = 0

HA :  p1 − p2 ≠ 0

α = 0.05

p value = 0.745 > 0.05 → Do not reject H0

Transcript

Since the p-value is more than 0.05, we don't reject a null hypothesis which means our samples of
boys and girls from this school district also performed equally well on the math test.
Example 2 - Slide 115

A fast food chain is testing a revised work flow. If the redesign is effective, then the process for all
locations will be revised. For this decision, data has been collected in one location under the
current design and one location under the new design. To make the new design standard, the
difference in proportion of customer orders completed within 4 minutes should be 20% higher than
it is right now.

Transcript

Now, let's consider this example where a fast food chain is testing a revised workflow. If the
redesign is effective, then the process for all locations will be revised. For this decision, data has
been collected in one location under the current design and one location under the new design. To
make the new design standard, the difference in the proportion of the customer orders completed
within 4 minutes or less, should be 20% higher than it's, it is right now.

Example 2: Data - Slide 116

For the current design, 7,600 orders out of 10,000 were completed within 4 minutes. Under the
new design, 5,400 out of 6,000 were completed within 4 minutes. What is the conclusion at 5%
level of significance?

p1 :  Proportion for the new design

p2 :  Proportion for the old design

H0 :  p1 − p2 ≤ 0.20

HA :  p1 − p2 > 0.20


Transcript

The data has been collected and for the current design, 7,600 orders out of 10,000 were
completed within 4 minutes. Under the new design, 5,400 out of 6,000 were completed within 4
minutes. What is your conclusion at the 5% level of significance. If p 1 is the proportion for sample
1 and p 2 is the proportion for sample 2 for orders that completed within 4 minutes, then the null
hypothesis is that these two designs are not more than 20% different. And the alternate will be
stated such by using the sample data could end up changing our current belief.

Excel Output - Slide 117

Excel Output - Slide 117


Output Value
Sample 1 Proportion 90%
Sample 2 Proportion 76%
Proportion Difference 14%
Z α  (One-Tail)
2
1.6449
Z α  (Two-Tail)
2
1.96
Standard Error 0.00577
Hypothesized Difference 0.2000
Test Statistics (Z-Test) One-Tail (H0 : p1 − p2 ≥ 0) −10.4069
P-value (one-tail) 0
Test Statistics (Z-Test) One-Tail (H0 : p1 − p2 ≤ 0) −10.4069
P-value (one-tail) 1
Test Statistics (Z-Test) Two-Tail (H0 : p1 − p2 = 0) 9.4136
p-value(two-tail) 0

In the table, the "Hypothesized Difference" row is highlighted.

Transcript

Here are the output from our analysis. Here, we enter the value of 20% as the hypothesized
difference and we get the p-value of 1 which is more than 0.05 and thus we will not reject the null
hypothesis.
Conclusion - Slide 118

H0 :  p1 − p2 ≤ 0.20

HA :  p1 − p2 > 0.20

p value = 1 > 0.05 → Do not reject H0

It has not been shown that the new design will improve the proportion of customer served under 4
minutes by at least 20%.

Transcript

Therefore, it has not been shown that the new design will improve the proportion of customers
served under 4 minutes by at least 20%.

Example 2: Continued - Slide 119

The management is disappointed with the results and wants to know what the 95% confidence
interval for the proportion increase for the new design is compared to the current design.

Transcript

The management is disappointed at the results and wants to know what exactly is that 95%
confidence interval for proportion increases for the new design as compared to the current design.
95% Confidence Level (1 of 2) - Slide 120

Confidence Interval: Difference in Sample Proportions ± Margin of Error

p̂ 1 ( 1−p̂ 1 ) p̂ 2 ( 1−p̂ 2 )
[(p̂ 1 − p̂ 2 )±z α √ + ]
2 n1 n2

Transcript

The confidence interval is calculated by taking the difference we see in the two-sample proportion
plus or minus the margin of error. For sample proportion, the equation used is shown here. We
can use the Excel output we have to calculate this interval.

95% Confidence Level (2 of 2) - Slide 121

The slide contains the Excel Output table from Slide 117 - Excel Output with the values of the
proportion difference (14%), the Z :  (two-tail) (1.96), and the standard error (0.00577)
α

highlighted.

p̂ ( 1−p̂ ) p̂ ( 1−p̂ )
1 1 2 2
[(p̂ − p̂ )±z α √ + ]
1 2 n1 n2
2

[0.14 ± 1.96 × 0.0577] = [0.14 ± 0.0113] = [12.8%, 15.13%]


Transcript

The difference between p 1 and p 2 here, is in the output and that is 14%. z of α over 2 for 95%
confidence interval is here that is about 1.96 using the two-tail since this is a confidence interval of
your developing.

The last term is the standard error and we find it here which is 0.0057. Now, we can substitute
values to get the confidence interval for the proportion differences. Using the values from the
output, we get confidence interval of 12.8% to a 15.13%. Here we have compared the current
design to the new design. The proportion of orders completed within 4 minutes under the current
design is less than the proportion for the new design.

How much less? By as much as 15.13% to 12.8%. The management wanted better than 20%
improvement. Clearly, the best scenario we get is, based on our study is about 15% increase in
the proportion.

Sample Size Matters - Slide 122

Minnesota Caucus Final Results

Democratic Caucuses: Sanders has won Minnesota, according to A.P.

Democratic Caucuses
Candidates Vote PCT Delegates
Bernie Sanders 114,265 61.7% 42
Hillary Clinton 71,047 38.3% 24
Other 2 0% -

185,314 votes, 86% reporting (3,552 of 4,109 precincts)

Winner called by A.P.

(Andrews et al., 2016)


Transcript

As before, sample size matters when we talk about proportion comparisons. Here, I'm showing
the election results from March 1, 2016, known as Super Tuesday. Comparing the two candidates
in the Democratic party, at this point in time, Hillary Clinton had 56.5% of the votes well as shown
in the headlines, she had 15% more than Bernie Sanders (Hillary Clinton 56.5 percent (61 votes).
Bernie Sanders 41.7 percent (45 votes). Other 1.9 percent (2 votes). Headline: first results:
Clinton leads by 15 points, with 1 percent reporting). This is a fairly big lead, yet no one can say
that she'll win the state. Why?

Because the margin of error will be too high and that's because we are basing this analysis on
108 voters only. And here's the difference when we have 185,000 votes counted.

Now, the difference between Sanders and Clinton is significant and even though this is not 100%
of all votes. We can be fairly certain that Bernie Sanders has a higher proportion of votes than
Hillary Clinton, thus, he's the winner. So, when comparing proportions, be mindful of the sample
size used. Some seemingly big differences are negligible, at least statistically speaking when the
sample size is small.

Let's Practice - Slide 123

This appeared in the local newspaper in Champaign: “Overall, 116 fewer students accepted the
UI’s offer of admission this spring than last year — 7,969 vs. 8,085 in 2015, a 1% drop."

Offer of admission
Category 2015 2016
Number Applied 22,639 22,711
Accepted UI's offer 8,085 7,969

Transcript

Let's practice. An article appeared in the News Gazette, our local newspaper here in Champaign-
Urbana, that claims a 1% decrease in number of students who have accepted their admission to
the University of Illinois. Reports like this are presented all the time whether or not the information
they are reporting has any significance. So, I like to go through this example with you.

Here is the data presented in the article. The reporter claims that going from 8,805 students who
accepted their offer in 2015, to 7,969 in 2016, represents on 1% drop. Let's analyze this and see if
indeed the difference is statistically significant and worthy of coverage. Please start by stating the
null and the alternate hypothesis.
Let's Practice - Solved (1 of 2) - Slide 124

p1 :  proportion of admitted student accepting their offer in 2015

p2 :  proportion of admitted student accepting their offer in 2016

H 0 : p1 ≤ p2

H A : p1 > p2

Transcript

Using p 1, for proportion of admitted students accepting their offer in 2015 and p 2 for the
proportion of admitted students accepting their offer in 2016, in this article, the reporter is implying
that the proportion of admitted students who accepted their offer in 2015 is higher than the
proportion of students who have accepted their offer in 2016, so that's actually your alternate, and
then the null here is then the complement.

Let's Practice - Solved (2 of 2) - Slide 125

H0 : p1 ≤ p2  and HA : p1 > p2

Excel Output - Slide 125


Output Value
Sample 1 Proportion 35.71%
Sample 2 Proportion 35.09%
Proportion Difference 0.62%
Z α  (One-Tail)
2
1.64485
Z α  (Two Tail) 1.95996
2

Standard Error 0.00449


Hypothesized Difference 0
Test Statistics (Z-Test) One-Tail (H0 : p1 − p2 ≥ 0) 1.389376636
P-value (one-tail) 0.91764
Test Statistics (Z-Test) One-Tail (H0 : p1 − p2 ≤ 0) 1.389376636
P-value (one-tail) 0.08236
Test Statistics (Z-Test) Two-Tail (H0 : p1 − p2 = 0) 1.389355854
p-value(two-tail) 0.16472

In the table, the Test Statistics (Z-Test) One- Tail HA : p1 − p2 ≤ 0 row and the P-value (one-tail)
row are highlighted.

Don’t Reject the Null Hypothesis.

Transcript

So, now let's test this claim by running our data. Here's Excel data. What do you think? Is the
reporter correct in claim that the observed decline in the proportion of admitted students who
accepted their offer is something which is newsworthy?

P-value here is 0.08236 and that is greater than 0.05, assuming that to be our significance level,
which means they will not reject the null hypothesis. And in other words, what we have seen in
2016 enrollment doesn't show any significant changes from 2015. These are random variations
that are well within bounds of what we call noise and don't signal anything of importance. I hope
you see what I'm trying to show you here that is not everything you read or hear is really the right
conclusion. What is a significant change and what is noise is what the hypothesis testing allows
us to do.

References - Slide 126

Academic Citations

Andrews, W., Bloch, M., Bowers, J., and Giratikanon, T. (2016). Minnesota caucus early
results [Screenshot]. New York Times. Retrieved March 1, 2016 from
http://www.nytimes.com/elections/results/minnesota.
Andrews, W., Bloch, M., Bowers, J., and Giratikanon, T. (2016). Minnesota caucus early
results [Screenshot]. New York Times. Retrieved March 2, 2016 from
http://www.nytimes.com/elections/results/minnesota.
Bureau of Labor Statistics. (2016). Labor force statistics from the current population survey.
Retrieved from http://data.bls.gov/timeseries/LNS14000000.
Erickson, A. and Sadovi, C. (2008, July 25). Report: girls are equal to math test. Chicago
Tribune. Retrieved from http://articles.chicagotribune.com/2008-07-
25/news/0807250295_1_math-requirements-math-educators-chicago-public-schools.
RealClear Politics. (2016). West Virginia democratic presidential primary. retrieved from
https://www.realclearpolitics.com/epolls/2016/president/wv/west_virginia_democratic_president
5425.html.
Wurth, J. (2006, May 7). In-state admission increases at UI. The News-Gazette. Retrieved
from http://www.news-gazette.com/news/local/2016-05-07)state-admissions-increases-
ui.html.

Image Credits

Andrews, W., Bloch, M., Bowers, J., and Giratikanon, T. (2016). Minnesota caucus early
results [Screenshot]. New York Times. Retrieved March 1, 2016 from
http://www.nytimes.com/elections/results/minnesota.
Andrews, W., Bloch, M., Bowers, J., and Giratikanon, T. (2016). Minnesota caucus early
results [Screenshot]. New York Times. Retrieved March 2, 2016 from
http://www.nytimes.com/elections/results/minnesota.

Transcript

No instruction provided on this slide

Lesson 2-5.2 One-Tail Test of Proportions for Two Samples in Excel


Media Player for Video

Excel Worksheet (1 of 6) - Slide 127

A fast food chain is testing a revised work flow. If the redesign is effective, then the process for all
locations will be revised. For this decision, data has been collected in one location under the
current design and one location under the new design. To make the new design standard, the
difference in proportion of customer orders completed within 4 minutes should be 20% higher than
it is right now.

For the current design, 7,600 orders out of 10,000 were completed within 4 minutes. Under the
new design, 5,400 out of 6,000 were completed within 4 minutes. What is the conclusion at 5%
level of significance?
P1 :  New

P2 :  Current

H0 :  P1 − P2 ≤ 0.20

HA :  P1 − P2 > 0.20

There is an arrow pointing at HA :  P1 − P2 > 0.20

Transcript

In this video, I will show you how to do a one-tail test using the worksheet that I have included for
you, as well as the fact that, when you're testing for more than a zero differences between the two
samples.

So, this is the example that I have used, the fast food chain wants to test everybody's workflow. If
the redesign is effective, then the process of all locations will be revised. But, for them to do this,
they want to at least have more than 20% improvement in proportion of customers who received
their orders within four minutes. So, then what they have done is that they have done some
studies for the current design. They have found out that 7,600 orders out of 10,000 were
completed within four minutes. And, under the new design, 5,400 out of 6,000 were completed
within four minutes. And they want to test this at 5% of loss significance.

So, here I'm going to say p 1 represents proportion of customers who, under the new design, will
get their orders within four minutes. And p 2 is proportion of customers who, under the current
design, will receive their orders within four minutes. Therefore, what you're saying is that, as a null
hypothesis, we're going to assume that the differences between these two is not going to be as
much as we want, the 20%. And we are going to test that and the alternate would be p 1 minus p
2 is greater than 20%. This is the one that would say, yes, the new design is better if we end up
rejecting the null hypothesis.

So, now let's see how we would do this using the worksheet. So, let's go there.

Excel Worksheet (2 of 6) - Slide 128

The slide contains two tables (Input and Output) about the proportions comparing the samples
from two populations. The two populations are the New location and the Current location.

Download the Proportion Fast Food excel file (Refer to Two proportions - First worksheet)
Transcript

So, as you can see, everything here shows some error function, that's because I don't have any
numbers. So, as soon as you put numbers, the output part of this worksheet will get populated.
So, our first sample, 5,400 out of 6,000, these were the people under the new design that
received their orders within four minutes. And, under the old design, 7,600 out of 10,000 got their
orders within four minutes. Level of significance that your testing is 5% and the hypothesized
difference that you're looking for is 20%.

So, you can see that all of this got populated. So, let me now just scroll down and focus there.

Excel Worksheet (3 of 6) - Slide 129

The slide contains the p-value for One-tail (H0 :  P1 − P2 ≤ 0) highlighted in the Output table.
Since this value (1.000) is larger than 0.05, the null hypothesis is not rejected.

Transcript

First of all, we want to focus on the part of the output that relates to us. As you can see, I have two
types of one-tail that I have put. One is that you're looking at the differences between proportion
being greater than equal to zero. Well, I – this is just a label, it's not as sophisticated. So, you can
think about the zero being here, in this case, 20%. What you need to focus on whether or not you
have greater than equal to sign in your null hypothesis or less than equal to sign in your null
hypothesis.

So, if I go back to sheet one, you will see that we have less than or equal to sign. So, we are
going to focus on this part of our table. This is the part that will pertain to us. Focusing on this, we
will see that the p-value is one, which is greater than .05 which means, do not reject. And do not
reject means that we failed to show that, at least 20% improvement under the new design
compared to the old design in proportion of customers who will receive their orders within four
minutes.

But you may still want to know how much improvement is there. Would it be if 19%, 18%, we may
change our minds, so you may want to show to the management what is the difference that you
see. So, let me show you how we would do that using the values that we have in our output.
Excel Worksheet (4 of 6) - Slide 130

The slide contains the Output table, where the proportion difference value (14%) and the standard
error (0.006) are highlighted. In addition, there is a formula that reads:

p̂ ( 1−p̂ ) p̂ ( 1−p̂ )
1 1 2 2
[(p̂ − p̂ )±z α √( + )]
1 2 n1 n2
2

Transcript

To find the confidence interval, we will use the equation that you see here. The first term is the
difference between the proportion between two samples. And that's simply right here. The second
term that you see is your margin of error. The margin of error is a function of that z-value which
represents your confidence level times the standard error. I have given you the standard error but,
to calculate the margin of error, I have to understand which z-value to use. And, as you can see
here, I have two z-values given here. One for a one-tail, one for a two-tail.

Excel Worksheet (5 of 6) - Slide 131

The slide contains two bell-shaped curves. The curve on the top has a 90% confidence level and
the z score for one-tail test (1.645 and −1.645) is marked with two vertical lines. Outside the range
is 5% to the right and 5% to the left. The curve on the bottom has a 95% confidence level and the
z score for two-tail test (1.96 and −1.96) is marked with two vertical lines. Outside the range is
2.5% to the right and 2.5% to the left.
Transcript

Now let me give you an idea about the z-value again. We did a one-tail test, in a one-tail test, the
entire 5% is on one side so, when we did ours, that 5% was completely on this side. And,
therefore, this was 1.645. If I want to calculate the confidence interval, I will take the margin of
error and add and subtract. So, if I use this value, I am also saying that the – in the margin of
error, I will error on the other side so it would be negative 1.645. So, there would be a .05 here
and there would be a .05 here. And the resulting value would be a 90% confidence interval. So, if
you want to use 95% confidence interval, you can go ahead and use 1.96. That says that, for
confidence interval, I am going to split that .05 in half on either side by increasing the confidence
level to 95%. So, in this case, I'm going to just use 1.96.

Just remember, if I use 1.96, I'm going to come up with a 95% confidence interval. If I had used
1.645, I would have come up with a 90% confidence interval.

Excel Worksheet (6 of 6) - Slide 132

The slide contains three new cells called Margin of error, 95% Lower confidence level and 95%
Upper confidence level. The values for these new cells are 0.0113(Margin of error), 12.87%
(Lower 95% confidence level), and 15.13% (Upper 95% confidence level).

Transcript

Okay, so, now that we have – so, now we are ready to calculate our margin of error. And that is
simply the 1.96 because I've decided I'm doing 95% confidence interval multiplied by the standard
error. And, once I have that, I can come up with my 95% confidence level. And I will calculate the
lower bound here and upper bound here. Lower bound is simply the differences between the two
that I have seen in my samples and that is right here, 14% minus the margin of error. And the
difference plus margin of error.

So, what you can see is that we think that there is a 12.87% to 15.13% possibility higher
proportion of customers who will get their orders within four minutes in the new design as
compared to the current design.

Now, any value here is plausible so we cannot just focus on 15%, but this is now an extra piece of
information that management has in case they want to revise their decision and whether or not
they want to implement the current design or not. What we have shown is that we cannot show
that 20% improvement that they had put as a threshold, but we can say that, yes, the new design
is better than the old design. But the improvement that they will see is somewhere between
12.87% to 15.13% more people getting their food within four minutes.
Lesson 2-5.3 Two-Tail Test of Proportions for Two Samples in Excel
Media Player for Video

Excel Worksheet (1 of 3) - Slide 133

One study showed that both girls and boys do equally well on math tests. A school district takes a
random sample of 400 boys and another random sample of 360 girls in grade 11 and looks at their
most recent standardized test scores. The math scores of 315 of the boys and 280 of the girls
were at the proficient level. At 5% level of significance, can the school district claim that the boys
and girls do equally well on math tests?

H0 :  pGirls = pBoys

HA :  pGirls ≠ pBoys

Both H0  and HA  are two-tail tests .

Transcript

In this video, I'm going to show you how to compare population proportions from two different
samples. Excel does not do a good job in doing this, so you have to do the calculations one by
one. So, what I have done is I have created the worksheet which has been locked. So, you can't
really edit it, but you can use it. So, what I'm going to do is go through the examples that we have
in our PowerPoint and show you how I use that worksheet that I'm making available to you.

When you're doing your own problems, you can just replace the input variables with whatever
variable that you have. And then, just know where to look for the answers in the worksheet.

So, let me show you study that show that both girls and boy do equally well on math tests. A
school district takes a random sample of 400 boys and another random sample of 360 girls in
grade 11 and looks at their most recent standardized test score. The math scores of 315 of the
boys and 280 of the girls were the proficient level. At 5% level of significance, can the school
district claim that the boys and girls do equally well on math tests?

So, if you look at this problem, what we are saying is that the proportion of girls who do well on the
test is the same as the proportion of boys. Therefore, our null hypothesis is that proportion of girls
who will do as well as boys or they will get proficiency level is the same as proportion of boys in
the school. And, the alternate is that this school is have girls and boys do differently. So, this is,
will be a two-tailed test, right, because we are doing an equal versus not equal.
Excel Worksheet (2 of 3) - Slide 134

The slide contains two tables (Input and Output) about the proportions comparing the samples
from two populations. The two populations are Girls and Boys.

Download the Proportion Math Excel file (Refer to Two proportions - First worksheet)

Transcript

Let me show you how we would use the worksheet that I'm making available to you. So, what you
would see in a worksheet when you open it up is an area that's highlighted in yellow. This is the
place that you can enter your data, and output will appear here. And, because I have nothing right
now here, everything in the output section looks like it's an error message. That will be fixed as
soon as you enter values.

So, let's say my sample one is going to be my sample of boys that are in the school took the test
and it says count of events. These are the boys who perform at the proficient level. And, based on
our problem, there were 315 of them, and we looked at 400 boys, count of events in sample two.
Here sample two would be the girls and based on the statement we had is that 280 of these girls
did proficiently well in the exam out of the 360 that we have looked at. And, the level of
significance here is .05. And, hypothesize difference here is that they're the same, they're no
different. So, it's zero, so what you would see that this is started getting populated.

First of all, it says that 78.75% of the boys did proficiently on the exam. 77.78% of the girls did
proficiently on the exam. And, the difference you see is right here which means the difference
between the two is .97%. But, again, we have to make sure that this is significant or not. So, as
you have seen in Excel itself, my worksheet also will return everything to you. That means they
will do a one-tailed test and a two-tailed test. You have to pick where your answer is.

Excel Worksheet (3 of 3) - Slide 135


The slide contains the p-value for Two-tail (H0 :  P1 − P2 = 0) highlighted in the Output table.
Since this value (0.745) is larger than 0.05, the null hypothesis is not rejected.

Transcript

So, let me go down and show you what you will see. So, here's our complete data. So, I am going
to focus only on this part, the bottom part of the table, because this refers to the two-tailed test.
And, looking at the p-value right here, you see that it's greater than .05. So, you end up not
rejecting the null hypothesis and the null hypothesis was that boys and girls will do equally well.
So, we are not rejecting this.

You might also like