Excel For Statistical Data Analysis (Part 1)

Excel For Statistical Data Analysis (Part 1)

Excel is the widely used statistical package, which serves as a tool to understand statistical concepts and computation to check your hand-worked calculation in solving your homework problems. The site provides an introduction to understand the basics of and working with the Excel. Redoing the illustrated numerical examples in this site will help improving your familiarity and as a result increase the effectiveness and efficiency of your process in statistics.

MENU

  1. Introduction
  2. Entering Data
  3. Descriptive Statistics
  4. Normal Distribution
  5. Confidence Interval for the Mean
  6. Test of Hypothesis Concerning the Population Mean
  7. Difference Between Mean of Two Populations
  8. ANOVA: Analysis of Variances
  9. Goodness-of-Fit Test for Discrete Random Variables
  10. Test of Independence: Contingency Tables
  11. Test Hypothesis Concerning the Variance of Two Populations
  12. Linear Correlation and Regression Analysis
  13. Moving Average and Exponential Smoothing
  14. Applications and Numerical Examples
  15. Microsoft Excel Add-Ins for Solving Linear Programs
  16. Computer-assisted Learning: E-Labs and Computational Tools
  17. Interesting and Useful Sites


Introduction

This site provides illustrative experience in the use of Excel for data summary, presentation, and for other basic statistical analysis. I believe the popular use of Excel is on the areas where Excel really can excel. This includes organizing data, i.e. basic data management, tabulation and graphics. For real statistical analysis on must learn using the professional commercial statistical packages such as SAS, and SPSS.

Microsoft Excel 2000 (version 9) provides a set of data analysis tools called the Analysis ToolPak which you can use to save steps when you develop complex statistical analyses. You provide the data and parameters for each analysis; the tool uses the appropriate statistical macro functions and then displays the results in an output table. Some tools generate charts in addition to output tables.

If the Data Analysis command is selectable on the Tools menu, then the Analysis ToolPak is installed on your system. However, if the Data Analysis command is not on the Tools menu, you need to install the Analysis ToolPak by doing the following:

Step 1: On the Tools menu, click Add-Ins.... If Analysis ToolPak is not listed in the Add-Ins dialog box, click Browse and locate the drive, folder name, and file name for the Analysis ToolPak Add-in ?— Analys32.xll ?— usually located in the Program Files\Microsoft Office\Office\Library\Analysis folder. Once you find the file, select it and click OK.

Step 2: If you don't find the Analys32.xll file, then you must install it.

  1. Insert your Microsoft Office 2000 Disk 1 into the CD ROM drive.
  2. Select Run from the Windows Start menu.
  3. Browse and select the drive for your CD. Select Setup.exe, click Open, and click OK.
  4. Click the Add or Remove Features button.
  5. Click the + next to Microsoft Excel for Windows.
  6. Click the + next to Add-ins.
  7. Click the down arrow next to Analysis ToolPak.
  8. Select Run from My Computer.
  9. Select the Update Now button.
  10. Excel will now update your system to include Analysis ToolPak.
  11. Launch Excel.
  12. On the Tools menu, click Add-Ins... - and select the Analysis ToolPak check box.

Step 3: The Analysis ToolPak Add-In is now installed and Data Analysis... will now be selectable on the Tools menu.

Microsoft Excel is a powerful spreadsheet package available for Microsoft Windows and the Apple Macintosh. Spreadsheet software is used to store information in columns and rows which can then be organized and/or processed. Spreadsheets are designed to work well with numbers but often include text. Excel organizes your work into workbooks; each workbook can contain many worksheets; worksheets are used to list and analyze data .

Excel is available on all public-access PCs (i.e., those, e.g., in the Library and PC Labs). It can be opened either by selecting Start - Programs - Microsoft Excel or by clicking on the Excel Short Cut which is either on your desktop, or on any PC, or on the Office Tool bar.

Opening a Document:

  • Click on File-Open (Ctrl+O) to open/retrieve an existing workbook; change the directory area or drive to look for files in other locations
  • To create a new workbook, click on File-New-Blank Document.

