Basics: How to Calculate Standard Deviation in Excel

advertisement
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
Basics: How to Calculate Standard Deviation in Excel
In this guide, we are going to look at the basics of calculating the standard deviation of a data set.
The calculations will be done step by step, without the use of the Data Analysis add-on of Excel.
1. Assume we have collected response data from 15 subjects performing a memory recall task.
Each datum within the data set corresponds to the number of correct trials for each subject. Here
is the data:
Score X
56
67
58
62
65
47
53
58
65
45
63
46
67
65
52
Using Excel for Standard Deviation - H.T. Sullivan, PhD – Copyright ©2008
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
2. Next, we will enter the data set into a new spreadsheet. When we are done, it should look like
the following:
3. The first thing we will need is the Mean of the data set. We will use the ∑ function on the tool
bar to select the Average function:
2
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
4. We will accept Excel’s default selection, as it correctly highlights the data; press Enter to
calculate the Mean:
5. We now have our sample Mean, which is 57.933. To make things clearer, lets do the
following: make the Mean bold, change the background color of the cell to light yellow, and
change the format of the number to show only two places to the right of the decimal.
3
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
5a. Select the Format Cells option from the Format menu. You will now see the Format Cells
dialog, with the Number tab visible. Select the Category item Number, and set the Decimal
places to 2.
5b. Select the Font tab and set the Font style to Bold.
5c. Select the Patterns tab and pick a color (light yellow in this case). Click on OK.
4
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
5d. You will now have the Mean, in Bold, with a colored background and two decimal places.
6. Move the cursor to the first row in column B (cell B1). Type in a text label for Deviation.
5
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
7. Move the cursor to cell B2 (down 1), and begin to enter a formula by typing the = sign.
7a. Type (or click on) A2 to enter the cell containing the first score into the formula.
6
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
7b. Type the – sign, to signify that we will be subtracting a value from cell A2.
7c. Type (or click on cell) A17, which contains our calculated Mean. Then press Enter.
7
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
7d. We now have the deviation from the Mean for our first score (-1.93).
7e. In cell B3, enter in the formula for the next score. You can type =A3-A17 and press enter.
The result should be 9.07.
8
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
7f. Repeat this process for the remaining 13 data values, so that you end up with the following in
your worksheet.
8. Now, with the deviation calculated for each score in our data set, let’s calculate the sum to
verify that our deviations add up to Zero! Select the ∑ function from the toolbar and choose the
Sum option.
9
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
8a. Again, Excel highlights what it assumes is our data to be summed. Press enter to accept the
selection.
8b. The result is indeed zero, which means that we can move on to the next step.
10
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
9. Move the cursor to the next column and in cell C1, enter a text label for the squared
deviations (e.g., Dev Squared).
10. Now, we will enter a simple formula for squaring our deviations in column B. Begin by
entering an = sign in cell C2 and either type or click cell B2 to indicate we want to work with the
first deviation value.
11
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
10a. Next find the ^ character on the keyboard (typically above the 6 key). The ^ indicates in a
formula, that you want to raise a number to a power. In our case, we want to raise the value in
cell B2 to a power of 2, meaning we want to square the number.
10b. After typing the ^ character, we next type the number 2, resulting in =B2^2. Now press the
enter key.
12
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
10c. You will probably see ####### as your result, meaning that the number is too large to
display in the current cell width. Highlight the cell and choose the Format Cells option from the
Format menu.
10d. As was done in an earlier step, set the number of decimal places to 2, and click OK.
13
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
10e. Now, you should see the squared deviation value of 3.74 in cell C2. Our next step is to
repeat the formula for each of our deviation values. For formulas that consist of values on the
same row, we can save time by copying the value/formula in cell C2 and pasting it into cells C3
through C16. Press Control-C to copy cell C2.
10f. Next, click on cell C3 and drag the cursor down to cell C16, so that you have the following
visible in your spreadsheet:
14
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
10g. Now, press Control-V to paste the previously copied formula into the highlighted cells. The
result should look like the following:
11. The next step is to calculate the sum of the squared deviations. Now, with the cursor in cell
C17, select the ∑ function from the toolbar and choose the Sum option. Make sure the correct
cells are highlighted and press Enter.
15
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
11a. The result should look like the following, with the resulting sum of the squared deviations
being equal to 848.93.
12. Now we will calculate the standard deviation for our dataset. Remember the equation for
standard deviation?
2


x

M

N 1
x is a score in our data set
M is the Mean for our data set
N is the number of scores in our data set
And
everything
we need to
use in the
formula is
already
calculated…
(x-M)2
∑(x-M)2
Mean
16
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
12a. First, let’s pick a cell for our Standard Deviation formula label, B20, and then enter the text
Std Dev =.
12b. Next, move the cursor to cell C20, and begin entering the formula for standard deviation.
First, type the = sign to begin the formula, followed by the function name for Square Root:
SQRT. We need to use parentheses in this formula, so type (. The result should look like
=SQRT(.
17
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
12c. We are going to take the square root of the sum of the squared deviations divided by the
number of scores minus 1. So, type C17, which is the cell containing the sum of the squared
deviations.
12d. Next type the / symbol, which means we want to divide. Since we had 15 scores, our N-1
value is 14. Complete the formula by typing 14 and a closing parenthesis. The formula should
look like =SQRT(C17/14). Press enter.
18
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
12e. You should now have the standard deviation value of 7.787046631 in cell C20.
12f. Since our other values use 2 decimal places, you can use the Format Cells option to make
the standard deviation display consistent with our other values (7.79).
19
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
13. Now that we know how to calculate the standard deviation using Excel, let’s see how our
result compares with the Data Analysis function of Excel. From the Tools menu, select the Data
Analysis option.
13a. Choose Descriptive Statistics from the Data Analysis options dialog.
20
Calculating Standard Deviation in Excel
Psych 201
Dr. Helen Sullivan
13b. Set the Input Range so that the scores data (and label) are highlighted (A1 to A16). Check
the “Labels in First Row” box. Next select the “New Worksheet Ply” option, and give the new
worksheet a name, such as descriptive statistics. Next, check the “Summary statistics” box. Just
one more thing, click OK.
13c. The results will be calculated and appear in the new worksheet. Compare the results with
those you calculated. You should find the Standard Deviations to be the same!
21
Download