Topic:Excel for Confidence Intervals

From SharedExperienceProject

Jump to: navigation, search

Contents

Topic Highlights

(What you will learn)

  • The basics of how Microsoft Excel is used for confidence interval problems

Introduction and Motivation

(Why learn it)

Not only is Microsoft Excel a very useful tool for statistical analysis, but it will be used extensively in the course Business Statistics I. If you have not already become familiar with it, you will need to do so.

By following the examples in this topic, you will learn how to solve basic confidence interval problems using Excel's built-in functions. Most important among those functions are NORMSINV() and CONFIDENCE().

Learning Activities

(What I need to do to meet the objectives given below)

Learning activities for this topic
Type Name Direction
In-class activity
Self-directed
Review and reflection
  • Try your hand at Lab 3 (handed out in class)
Self-directed

Exercises

Getting Started

Open a new Excel worksheet. If you can't remember how to do this, then refer to our earlier topic on Introduction to Excel for Statistics.

Now put in an appropriate heading for each of the questions you are asked to answer. An example is shown below, although yours may look a little different from this, depending on what you are asked to do.

Don't forget to save your Excel worksheet somewhere where it can be accessed next time you need it. You might also e-mail it to yourself for safe keeping.

Exercise A: Finding z-scores in Excel

The ability to use Excel to find a z-score for a given probability is a fairly basic function.

Let's take a look.

Example 1

Let's assume you are given a problem that gives you a desired confidence level, say 99%, and requires you to come up with the z-score values for the corresponding range centered around z=0.

In the topic Confidence Intervals, we learned to draw the following sketch to represent this situation, and to look up the values of z in our tables:

Image:Excel_for_confidence_ints_1.png

If you do this using the table for the probability 0.495, you will get z = 2.575.

You can do the same thing using Excel's NORMSINV() function, as long as you realize what area the function is expecting you to enter: you are required to enter the area under the curve to the left of the upper z.

For a confidence level of 99%, the area to the left of the upper z is 0.50 + 0.495 = 0.995. This is the area shown below:

Image:Excel_for_confidence_ints_2.png

So, the function you would enter is:

=NORMSINV(0.995)

Which returns the value z = 2.575829304.

Example 2

What is the Excel formula to find the z-score for a confidence level of 80%?


The spreadsheet corresponding to Example 2 might look something like the following:

Image:Excel_for_confidence_ints_3.PNG

Exercise B: Finding the Standard Error in Excel

Once you're able to find z, the next step is finding the standard error, E. We'll do this here for cases where we seek to quantify the precision of an estimate of the population mean.

What is the Standard Error?

For this, let's recall the following general form of the confidence interval for the mean of a normal population:

CI = [ Image:Xbar.png - z (Image:Sigma_over_root_n.png),  Image:Xbar.png + z (Image:Sigma_over_root_n.png) ]

This can be written in terms of the standard error as follows:

CI = [ Image:Xbar.png - E,  Image:Xbar.png + E ]

which means the standard error is given by the following:

E = z ( Image:Sigma_over_root_n.png )

Check the topics Confidence Intervals and More on Confidence Intervals if you need a refresher on what the symbols mean.

In Excel, there are two methods of finding the standard error:

  1. Computing it with the above formula, as in Example 3 and Example 4
  2. Computing it with the CONFIDENCE() formula, as in Example 5

Example 3 - Computing E directly

The above equation can be computed directly if you know z, Image:Sigma.png and n.

For example, if z = 1.96, Image:Sigma.png=12.4 and n = 25, then you can write the following formula:

=1.96*12.4/SQRT(25)

which gives E = 4.8608

Example 4 - Computing E directly

You won't be given z in many cases, and will have to compute it.

For example, you may be told that Image:Sigma.png=12.4 and n = 25, and asked to compute the standard error corresponding to a confidence level of 80%.

In this case you would first need to compute z, as we did in Example 2, using the following formula:

=NORMSINV(0.900)

and then compute E as in Example 3.

Your spreadsheet for doing this might look as follows:

Image:Excel_for_confidence_ints_4.PNG

Example 5 - Computing E with the CONFIDENCE formula

Another way to compute the standard error for an estimate of the mean is by using the following Excel formula:

CONFIDENCE(Image:Alpha.png, Image:Sigma.png, n)

where Image:Alpha.png is one minus the confidence level expressed as a decimal, e.g.for a confidence level of 80%:

Image:Alpha.png = 1.00-0.80 = 0.20

For the situation in Example 4, for example you would use the formula:

=CONFIDENCE(0.20, 12.4, 25)

which would give a value E = 3.1782

Your spreadsheet for doing this might look as follows:

Image:Excel_for_confidence_ints_5.PNG

Exercise C: Computing the Confidence Interval

Once you have the standard error, E, by either method shown above, it's quite simple to compute the upper and lower bounds of the confidence interval for the mean. Just remember the following equation:

CI = [ Image:Xbar.png - E,  Image:Xbar.png + E ]

Example 6

What are the lower and upper bounds of the confidence interval for Example 5 if Image:Xbar.png = 34.4?

You compute the bounds as follows:

lower = Image:Xbar.png - E = 34.4 - 3.1782
upper = Image:Xbar.png + E = 34.4 + 3.1782

To do this, your spreadsheet might look as follows:

Image:Excel_for_confidence_ints_6.PNG

Final note

Note that for some questions like this, you may not be given the sample mean, Image:Xbar.png. Instead you will need to compute it from some raw data points that you are given. You should already know how to do this using the AVERAGE() formula .

Personal tools