Saving and Closing a Document:

To save your document with its current filename, location and file format either click on File - Save. If you are saving for the first time, click File-Save; choose/type a name for your document; then click OK. Also use File-Save if you want to save to a different filename/location.

When you have finished working on a document you should close it. Go to the File menu and click on Close. If you have made any changes since the file was last saved, you will be asked if you wish to save them.

The Excel screen

Workbooks and worksheets:

When you start Excel, a blank worksheet is displayed which consists of a multiple grid of cells with numbered rows down the page and alphabetically-titled columns across the page. Each cell is referenced by its coordinates (e.g., A3 is used to refer to the cell in column A and row 3; B10:B20 is used to refer to the range of cells in column B and rows 10 through 20).

Your work is stored in an Excel file called a workbook. Each workbook may contain several worksheets and/or charts - the current worksheet is called the active sheet. To view a different worksheet in a workbook click the appropriate Sheet Tab.

You can access and execute commands directly from the main menu or you can point to one of the toolbar buttons (the display box that appears below the button, when you place the cursor over it, indicates the name/action of the button) and click once.

Moving Around the Worksheet:

It is important to be able to move around the worksheet effectively because you can only enter or change data at the position of the cursor. You can move the cursor by using the arrow keys or by moving the mouse to the required cell and clicking. Once selected the cell becomes the active cell and is identified by a thick border; only one cell can be active at a time.

To move from one worksheet to another click the sheet tabs. (If your workbook contains many sheets, right-click the tab scrolling buttons then click the sheet you want.) The name of the active sheet is shown in bold.

Moving Between Cells:

Here is a keyboard shortcuts to move the active cell:

  • Home - moves to the first column in the current row
  • Ctrl+Home - moves to the top left corner of the document
  • End then Home - moves to the last cell in the document

To move between cells on a worksheet, click any cell or use the arrow keys. To see a different area of the sheet, use the scroll bars and click on the arrows or the area above/below the scroll box in either the vertical or horizontal scroll bars.

Note that the size of a scroll box indicates the proportional amount of the used area of the sheet that is visible in the window. The position of a scroll box indicates the relative location of the visible area within the worksheet.

...................................................

Entering Data

A new worksheet is a grid of rows and columns. The rows are labeled with numbers, and the columns are labeled with letters. Each intersection of a row and a column is a cell. Each cell has an address, which is the column letter and the row number. The arrow on the worksheet to the right points to cell A1, which is currently highlighted, indicating that it is an active cell. A cell must be active to enter information into it. To highlight (select) a cell, click on it.To select more than one cell:

  • Click on a cell (e.g. A1), then hold the shift key while you click on another (e.g. D4) to select all cells between and including A1 and D4.
  • Click on a cell (e.g. A1) and drag the mouse across the desired range, unclicking on another cell (e.g. D4) to select all cells between and including A1 and D4.
  • To select several cells which are not adjacent, press "control" and click on the cells you want to select. Click a number or letter labeling a row or column to select that entire row or column.

One worksheet can have up to 256 columns and 65,536 rows, so it'll be a while before you run out of space.

Each cell can contain a labelvaluelogical value, or formula.

  • Labels can contain any combination of letters, numbers, or symbols.
  • Values are numbers. Only values (numbers) can be used in calculations. A value can also be a date or a time
  • Logical values are "true" or "false."
  • Formulas automatically do calculations on the values in other specified cells and display the result in the cell in which the formula is entered (for example, you can specify that cell D3 is to contain the sum of the numbers in B3 and C3; the number displayed in D3 will then be a funtion of the numbers entered into B3 and C3).

To enter information into a cell, select the cell and begin typing.

Note that as you type information into the cell, the information you enter also displays in the formula bar. You can also enter information into the formula bar, and the information will appear in the selected cell.

When you have finished entering the label or value:

  • Press "Enter" to move to the next cell below (in this case, A2)
  • Press "Tab" to move to the next cell to the right (in this case, B1)
  • Click in any cell to select it

Entering Labels

Unless the information you enter is formatted as a value or a formula, Excel will interpret it as a label, and defaults to align the text on the left side of the cell.

