Docsity

Basic Statistical Analysis in Excel, Study notes of Statistics

Toggle sidebar
bg1
Basic Statistical Analysis in Excel
NICAR 2016 Denver / Norm Lewis, University of Florida / npl[email protected]
ENSURE ANALYSIS TOOLPAK IS ENABLED ON YOUR COMPUTER
Microsoft considers Analysis
TookPak an “add-in” feature. It
comes with Excel (for Windows and
for the latest Mac version) but you
must enable it first. Check to see if it
is loaded by clicking on the Data tab
on the ribbon. If yours does not look like one of these examples here, follow steps below.
For Windows: Enabling Analysis ToolPak
Windows
Apple
1. Click on the File
tab on the ribbon.
2. Click on Options.
3. Click on
Add-Ins.
4. Click Go …
5. Click box for
Analysis ToolPak.
6. Click
OK
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Basic Statistical Analysis in Excel and more Study notes Statistics in PDF only on Docsity!

Basic Statistical Analysis in Excel

NICAR 2016 Denver / Norm Lewis, University of Florida / [email protected]

ENSURE ANALYSIS TOOLPAK IS ENABLED ON YOUR COMPUTER

Microsoft considers Analysis TookPak an “add-in” feature. It comes with Excel (for Windows and for the latest Mac version) but you must enable it first. Check to see if it is loaded by clicking on the Data tab on the ribbon. If yours does not look like one of these examples here, follow steps below.

For Windows: Enabling Analysis ToolPak

Windows (^) Apple

  1. Click on the File tab on the ribbon.
  2. Click on Options.
    1. Click on Add-Ins.
  3. Click Go …
  4. Click box for Analysis ToolPak.
  5. Click OK

For Macintosh: Installing Analysis ToolPak If you have the latest version (Office 365 or Office 2016), Microsoft has reinstated the ToolPak. For users of earlier versions, Microsoft removed it and referred Apple users to StatPlus:mac LE from AnalystSoft for free.

Sorry, Mac People Hey, I’m one of you! But because the computers at the NICAR conference use Windows, the rest of this tutorial will show screenshots from the Windows version. The concepts, however apply equally to us Mac people. (Whew.)

  1. Click on the Tools menu above the ribbon.
    1. Select Add-Ins…
  2. Click on Analysis ToolPak.
  3. Click OK.

Computing Standard Deviation We can determine the boundaries of the standard deviation through Analysis ToolPak.

  1. In the Output Range box, type G or click on the cell where you want the stats inserted.
  2. Click on Data tab on the ribbon. (^) 2. On the right, click on Data Analysis.
  3. Click on Descriptive Statistics.
  4. Click OK.
  5. Click in the box beside Summary statistics.
  6. Click in Input Range box. 6. Click on the Salary column heading.
  7. Click in the box for Labels in First Row.
  8. Activate Output Range button.
  9. Click OK.

Let us now glean some key statistics from this output.

  1. Adjust the columns for readability and to line up the decimal points.

All three averages are provided.

The min and max give us the range, which is another way to think about dispersion.

The salaries are summed and counted.

For this data, 1 standard deviation is $43,140. It is applied to both sides of the mean, like so:

$101,367 + $43,140 = $144, $101,367 - $43,140 = $58,

Thus, 68 percent of the salaries are between $58,277 and $144,507.

Interpretation That is a large range, which means the salaries are widely dispersed. It means that average alone is insufficient to convey a “typical” salary.

Standard deviation is a relative measure, so the interpretation depends on the underlying data.

Calculating Correlation (Hat tip to Professor Steve Doig of Arizona State University, who used a similar data set in a handout a few years ago.)

Open the NFL sheet for the 2015 regular season, according to ESPN statistics. Click on the Data tab, and then on Data Analysis on the right-hand side.

  1. Click on Correlation.
    1. Click OK.
  2. With cursor inside Input Range box, select all the columns with numbers. (Exclude Team because it is text.)
  3. Click in Labels in first row box.
  4. Click OK.
  5. In the Output Range box, type J3 or click in the cell where you want the stats to appear.

The resulting data look like a triangle. The results are enlarged below.

Interpretation The data here confirm what a sports fan knows: More points scored = more wins. And more points allowed = fewer wins. But the data also reveal other insights:  Taking the ball away from the other team has a strong correlation with wins.  Giving the ball away (fumbles, interceptions) is less damaging than takeaways.  Yards gained don’t mean much. On offense, efficiency matters.

Terminology Correlation does not always mean causation. Points scored do not “cause” wins. Instead, the two are associated. Here is an example of how you could write about this data:

For NFL teams, the defensive statistic that is most closely associated with wins is not yards given up but takeaways – interceptions or recovering fumbles.

But we can do an even better job of evaluating correlations with the next part, regression.

This area is blank because it would repeat what is below the string of 1’s.

These are 1 because they are perfect correlations: yards gained = yards gained.

For this data, we care most about correlations with wins.

The strongest correlation is between wins and points allowed: 0.79. It is negative. So the more points allowed, the fewer wins.

Points scored has a strong correlation with wins: 0.77. It is positive. So the more points scored, the more wins.

Click on the NFL data sheet. Consider the column headers as variables. Yards gained, points, takeways, etc., all can vary.

Dependent and Independent Variables The dependent variable is the variable we care most about. That could be school test scores, cancer rates or income. In this data set, Wins is the dependent variable, or DV for short.

The independent variable is something that could influence or be associated with the DV. In this data set, everything besides Wins is an independent variable, or IV for short.

Here’s a visual way to remember the difference between an independent variable (IV) and the dependent variable (DV), drawing from the medical shorthand for intravenous: IV.

Further, this picture gives us the order. The IV comes first. It goes into the patient to deliver medicine and fluids. And if the IV works, the result is the patient gets better.

Just as the medical IV comes first, so does X come first in the alphabet before Y. Thus, we will put the IVs in the X box for Excel. And the DV will go in the Y box.

Variable Abb Excel Role Alternate name Independent Variable IV X Thing(s) that change the DV Predictor Variable Dependent Variable DV Y The thing that changes Criterion Variable

The IV: Something that influences the patient (to get better, we hope!)

The DV : The thing we care about – in this case, the patient

Linear Regression in Excel On the NFL sheet, click on the Data tab. On the far right, choose the Data Analysis option. When you do, you trigger this box. Scroll down until you get to regression.

  1. Scroll down until you see Regression.
    1. Select Regression. 3. Click OK.
      1. In the Input Y Range box, use the mouse to select Wins, the DV.
  2. In the Input X Range box, use the mouse to select all the other data columns (exclude Team) as IVs.
  3. Click in the box for Labels.
  4. The statistics can take up space, so retain the default of a new worksheet.
  5. Click OK.