BUS 308 Week 2 Lecture 3
Setting up the F and T tests in Excel
After reading this lecture, the student should know:
1. How to set up data lists for the F and T tests.
2. How to set-up and conduct the F test (both options) produced by Excel
3. How to set-up and conduct the T-test produced by Excel
Overview
One of the nice characteristics of Excel is that setting up and running most functions and
tests is done in a very similar fashion, only having specific test related differences showing up in
the different functions and tests.
This lecture will cover setting up data ranges that will be used for all of our statistical
functions. It will then move into setting up the F and T tests specifically.
Setting up Data
While in the hypothesis testing procedure it was said to set up steps 1 – 4 before even
looking at the data, we can set up the data columns to be used at any time. The set-up is simple
and straightforward. But, we have a couple of questions to answer before we set things up.
Since this week needs us to compare male and female outcomes (and Degree outcomes in
Question 3), we need to decide how we want our data to look. Sticking strictly with the gender
related data (you can do similar things with the degree data when ready), we need to decide if we
want our key data (compa-ratios, salary, etc.) to be in a long column or in two columns. An
example of both is shown in the screen shot below.
Notice that Column S contains all of the compa-ratio values (all 50 if we could see the
entire range) and that they are grouped by gender, with the first 25 rows being female values and
the last 25 rows being male values. The other way to display the data values is to have them
listed in separate columns, such as shown in columns Q and R – each having a label heading.
Start by looking at what variables the questions are asking for. For week 2, we have
Questions 1 and 2 asking for the same variables – compa-ratio and gender1, so we can use the
same location for both questions. Question 3 asks for a different set of variables, compa-ratio
and degree, so we should set up a different area for that question. Remember, it is best to
NEVER sort the data on the data tab. An error in sorting that missed a column could mess up the
data set and make it unusable for other problems.
In either case, copy the entire data column of interest (for example, compa-ratio,
Gender1, Degree, etc.) from the Data Tab to the weekly worksheet. Highlight the entire data
range of interest including the label in row 1, then press Control + C at the same time. Go over
to the weekly work sheet and find a column to the right of the work area (generally columns Q or
higher will be OK) and press Control + V at the same time. Repeat this for all the variables you
need.
After pasting the variables, use the Sort function in the Data tab to arrange them in
whatever order you want. You can do multiple sorts at the same time w ...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
BUS 308 Week 2 Lecture 3 Setting up the F and T tests in E.docx
1. BUS 308 Week 2 Lecture 3
Setting up the F and T tests in Excel
After reading this lecture, the student should know:
1. How to set up data lists for the F and T tests.
2. How to set-up and conduct the F test (both options) produced
by Excel
3. How to set-up and conduct the T-test produced by Excel
Overview
One of the nice characteristics of Excel is that setting up and
running most functions and
tests is done in a very similar fashion, only having specific test
related differences showing up in
the different functions and tests.
This lecture will cover setting up data ranges that will be used
for all of our statistical
functions. It will then move into setting up the F and T tests
specifically.
Setting up Data
While in the hypothesis testing procedure it was said to set up
steps 1 – 4 before even
looking at the data, we can set up the data columns to be used at
any time. The set-up is simple
and straightforward. But, we have a couple of questions to
answer before we set things up.
2. Since this week needs us to compare male and female outcomes
(and Degree outcomes in
Question 3), we need to decide how we want our data to look.
Sticking strictly with the gender
related data (you can do similar things with the degree data
when ready), we need to decide if we
want our key data (compa-ratios, salary, etc.) to be in a long
column or in two columns. An
example of both is shown in the screen shot below.
Notice that Column S contains all of the compa-ratio values (all
50 if we could see the
entire range) and that they are grouped by gender, with the first
25 rows being female values and
the last 25 rows being male values. The other way to display
the data values is to have them
listed in separate columns, such as shown in columns Q and R –
each having a label heading.
Start by looking at what variables the questions are asking for.
For week 2, we have
Questions 1 and 2 asking for the same variables – compa-ratio
and gender1, so we can use the
same location for both questions. Question 3 asks for a
different set of variables, compa-ratio
and degree, so we should set up a different area for that
question. Remember, it is best to
NEVER sort the data on the data tab. An error in sorting that
missed a column could mess up the
data set and make it unusable for other problems.
In either case, copy the entire data column of interest (for
3. example, compa-ratio,
Gender1, Degree, etc.) from the Data Tab to the weekly
worksheet. Highlight the entire data
range of interest including the label in row 1, then press Control
+ C at the same time. Go over
to the weekly work sheet and find a column to the right of the
work area (generally columns Q or
higher will be OK) and press Control + V at the same time.
Repeat this for all the variables you
need.
After pasting the variables, use the Sort function in the Data tab
to arrange them in
whatever order you want. You can do multiple sorts at the same
time with this function – for
example, you can sort the compa-ratios by gender1 first (to
group all male and female values
together) and then within each gender group sort the values
from high to low by adding a second
sort row.
If you would like, you can then create new columns of data by
copying and pasting
sections of the data range – for example, creating Male and
Female columns. The advantage to
this approach is that you can include the labels in the data entry
boxes and have the variable
labels included in the output tables as the examples showed in
Lecture 2.
The F-Test Set-up
In each question asking for an analysis of data using the
4. hypothesis testing process, step 5
requires that you place the results of a statistical test in a
certain cell. This, is mostly for the
convenience of the instructors reviewing your work but deciding
where to put the output is
required for every test you run.
The following shows the setting up of the hypothesis testing
steps and conducting of the
F-test to answer our question about the equality of male and
female compa-ratio variance. (Note:
again, you will perform these steps for salary variance in your
homework.)
Before even getting to the test itself, we have a couple of
questions to answer. Part a of
question 1 asks where the data range is for this question. We
always need to know where the
data is that we are using for tests, even if – as is true in this
case – the data is on the same work
sheet. So, list where the variables are listed, such as in the
range S1:T51 or Q1:Q26 as in the
examples above. Either would be an appropriate entry for the
data shown. One reason for this
question is to allow instructors to see if a data copy or sorting
error occurred if the data results
are not correct.
The second question simply asks for you to decide if a one- or
two-tail test is required for
the question being asked. This is to help prepare you for the
actual hypothesis testing steps.
Now, the set-up concerns move to Step 5: Conduct the test.
Note that a cell location is
given for you to place your outputs. In most cases, the tests we
5. want to perform are located in
the Analysis ToolPak option found in the Analysis tab on the far
right of the Data Ribbon. Left
Click on the Data label on the green ribbon at the top of an
Excel page, then click on the
Analysis Tab or on the Data Analysis tool listed. Once the Data
Analysis list is shown, scroll
down to your desired tool.
Below is a screen shot of locating the F-test Two-Sample for
Variance in the Data Analysis list.
The F.TEST option for question 1 is found in the Fx (or
Formulas) Statistical list. Here
is a screenshot of where the F.Test is found in the fx Statistical
list.
Either test can be used for this question. After highlighting the
desired test, just select
OK at the bottom and a data entry box will open. Both are
somewhat similar, so only the F-Test
Two Sample for Variances data entry will be shown below.
Here is a screenshot of the data entry box for the F-Test Two-
Sample for Variance. Note
that the compa-ratios have been copied over to columns headed
by labels of Male and Female.
This lets our test results show the label for each group. Also
note, that for this screenshot, the
6. results are placed next to the data columns (AA2), while in your
assignment K10 should be listed
in the Output Range box.
Note, always enter the variables in the order listed in the null
hypothesis statement; since
the male values were entered in the Variable 1 range, the
hypothesis statements should list the
male variable first. This makes interpreting the test results
easier.
Entering cell values into any box is fairly simple. You can
simply type the data range
into the box, using a : between the starting and ending cells.
You can place the cursor in a box,
left click, and then move the cursor to the top cell in the data
range (include labels if present),
hold down the left button and drag the cursor to the end of the
data range and release the left
button. Or, you can click on the symbol at the right which opens
a box, then enter the data by
either technique just mentioned and click on the icon at the
right.
After entering the data ranges, click on the Labels box if, and
only if, you have included
labels in the data input range. An alpha of 0.05 is automatically
selected but can be changed
simply by entering another value. Finally, go to the Output
Options and click on the desired
location – for this class use Output Range and then enter the
cell location into the box. Click on
Ok and you are done.
The process is pretty straightforward, but once in a while an
7. error occurs. The most
common is when someone does not include labels in the input
range but checks the labels box.
This is fairly easy to spot – the data tables will have a data
value listed as a label, and – at least
for the questions this week – will show a data count of 24 rather
than the correct count of 25 per
group. If this occurs, simply go back and reenter the data with
the labels. Excel will tell you that
you are about to overwrite existing data, and that is what you
want to do, so check OK.
The F.Test is even simpler to set-up. Going to Fx (or
Formulas), statistical list, and
selecting the F.Test will produce a data entry box that simply
asks for each data range – as with
the top entries in the F-Test shown above. Complete them in
the same way and select Ok. (Do
not include labels in these ranges.) The F.Test outcome shows
up in the cell your cursor was on
when you opened the Fx link.
VIDEO Link: Here is a video on the F-Test Two Sample for
Variances: https://screencast-o-
matic.com/watch/cbQuFRIwDX .
The T-Test Set-up
There are three versions of the T-Test done for us by Excel.
The first two are similar
except one version is done if the variances are equal and the
other if the variances are not equal.
(Now we see an important reason for performing the F-test
8. first.)
The third version of the T-test is for paired data, and is called
T-test Paired Two Sample
for Means. Paired data are two measures taken on the same
subject. Examples include a math
and English test score for each student, preference sores for
different drinks, and, in our data set
the salary and midpoint values. Note that paired data must be
measured in the same units, and be
from the same subjects. Students in the past have incorrectly
used the paired t-test on male and
female salaries. These are not paired, as the measures are taken
on different people and cannot
be paired together for analysis.
In many ways, setting up Excel’s T-tests, and virtually all the
functions we will study,
follow the same steps as we just went through:
1. Set up the data into distinct groups.
2. Select the test function from either the Fx or Analysis list
3. Input the data ranges and output ranges into the appropriate
entry boxes, checking
Labels if appropriate.
4. Clicking on OK to produce the output.
As with the F-test, the T-test has a couple of options depending
upon what you want your
output to look like. The Fx (or Formulas) option returns simply
the p-value for the selected
version of the test. The Data | Analysis selection provides
descriptive statistics that are useful for
additional analysis (some of which we will discuss later in the
course).
9. The t-test requires that we select between three versions, one
assuming equal variances
between the populations, one assuming unequal variances in the
populations, and one requiring
paired data (two measures on each element in the sample, such
as salary and midpoint for each
person in our data set.) All have the same data set-up approach,
so only one will be shown.
Setting up the data and test for question 2 about mean equality
is similar to what one for
the F-test question, and we can actually use the same data
columns as we used in question 1 on
variances. Again, after sorting the data into your comparison
groups (with labels as we did for
the F-test), select the appropriate test from either the Fx or
Analysis list. A completed T-test
Two-Sample Assuming Equal Variances input table is shown
below.
The input box looks a lot like the one we saw for the F-test, and
is completed in the same way.
Enter the data ranges in the same order you have them listed in
the hypothesis statements, check
the labels box if appropriate, and identify your output range top
left cell (this is given in the
homework problems for a consistent format for instructor
grading).
There is one input that differs and which we have not yet
discussed, Hypothesized Mean
Difference. For the most part, we do not use this. An example
10. of when we might want to is
when we have made a change and want to test its effectiveness.
For example, we might have a
pre- and post-test in a training course. In the original design,
the average improvement might be
10 points on the post-test. If we change the design of the
training, we would be interested not
only in showing a significant change between the two tests but
also a better change due to the
revision. In this case, the first 10-point difference in the tests
is a given, we want to know if the
additional score change is significant. So, we enter 10 in the
HMD box, and the analysis looks at
only the mean difference larger than 10, the marginal
improvement due to the design change.
The input for the Fx T.Test contains 4 boxes, and produces the
p-value in the cell the
cursor is in. The first two boxes are the data range for each
variable, and these should not have a
label included. The third box asks whether you have a one or
two tail test. The forth box asks
for the kind of test, paired, equal variance, or unequal variance.
Once we click OK for the T.test. we get a output, the p-value.
When we click OK on the
Analysis ToolPak function we get a more descriptive table;
much like the differences with the
two versions of the F.
There is no difference in setting up a Data Analysis test for a
one- or two-tail outcome,
11. these results are examined in the output, not in the input
screens.
Question 3
The only data entry difference for this question is the need to
copy, paste, and sort the
degree and salary variable columns. The rest of the set-up is
exactly the same as done for either
question 1 or question 2.
Special Case: The One-Sample T-test
Often, we may want to test the results of a sample against a
standard; for example, is the
weight of a production run of 8 ounces of canned pears actually
equal to the standard of 8.02 oz.?
(Note, most manufactures will put in slightly more than the
label says to avoid being
underweight which could result in a fine.)
Excel is not set up to perform this test, but we can “trick” it to
do this for us. In the one-
sample case, we need two pieces of information, the sample
values and our comparison standard.
Set these up as if they were any two-sample data sets, have our
sample values (for example, 25
female compa-ratios in one column) and our comparison value
in another. The comparison data
column will only contain a single value equal to our comparison
value. For example, we might
want to test if the average female compa-ratio was greater than
the compa-ratio midpoint of 1.00.
The null would be H0: female compa-ratio mean <= 1.00 while
the alternate would be Ha:
Female compa-ratio mean > 1.00. The Compa-ratio data column
12. would contain the Female
compa-ratios and the other column (named for convenience as
Ho Data) would contain only the
value of 1.00, our standard value.
While we will leave the math for any interested student to
perform, if we take the T-test
unequal variance formulas for both the t-value and the df value
and have a variance of 0 for one
variable, both will reduce to the one-sample t-test formula and
df value. Knowing this, we can
use the unequal variance version of the t-test to perform what is
essentially a one-sample test for
us.
The output of this test will show a mean of 1.0 and a variance of
0 for the Ho Data
(comparison) value, and the correct values for the Female
compa-ratio variable, including the p-
values.
Here is a video on setting up and using the t-test in Excel:
https://screencast-o-
matic.com/watch/cb6lYcImnn
Summary
Conducting an F or t test is fairly straightforward: set-up the
data, select the appropriate
test from the Analysis Toolpak or Fx/Formulas list, enter the
data into the set-up box, and
identify the cell you want the result placed in.
Setting up the data for either test is the same. Label two
13. columns with the name of each
group and list all the related measures (for example, all Male
salaries in a column named Male)
vertically under the label. Each test has a set-up box that will
ask for the ranges for each group.
When entering the data in the Analysis Toolpak function, be
sure to include each label.
Labels cannot be included in the Fx version of either test.
Please ask your instructor if you have any questions about this
material.
When you have finished with this lecture, please respond to
Discussion Thread 3 for this
week with your initial response and responses to others over a
couple of days before reading the
third lecture for the week.
https://screencast-o-matic.com/watch/cb6lYcImnn
https://screencast-o-matic.com/watch/cb6lYcImnn