If you are creating a long worksheet and you will be repeating the same label information in many different cells, you can use the AutoComplete function. This function will look at other entries in the same column and attempt to match a previous entry with your current entry. For example, if you have already typed "Wesleyan" in another cell and you type "W" in a new cell, Excel will automatically enter "Wesleyan." If you intended to type "Wesleyan" into the cell, your task is done, and you can move on to the next cell. If you intended to type something else, e.g. "Williams," into the cell, just continue typing to enter the term.

To turn on the AutoComplete funtion, click on "Tools" in the menu bar, then select "Options," then select "Edit," and click to put a check in the box beside "Enable AutoComplete for cell values."

Another way to quickly enter repeated labels is to use the Pick List feature. Right click on a cell, then select "Pick From List." This will give you a menu of all other entries in cells in that column. Click on an item in the menu to enter it into the currently selected cell.

Entering Values

A value is a number, date, or time, plus a few symbols if necessary to further define the numbers [such as: . , + - ( ) % $ / ].

Numbers are assumed to be positive; to enter a negative number, use a minus sign "-" or enclose the number in parentheses "()".

Dates are stored as MM/DD/YYYY, but you do not have to enter it precisely in that format. If you enter "jan 9" or "jan-9", Excel will recognize it at January 9 of the current year, and store it as 1/9/2002. Enter the four-digit year for a year other than the current year (e.g. "jan 9, 1999"). To enter the current day's date, press "control" and ";" at the same time.

Times default to a 24 hour clock. Use "a" or "p" to indicate "am" or "pm" if you use a 12 hour clock (e.g. "8:30 p" is interpreted as 8:30 PM). To enter the current time, press "control" and ":" (shift-semicolon) at the same time.

An entry interpreted as a value (number, date, or time) is aligned to the right side of the cell, to reformat a value.

Rounding Numbers that Meet Specified Criteria: To apply colors to maximum and/or minimum values:

  1. Select a cell in the region, and press Ctrl+Shift+* (in Excel 2003, press this or Ctrl+A) to select the Current Region.
  2. From the Format menu, select Conditional Formatting.
  3. In Condition 1, select Formula Is, and type =MAX($F:$F) =$F1.
  4. Click Format, select the Font tab, select a color, and then click OK.
  5. In Condition 2, select Formula Is, and type =MIN($F:$F) =$F1.
  6. Repeat step 4, select a different color than you selected for Condition 1, and then click OK.

Note: Be sure to distinguish between absolute reference and relative reference when entering the formulas.

Rounding Numbers that Meet Specified Criteria

Problem: Rounding all the numbers in column A to zero decimal places, except for those that have "5" in the first decimal place.

Solution: Use the IF, MOD, and ROUND functions in the following formula: =IF(MOD(A2,1)=0.5,A2,ROUND(A2,0))

To Copy and Paste All Cells in a Sheet

  1. Select the cells in the sheet by pressing Ctrl+A (in Excel 2003, select a cell in a blank area before pressing Ctrl+A, or from a selected cell in a Current Region/List range, press Ctrl+A+A). 
  2. OR 
  3. Click Select All at the top-left intersection of rows and columns.
  4. Press Ctrl+C.
  5. Press Ctrl+Page Down to select another sheet, then select cell A1.
  6. Press Enter.

To Copy the Entire Sheet

Copying the entire sheet means copying the cells, the page setup parameters, and the defined range Names.

Option 1:

  1. Move the mouse pointer to a sheet tab.
  2. Press Ctrl, and hold the mouse to drag the sheet to a different location.
  3. Release the mouse button and the Ctrl key.

Option 2:

  1. Right-click the appropriate sheet tab.
  2. From the shortcut menu, select Move or Copy. The Move or Copy dialog box enables one to copy the sheet either to a different location in the current workbook or to a different workbook. Be sure to mark the Create a copy checkbox.

Option 3:

  1. From the Window menu, select Arrange.
  2. Select Tiled to tile all open workbooks in the window.
  3. Use Option 1 (dragging the sheet while pressing Ctrl) to copy or move a sheet.

Sorting by Columns

The default setting for sorting in Ascending or Descending order is by row. To sort by columns:

  1. From the Data menu, select Sort, and then Options.
  2. Select the Sort left to right option button and click OK.
  3. In the Sort by option of the Sort dialog box, select the row number by which the columns will be sorted and click OK.

...........................................................

Descriptive Statistics

The Data Analysis ToolPak has a Descriptive Statistics tool that provides you with an easy way to calculate summary statistics for a set of sample data. Summary statistics includes Mean, Standard Error, Median, Mode, Standard Deviation, Variance, Kurtosis, Skewness, Range, Minimum, Maximum, Sum, and Count. This tool eliminates the need to type indivividual functions to find each of these results. Excel includes elaborate and customisable toolbars, for example the "standard" toolbar shown here:

Some of the icons are useful mathematical computation: 



is the "Autosum" icon, which enters the formula "=sum()" to add up a range of cells.

 





is the "FunctionWizard" icon, which gives you access to all the functions available.






 is the "GraphWizard" icon, giving access to all graph types available, as shown in this display:






Excel can be used to generate measures of location and variability for a variable. Suppose we wish to find descriptive statistics for a sample data: 2, 4, 6, and 8.

Step 1. Select the Tools *pull-down menu, if you see data analysis, click on this option, otherwise, click on add-in.. option to install analysis tool pak.

Step 2. Click on the data analysis option.

Step 3. Choose Descriptive Statistics from Analysis Tools list.

Step 4. When the dialog box appears:

Enter A1:A4 in the input range box, A1 is a value in column A and row 1, in this case this value is 2. Using the same technique enter other VALUES until you reach the last one. If a sample consists of 20 numbers, you can select for example A1, A2, A3, etc. as the input range.

Step 5. Select an output range, in this case B1. Click on summary statistics to see the results.

Select OK.

When you click OK, you will see the result in the selected range.

As you will see, the mean of the sample is 5, the median is 5, the standard deviation is 2.581989, the sample variance is 6.666667,the range is 6 and so on. Each of these factors might be important in your calculation of different statistical procedures.

...............................................

Normal Distribution

Consider the problem of finding the probability of getting less than a certain value under any normal probability distribution. As an illustrative example, let us suppose the SAT scores nationwide are normally distributed with a mean and standard deviation of 500 and 100, respectively. Answer the following questions based on the given information:

A: What is the probability that a randomly selected student score will be less than 600 points?

B: What is the probability that a randomly selected student score will exceed 600 points?

C: What is the probability that a randomly selected student score will be between 400 and 600?

Hint: Using Excel you can find the probability of getting a value approximately less than or equal to a given value. In a problem, when the mean and the standard deviation of the population are given, you have to use common sense to find different probabilities based on the question since you know the area under a normal curve is 1.

Solution:

In the work sheet, select the cell where you want the answer to appear. Suppose, you chose cell number one, A1. From the menus, select "insert pull-down".

Steps 2-3 From the menus, select insert, then click on the Function option.

Step 4. After clicking on the Function option, the Paste Function dialog appears from Function Category. Choose Statistical then NORMDIST from the Function Name box; Click OK

Step 5. After clicking on OK, the NORMDIST distribution box appears:

i. Enter 600 in X (the value box);

ii. Enter 500 in the Mean box;

iii. Enter 100 in the Standard deviation box;

iv. Type "true" in the cumulative box, then click OK.

As you see the value 0.84134474 appears in A1, indicating the probability that a randomly selected student's score is below 600 points. Using common sense we can answer part "b" by subtracting 0.84134474 from 1. So the part "b" answer is 1- 0.8413474 or 0.158653. This is the probability that a randomly selected student's score is greater than 600 points. To answer part "c", use the same techniques to find the probabilities or area in the left sides of values 600 and 400. Since these areas or probabilities overlap each other to answer the question you should subtract the smaller probability from the larger probability. The answer equals 0.84134474 - 0.15865526 that is, 0.68269. The screen shot should look like following:

Inverse Case

Calculating the value of a random variable often called the "x" value

You can use NORMINV from the function box to calculate a value for the random variable - if the probability to the left side of this variable is given. Actually, you should use this function to calculate different percentiles. In this problem one could ask what is the score of a student whose percentile is 90? This means approximately 90% of students scores are less than this number. On the other hand if we were asked to do this problem by hand, we would have had to calculate the x value using the normal distribution formula x = m + zd. Now let's use Excel to calculate P90. In the Paste function, dialog click on statistical, then click on NORMINV. The screen shot would look like the following:

When you see NORMINV the dialog box appears. 

i. Enter 0.90 for the probability (this means that approximately 90% of students' score is less than the value we are looking for)

ii. Enter 500 for the mean (this is the mean of the normal distribution in our case)

iii. Enter 100 for the standard deviation (this is the standard deviation of the normal distribution in our case)

At the end of this screen you will see the formula result which is approximately 628 points. This means the top 10% of the students scored better than 628. 

......................................................


要查看或添加评论,请登录

Minh Nguy?n的更多文章

  • The Ultimate Guide to Understanding Carbon Credits

    The Ultimate Guide to Understanding Carbon Credits

    Reference: https://carboncredits.com/ Carbon Markets 101 A carbon market allows investors and corporations to trade…

  • Who Verifies Carbon Credits?

    Who Verifies Carbon Credits?

    Reference: https://carboncredits.com/who-verifies-carbon-credits For this article, I would like to save it for reading…

  • Brainstorming Techniques

    Brainstorming Techniques

    Brainstorming is a creative group facilitation technique that encourages participation from all group members…

  • Forecasting in Power BI

    Forecasting in Power BI

    A visual step-by-step guide to forecasting using Power BI. In this post, we’ll go through the process of creating…

    1 条评论
  • KPIs Dành Cho B? Ph?n Thu Mua

    KPIs Dành Cho B? Ph?n Thu Mua

    B? ph?n thu mua c?a b?t kì doanh nghi?p nào, dù l?n hay nh?, có m?t trách nhi?m r?t l?n. Nó có nhi?m v? tìm ki?m hàng…

    1 条评论
  • Quy Trình Thu Mua, Quy Trình Mua Hàng Trong M?t Chu?i Cung ?ng

    Quy Trình Thu Mua, Quy Trình Mua Hàng Trong M?t Chu?i Cung ?ng

    L?a ch?n nhà cung c?p Ngay khi xác ??nh ???c nhu c?u v?t t? c?n mua, nhan viên cung ?ng ti?n hành nghiên c?u, l?a ch?n…

    1 条评论
  • Bài H?c Rút Ra T? 3 D? án Tri?n Khai ERP Th?t B?i

    Bài H?c Rút Ra T? 3 D? án Tri?n Khai ERP Th?t B?i

    Kh?ng ai ph? nh?n nh?ng l?i ích l?n t? vi?c tri?n khai h? th?ng ERP t?i doanh nghi?p. Song b?t c? c?ng c? m?nh m? nào…

  • 9 b??c c? b?n ?? tri?n khai ph?n m?m ERP thành c?ng

    9 b??c c? b?n ?? tri?n khai ph?n m?m ERP thành c?ng

    Doanh nghi?p c?a b?n ?ang ngày càng phát tri?n, h? th?ng qu?n ly doanh nghi?p hi?n t?i kh?ng th? ?áp ?ng nhu c?u ngày…

    1 条评论
  • ERP – Kinh Nghi?m Tri?n Khai Phan H? Qu?n Ly? S?n Xu?t

    ERP – Kinh Nghi?m Tri?n Khai Phan H? Qu?n Ly? S?n Xu?t

    Trong quá trình tri?n khai ERP, phan h? s?n xu?t (Manufacturing – MFG) ???c xem là phan h? khó, ph?c t?p và t?n nhi?u…

    2 条评论
  • #WhatIhavelearnedtoday-28012021

    #WhatIhavelearnedtoday-28012021

    What is Cloud? Cloud services are applications that run on the internet rather than on a company's own servers. An…

社区洞察

其他会员也浏览了