Sunteți pe pagina 1din 22

EXCEL GUIDE - PART 1 A Guide to Using Excel for Handling Data Introduction This section introduces you to Excel,

a powerful spreadsheet program, and its use in handling data. The aim of this section is to provide a basic familiarity with Excel, particularly its usefulness in helping us to analyse time series data, statistics and produce charts. The assumption in this section is that users have no prior skills in Excel, so if you have a good grounding in the package you may wish to use this section selectively. The section focuses on only a part of Excel's functions, but there should be sufficient here to allow you to continue independently, to find out perhaps more about the various shortcuts that have not been covered here. Contents

Getting started The grid and its cells Selecting a cell Selecting a range of cells Entering data in a selected cell Data entry on the worksheet Mathematical functions in Excel How to put a formula into a cell Useful short-cuts When things go wrong Updating totals Copying a formula Short-cut for copying formulae Formatting options

First Steps

Getting started Select Excel from your list of available programs in Windows. After Excel has opened, you will notice that its screen is a grid, made up of many equal-sized rectangles. At the top of the screen should be the usual Windows menu options. Beneath this there will be a toolbar with a certain number of icons (the exact number of icons depends on your pc setup). At the bottom of the screen are a row of shapes labelled Sheet 1, Sheet 2 and so on. This whole page is called a worksheet. At the top-left corner of the grid there is a label marked Book 1. This is the name of the worksheet that you start working with. This name

only changes when you change it to a name that you select. [Top]

The grid and its cells The worksheet grid is built of columns which are given an alphabetical letter on the top; and rows running horizontally across the sheet, each of which is given a number. The rectangles created by the combined columns and rows are known as cells. [Top]

Selecting a cell When Excel is open, the empty worksheet is highlighted at cell A1 (it has a black outline). This outline shows that cell A1 is selected and can receive some data. You can select any cell you want by moving the mouse and clicking the left-hand mouse button. Do this and notice how cell A1 no longer has a black outline and is therefore no longer selected. The cell that you move to and click on, in the way described above, is now the selected cell, in place of the previous one. Practice this manoeuvre until you are familiar with selecting cells. You can also move from one cell to another by using the arrows on your keyboard. This is convenient when you want to move only small distances from the selected cell; using the mouse is appropriate in a number of other procedures. [Top]

Selecting a range of cells You will find that often you will want to select more than one cell at a time. This is carried out by using a click-and-drag mouse movement. Let's say you wish to select cells A1, A2, A3 and A4. Move the mouse pointer to cell A1 and push and hold down the left-hand mouse button. Drag the mouse, whilst holding the left-hand button down, from cell A1 straight down to cell A4. Let go of the mouse button when you have selected the four cells. When you try this, you'll notice that the first cell is white and the other selected cells are black; also, there's a highlighted outline around the whole area selected. If this process goes wrong, simply move the mouse pointer away from the range you want to highlight, select a cell outside the range, then start again to select the desired range of cells. You can use the same procedure to select cells horizontally as well as vertically.

A combination of vertical and horizontal selections is also possible using this process. Clicking and dragging A1 to A4 can be continued into a horizontal movement with the mouse until the whole range selected includes B1, B2, B3 and B4 as well. This selection of blocks of cells in separate columns and rows, as well as in adjacent columns and rows, is very commonly used; so make sure you are comfortable carrying out the procedure. Finally, you can select entire rows or columns by moving the mouse arrow to the letter or number that identifies that row or column. Clicking the left-hand mouse button on that letter or number turns the entire row or column black. This is a useful process if you wish to add or delete a column, or to change the format of all the data in the column or row, for instance by emboldening it. [Top]

Entering data in a selected cell Now that you're feeling comfortable with selecting cells, you're ready for the next step, which is to start putting information into the worksheet. In general there are three types of information that we may want to enter into our selected cells: letters, numbers and formulae. If you select cell A1 and use the keyboard to type the words 'Wage rates', you will notice that the words 'Wage rates' appear in cell A1 and also, on a line underneath the toolbar. This area is called the formula bar and as you type your information into the selected cell, you can follow what you are typing by reading this bar. Any mistakes in typing can be corrected easily with the arrow keys and the delete button. When you have typed the title 'Wage rates', hit the Enter key. The selected cell now moves to cell A2 and the text you typed is now entered in cell A1. If you have to change this title, you select the cell, using the mouse or the arrow keys, and then press the backspace button. This removes the contents of cell A1 and you are then free to enter whatever title you want. In fact, you may notice that it is not strictly necessary even to press the backspace button, to carry out this procedure. If you select a cell with some information in it, the material will disappear as soon as you start to enter the new information. Numbers are entered into cells in exactly the same way: select the cell, enter the number(s), hit Enter. [Top]

Data entry on the worksheet Now you should be looking at a worksheet in Excel that is blank apart from the title 'Wage rates' in cell A1.

Next let's enter some more information into this worksheet: in column A, starting in cell A2, enter the following ten numbers in order, ending at cell A11. 3.87, 3.90, 3.94, 3.99, 4.06, 4.12, 4.20, 4.20, 4.22, 4.45. These numbers represent the hourly wage rates (in sterling) of the ten lowest paid jobs in the UK in 1997 (before the introduction of the National Minimum Wage). Let's say we want to analyse these to compare them with low pay in other EU countries. There are a number of ways in which we could describe this data, but the most common of these is to calculate the average of all the wage rates. In this case we want to find the mean average of the data. This is something Excel can do quickly for us, but we must learn some of the symbols for mathematical operations in Excel first. Make sure you save this worksheet if you want to leave this Guide temporarily. This will save you having to input this data again later. [Top]

Mathematical functions in Excel You can find the following mathematical symbols on your keyboard: + - / *. To instruct Excel to perform a mathematical operation, you simply key-in the number, the symbol for the operation, and the second number. Make sure you don't leave any spaces between any parts of the instructions. So, =9*4 tells Excel to multiply 9 by 4. =83.2/17.1 tells Excel to divide 83.2 by 17.1 =A4*.95 tells Excel to multiply the value in A4 by .95 Excel performs calculations in the usual mathematical way. In other words it doesn't necessarily complete all operations from left to right. First, Excel completes all operations in brackets, then it multiplies and divides, and finally it adds and subtracts. Be sure to take care about the sequence in which Excel carries out the operations. A good way to understand this point is to carry out the following exercise: Go to your worksheet and select cell C1 and type in the following formula: =2+4*5 Then hit Enter. The result in cell C1 is 22. Now select cell C2 and type in =(2+4)*5 and hit Enter. Result? 30. Delete the numbers in cells C1 and C2 before continuing. Remember the importance of putting the equals sign in before the formula that you

want Excel to perform. The equals sign tells Excel to carry out the calculation rather than just put in the numbers that you type into a cell. [Top]

How to put a formula into a cell If you learn the ways of using formulae in Excel, you will be able to use the package to carry out quickly all manner of complicated mathematical functions. Go back to your worksheet with the list of ten hourly wage rates in cells A2 to A11. If you wanted to know the average level of wages in the group, you'd need to add up the list of numbers, and divide the result by the number of items on the list. Excel will do this for you. Select cell A13. This is the cell that we want to record the total in. Type in the formula that follows. Remember to leave no gaps in this or any formula: =Sum(A2+A3+A4+A5+A6+A7+A8+A9+A10+A11) Then hit Enter. The total (40.95) will appear in cell A13. The formula told Excel to add up a range of cells and has shown each cell in the series to be summed. If you get an error message or the formula seems to have been ignored, don't panic! Review carefully the formula you have entered into cell A13. If you have made only the slightest error, Excel won't be able to perform the operation. If the numbers in any of the cells indicated in the formula, change, the total in cell A13 will change too. Try changing the value in cell A7 to 4.17, (by left-hand mouse clicking in cell A7), entering the new value and hitting Enter and notice what happens to the total in A13. After doing this, change A7 value back to 4.12. Now, let's get to calculating the average of the wage rates. We do this by dividing the total we have produced with the formula in cell A13, by the number of entries in the list. So select cell A14 and enter the following formula: =A13/10 This tells Excel to take the total in cell A13, divide it by 10 and put the result in cell A14. Hit Enter and see the average appear in A14. As before, if any of the values change in the original list, then the values in cells A13 and A14 will alter accordingly. Try to change the value in cell A7 to 4.17 again. Change A7 value back to 4.20 afterwards. Because formulae in Excel can be quite long, we could have chosen to combine the two

operations in cells A13 and A14. Try entering the following formula into cell A15: =Sum(A2+A3+A4+A5+A6+A7+A8+A9+A10+A11)/10 Notice that if you have entered the formula correctly, you should see the same result in cell A15 as you have in A13. [Top]

Useful short-cuts Even with the combined formula that you have just used in cell A15, the process may seem a little laborious. Fortunately, we can use a number of short-cuts to streamline this effort. In the previous section we created a formula for the total of the ten cells by entering the value in each of the cells. The way to achieve the same results in a fraction of the time is to use the short-cut =Sum(A2:A11) This formula tells Excel to add up all the values in the cells from A2 to A11. In the same way, Excel will carry out certain calculations by a word command alone. In this case, we can ask Excel to give us the average of the values in the given range of cells. Simply select the cell where you want the average to appear and type in the following formula: =Average(A2:A11) There is a large number of operations for which you can use Excel in this way. For example, if you want to know the square root of a value in a particular cell, simply select the adjacent cell and enter the following formula: =sqrt(cell number) [Top]

When things go wrong If you make a mistake in entering any formula, you will get an error message which is usually preceded by the symbol #. This will happen also if you ask Excel to perform an operation on a cell which is empty and if you ask it to carry out the operation on the cell in which you are entering a formula.

The immediate response to any error message should be to check carefully the formula entered or the cell in which it is entered. If you get an error message that you don't understand, use the Excel Help menu and the Index option. [Top]

Updating totals If we return to the list of wage rates in column A and imagine that we wanted to calculate the impact of a pay increase. If, for example, we wanted to view the effect of a 3% claim on the wage rate in cell A2, we multiply the value in that cell by 103/100 (or by 1.03). Excel can perform this for us. On the worksheet you used in earlier tasks, select cell B1 and enter the heading '3% increase'. Then select cell B2. This is where we want the wage rate in A2 to be compared to the rate after the pay increase. To get Excel to do this, enter in cell B2 the following formula: =A2*1.03 Remember not to leave any spaces in the formula. This formula tells Excel to multiply the value in A2 by 1.03 and then enter the result in cell B2. [Top]

Copying a formula Let's say we want to convert all the remaining wage rates in column A to reflect the wage increase outlined above. We could choose to repeat the process that we used in cell B2, through cells B3, B4, B5 to B11. There is a much faster way to get the same result. We simply copy the formula in cell B2 and apply it to all the cells we want updating. To do this, carry out the following steps: 1. Select cell B2. It already has the formula in it, of course, and we want to copy it and apply it to all the cells from B3 to B11. 2. Move the mouse pointer to the Edit drop-down menu at the top of the screen and left click on the Copy option. Cell B2 should now have a rotating black and white highlight around it. 3. Now put the mouse pointer in cell B2, press down the left-hand mouse button and hold it down. 4. Next, drag the mouse pointer through cells B3, B4, B5, B6, B7, B8, B9, B10 and B11. The selected cells should turn black, except for cell B2, which should remain as before.

5. Release the left-hand mouse button when you have selected the desired range of cells. 6. If you make a mistake, click on a cell at random to clear the mistake, and try again. 7. When you are happy with your selection of cells, hit Enter. The selected cells in the B column should now contain the updated values. 8. Click outside the range of highlighted cells and the black background to the cells should disappear. The formula will now have been copied into the previously empty cells.

[Top]

Short-cut for copying formulae Once you have entered a formula into a cell, you can easily copy that formula by using this short-cut. Firstly, select the cell which contains the formula. Notice that when you select the cell, there is a border around the cell, with a small rectangle in the bottom right-hand corner. If you position the mouse pointer directly over that small rectangle, the pointer changes into a cross-hair. Press down and hold the left-hand mouse button, dragging it through the cells into which you want to copy the formula. When you reach the last of your selected cells, release the left mouse button and select a cell outside the range. [Top]

Formatting options Excel offers you the opportunity to change the layout of your worksheet in a number of ways; here are two of these options: You can change the width of the columns manually, by positioning the mouse pointer directly over the line between the two letters that identify a column, (for instance between B and C column). Notice that the cursor becomes a double arrow. If you hold down the left-hand mouse button and move to the left or right, you will see that the width of the column changes. This is a useful option if the cell contains more information than it can display in its original format. You can also add or delete rows or columns easily in Excel. To do this, you need to select the particular row or column, go to the Edit menu and click on the Delete option. Not only does that area in the worksheet disappear, but so too does all the data contained within it. This means that all formulae entered in the row or column will also be lost.

If you make a mistake and didn't mean to perform a row or column deletion, remember that you can restore the lost information by clicking on the Undo button on the Toolbar. If you're not sure which button this is, run your mouse pointer along the Toolbar slowly, stopping as you reach each button; a description of the button function will appear underneath the mouse pointer. To insert a row or column, you need to select the whole row or column, click on the Insert label at the top of the page and select Row or Column from the drop-down menu that appears. The new row will appear immediately above the row you selected; the new column will appear immediately to the right of the column you selected. Notice that, unlike with row or column deletion, inserting a new row or column does not affect any formulae that are already entered in the worksheet. This is because Excel automatically changes the entries already made, to accommodate the new column. Practice these deletion and insertion steps until you are comfortable with the procedures. [Top] EXCEL GUIDE - PART 2 A Guide to Using Excel for Handling Data Contents

Saving, opening and closing files Working with multiple sheets Sorting data Filtering data Using Excel for Inferential Statistics

Saving, opening and closing files Data entered into an Excel workbook is kept in units known as files. These files can be opened, saved, closed, and then opened again, by following the right procedures. For this section, it will be useful to open a new Excel file. Select cell A1 and enter your name. Now save this information, by selecting File and choosing one of the three 'save' options that are listed - save, save as, and save workspace. The first two of these options are the most important to us at this stage:

Save will save the workbook with whatever name is currently displayed (either in the file name bar, or at the top left hand side of the sheet. So, saving by this process will save this worksheet with the file name 'Book 1'. Save as allows you to choose a file name that is appropriate for you. This could follow some system of filing that you use, or just an easy-to-remember name. Once you have given the workbook a name, you can use the save option to save the workbook by the name you have already given it. File names must contain no more than eight characters and have no blank spaces. So, use the save as option, calling the file 'myfile1.xls'. The file is now saved with the name myfile1. We now want to close the file and re-open it to make sure that the saved information has really been kept. Select File from the menu bar and click on Close. The file will now be closed. We could do a number of things now: from selecting File from the menu bar and clicking on Exit, we could leave the program; to begin to create a new workbook we would select File from the menu bar and click on New; or we could open an existing workbook, which is what we want to do now: Select File from the menu bar and click on Open. All the Excel files that are available for use will appear. Click on the one that you want to open (myfile1) and then click on OK. Myfile1 should appear on the screen exactly as you last saw it. It is possible to work with two separate workbooks: with myfile1 still open and onscreen, select File from the menu bar and then New. A new workbook, which by default will be named as Book2, will appear on the screen. It is simply a matter of using the Window option on the menu bar to move from one of these workbooks to the other. Now use Window to make Book2 active and enter your age in cell A2. Now go through the Save As process again, making sure that you change the default name of thre workbook to 'myfile2'. Then close both files by selecting File from the menu bar and Close from the present screen and then File and Close again from the screen that appears next. Both workbooks should now be closed and a blank screen should appear. Now select File and Open. Click on the myfile1 name that appears in the left-handside list of files available for opening, and then on the myfile2 name. Both files will now be open once again.

[Top]

Working with multiple sheets: The sheets of an Excel workbook are automatically named Sheet 1, Sheet 2, Sheet 3, and so on. Often, though, you will want to change these to names that are relevant to you task and needs. To see how this is done, open a new Excel workbook. With Sheet 1 open, double click with the left-hand mouse button on the Sheet1 tab at the bottom left of the screen. This causes the tab to be highlighted in black. Press the delete key and enter 1999data, which should now appear on the sheet tab. Now double click on the Sheet2 tab and rename it 2000data. The data in the various sheets of the workbook can be linked in a number of ways. Let's try to do this now: Select the 1999data sheet by clicking once, then in A1 enter the label 'Quarterly profits'. Next in cells A2:A5 enter the following data: 15000 21000 12500 8250 Now select the A1 cell and copy the label on this sheet to the 2000data sheet by choosing Copy from the Edit function on the menu bar, (cell A1 then flashes). Click on the 2000data sheet tab and click in cell A1 of this sheet. Now select Edit again and Paste. Notice how the label appears in cell A1 of the 2000data sheet. Making sure that you still have 2000data sheet selected, enter the following data in the A2:A5 cells: 13000 26000 15900 12350 What we have done is to enter the firm's quarterly profits for 1999 in the range A2:A5 of the 1999data sheet, and the firm's 2000 profits in the corresponding area of the 2000data sheet. Now we are going to name a new sheet 1999-2000 data and get Excel to calculate the combined two year profits. Firstly, re-name sheet3 as 1999-2000data in the same way as we re-named sheets1 and 2. Then in cell A1 enter the label 'Combined profits 1999-2000'. Now activate cell A2 of the 1999-2000data sheet and enter the following formula: =1999data!A2+2000data!A2

Notice that we use an exclamation mark to separate the sheet reference from the cell reference in that sheet. A result of 28000 should be returned. What we have done is to instruct Excel to calculate the combined profit for the first quarter of 1999 and 2000. These values were located in cell A2 of the 1999data sheet and cell A2 of the 2000data sheet. This process can be mirrored throughout the four quarters of each year by activating the 'handle' of cell A2 on the 1999-2000data sheet (at the bottom right-hand corner of the cell): Activate cell A2 of 1999-2000data sheet, activate the handle and drag down to cell A5. When you release the mouse button, the formulae should have been entered into the cells and the combined quarterly profit values should now appear. This process may not have seemed too laborious, but we were dealing with data for two years; imagine if we had data over a twenty year period to handle! The formula entered into cell A2 and subsequently copied through the sheet would quickly become too complicated. As you've probably guessed, we can use a short-cut to overcome this problem. Try entering the formula: =SUM(1999data:2000data!A2:A2) we get Excel to add the A2 cells of all the sheets within the range specified either side of the first colon sign in the formula. Check for yourself that this works by replacing the formula in cell A2 of 1999-2000data with this new formula. Then copy the formula down into cells A3:A5 to get the 2nd, 3rd and 4th quarter combined totals.

[Top]

Sorting data: Excel has a very powerful data sorting feature. Use the accompanying Excel 'Eupower' workbook to follow an illustration of this degree of sophistication. Get eupower.xls (15K).

On the EUpower workbook, we have the EU Council of Ministers' voting rights and European Parliament representation of each of the 15 member states, agreed at the December 2000 Inter-Governmental Conference in Nice. The column headers at the top of the sheet identify what we call fields and the individual EU member states' names are known as records. As you can tell from an inspection of the data, there are several states that share either the same number of voting rights or MEPs. It is also clear that the data have not been sorted into any kind of order. What we are going to do is to sort the data into descending order of voting rights and then to use the total of MEPs for each member state as an additional sorting criterion. The first thing to do is to select the entire area, from A1 to C16 as the range to be sorted. Note for future reference that the whole area of a worksheet must represent the sorting range. If your worksheet contained, say, 10 fields and 30 records, then even if you intend to sort those records only on the basis of one of the fields, you must include all 10 fields and all 30 records in the range selected for the sort. So, with the A1:C16 range selected, choose Data and then Sort from the menu bar. A dialogue screen should appear. Click on the Sort By tab and select 'Votes' as the primary sort from the list of available fields that appears. The Descending button alongside should also be clicked. The secondary sort, to differentiate between tied states, was activated by clicking on the first Then By tab and selecting MEPs from the list. The Descending button was selected once again. Note that if there was a third criterion on which the sort could proceed, there is the capacity to do this within the Sort function.

[Top]

Filtering data: This is the process of selecting those record from a list that meet certain criteria, decided upon by the user. To illustrate this function we will use the Eupower workbook from the previous task. The first thing to do is to identify to Excel all of the field names and the full list of records. This is done by clicking and dragging with the mouse A1:C16.

Next choose Data, then Filter and then AutoFilter from the menu bar. When this is done you should see that four arrow tabs have been inserted into the cells containing the field names (A1:C1). To interrogate this data list you need to click on the arrow tab in the field that relates to the question you want to ask. For example, if you want to know which EU member states have voting rights over and including the level of 10, you should use the process that follows: Click on the arrow tab in the B1 cell, because this is the top of the votes field, and from the prompt that follows, select (Custom...). A dialogue box should appear, within which you will be offered the chance to select from a list of arithmetic operators. From this list select 'greater than or equal to' and on the adjacent box enter the criterion, which in this case is 10 (votes). Clicking on OK should then start the filtering process, which should result in the following outcome: EU state Germany France UK Italy Spain Greece Belgium Portugal Sweden Austria Votes MEPs 29 29 29 29 27 12 12 12 10 10 99 74 74 74 52 25 20 20 20 18 17

Netherlands 13

Notice that the arrow tab in cell B1 has changed colour, from black to blue. This shows you that this is a filtered list. You can change the list back to its unfiltered state by clicking on the blue arrow tab and selecting (All) from the prompt that follows. This restores the list to its full status and the arrow tab reverts to its original black colour. You may have seen that the Custom AutoFilter dialogue box also contains a second set of tabs at the bottom of the box. These allow you to ask more complex questions. For

example, you may want to know the EU member states whose voting rights are equal to or in excess of 10 votes, but do not exceed 27 votes. To do this, click on the arrow tab on the Votes field, select (Custom...), greater than 10. Then, making sure that the 'And' is checked in the middle of the screen, select less than and enter 28 in the bottom two tabs. Click OK and the records that comply with both of these criteria should be selected from the list, as is illustrated below: EU state Spain Greece Belgium Portugal Sweden Austria Votes MEPs 27 12 12 12 10 10 52 25 20 20 20 18 17

Netherlands 13

The next stage of this Excel guide requires that all of the original records are restored to their original state. To do this simply click on the arrow tab in B1 and select All from the list that appears. The first filtering examples only took place on the first available field 'Votes', but it is simple to broaden the interrogation and ask questions that relate to more than one field. For example, imagine that we wanted to know the names of those EU member states that have voting rights equal to and in excess of 10 votes and a total number of MEPs equal to or in excess of 15. To do this we follow the same procedure as before in the voters column, to select all records with a number of votes greater than or equal to 10. Once the list has been narrowed down to only include these records, click on the arrow tab in the MEPs filed and use the same procedure as above to select only those states whose total MEPs equal or exceed 15. You should find that the following list results: EU state Germany France UK Votes MEPs 29 29 29 99 74 74

Italy Spain Greece Belgium Portugal

29 27 12 12 12

74 52 25 20 20 20

Netherlands 13

Two additional points are needed to be made here: Firstly, selecting Print from a filtered list will produce a hard copy of the filtered list rather than the original full list. This is usually the best way of gaining a copy of the records that satisfy the criteria you have set. Secondly, you will often want to add the values in a filtered list. For example in the Eupower workbook used above, you might want to know the combined voting strength of those EU member states whose voting rights are at least equal in total to 10 , but not in excess of 28. But be careful, for a SUM function will not work on a filtered list, only on a list that has been left unfiltered. For filtered lists, Excel has a special totalling function known as SUBTOTAL.

[Top]

Using Excel for Inferential Statistics Much of the content of TimeWeb is about describing data sets. What we are interested in in this section is the process of inference from data sets. With inferential statistics we are dealing with a set of sample values, drawn from a larger data set known as the population. There's no guarantee that sample data are truly representative of the population from which it comes. If we can be confident about the sample data being representative, then we know that the sample data are going to be useful. We can then use what we know about the sample data to make judgements about the statistical nature of the population data. These judgements will always have to be subject to reservations. These are measured in terms of probabilities: for example, we may have a sample data set whose mean value appears to approximate to the population mean, bearing in mind that there is a ?% chance of this not being so. [Top]

EXCEL GUIDE - PART 3 A Guide to Using Excel for Handling Data Predicting the future using Excel Excel offers you the function of predicting a trend from some existing data. Once you are happy with the reliability of the data you have sourced, you can find out what would be the outcome for a dependent variable in the event of the independent variable (usually time) moving in steps. We shall use this Excel function to examine the behaviour of consumer expenditure in the UK on durable goods in a moment. But first, a word of warning! Most of the methods of forecasting involve projecting an existing trend forward. They rely on the important assumption that the past trend will continue into the future. There are more sophisticated methods of forecasting that tend to be model based. These models take into account certain external factors, which our Excel Trend function cannot. OK, with that out of the way, we can go ahead enthusiastically, but with caution over interpreting our results. The accompanying Excel spreadsheet (right click on the link and choose 'save as' if you want to save your own copy of the spreadsheet) contains data on consumer durable spending in the UK between 1985 and 1993. What we are going to do is go through the steps that are needed to arrive at a prediction for durables spending for 1994 to 1999. Firstly, here's a screenshot of the starting point for the example:

Next, we need to highlight the range which we will use to hold the predicted values. In this case these are B12:B17.

Then click on Insert from the menu bar, select Statistical and then Trend. This will produce a dialogue box as follows:

Now we need to enter the data values into the box, either by typing them or by clicking each box in turn and highlighting the range of cells in question. You may need to 'collapse' the dialogue box by clicking on the button in red to the right of the value. The following screen should result:

For the purposes of this example leave the Const parameter blank. To enter the function do not click on OK, but hold down the Ctrl and Alt keys while pressing the Enter key. The set of numbers that appears in the range B12:B17 are the predicted levels of spending on durable goods between 1994 and 1999. The screen should appear as follows:

Now all that remains to be done is to tidy up the appearance of the table prior to building it into your Word document or presentation. A note explaining the trended data and a source for the data is the minimum you will need. The finished table may result:

OK that's all there is to it! For some more exercises and information on these Excel functions why not try the worksheet on fantastic plastic. [Top] EXCEL GUIDE - PART 4 A Guide to Using Excel for Handling Data

Conducting a Z-Test: Two Sample Means All we have to do is collect the data on the two samples, request a z-test analysis from the Excel statistics options, and examine the table of the results. The following notes describe the procedure. 1. First enter in the data for your two samples, one in Column A and the other in Column B. The number of entries in each column does not have to be the same, but there must be more than 30 entries in each column. 2. Then, using the Descriptive Statistics tool from the Data Analysis option (on the Tools Menu), generate the table of Descriptive Statistics for each sample. Note down the figure for the Variance of each sample. 3. Then from the Data Analysis option, select the last item: z-test: Two Sample Means. When you get the dialogue box, in the Variable 1 Range box, indicate the range of the first sample in Column A (e.g., $A$1:$A$35). In Variable 2 Range, indicate the range of the second sample in Column B (e.g., $B$1:$B$48). In the Hypothesized Mean Difference Box, enter the figure 0. Since the Null Hypothesis, which we are attempting to refute, says that both samples come from the same population, we are hypothesizing that the difference between the means for the two populations is 0. 4. In the Variable 1 Variance (known) box enter the figure for the Variance for the sample in the A Column (you should have noted this down earlier, but you can find this figure in the Descriptive Statistics box generated in the second step described above). In the Variable 2 Variance (known) box enter the corresponding figure for the Variance of the second sample. 5. In the Alpha box the number 0.05 should already appear. Leave this alone for the moment (if it is empty or shows a number different from 0.05, then enter the number 0.05). The Alpha figure indicates the Confidence Level for this test. A figure of 0.05 states that you want to be 95 per cent certain of the result or, in other words, that you want the probability of being wrong to be .05 or lower. 6. In the Output Range box, type the number of the cell where you want the Output Table to appear (or alternatively, with the line active in the Output Range box, click the mouse on an empty cell). The Output Range table will take up three columns and twelve horizontal rows. 7. Then click on OK. After a couple of seconds, a table should appear in the place designated by the Output entry. This table has the heading: z-Test: Two Samples for Means. You will need to widen the left hand column of the table in order to read the names of the items. In the table there are figures for the following items: Mean, Known Variance, Observations, Hypothesized Mean Difference, z, P(Z<=z) one-tail, z Critical one-tail, P(Z<=z) two-tail, z Critical two tail.

The Mean figures gives the arithmetical average for each sample. It should be the same as the figure for the Mean in your Descriptive Statistics chart you generated earlier. The Known Variance similarly gives the Variance for each sample and corresponds to the Variance figures generated earlier (these are the figures you entered into the z-Test dialogue box). The Observations is the number of items in each sample. The Hypothesized Mean Difference should be 0 (the figure you entered in the z-Test dialogue box earlier). The z figure indicates in standard deviation units how far from the mean the figure for the difference between your two samples is located. Remember that the normal curve for all the differences between all the possible pairs of samples from the population has a mean of 0. Your two samples did not have the same mean; thus they fall away from the mean in the normal distribution. The z figure tells you how far away the difference falls. Following the z figure there are four lines, two concerning one-tail and two concerning two-tail testing. You will use one or the other of these pairs of figures, not both. The one you use will depend upon the nature of your Alternative Hypothesis. If your Alternative Hypothesis makes a claim about a particular difference between the two populations, then you need the one-tail figures. For instance, an Alternative Claim like "Women drink more alcohol than men" or "Lecturer 1 gives higher marks than Lecturer 2" or "People who smoke more than twenty cigarettes a day have more heart attacks than people who do not smoke" then you will be needing the one-tail figures. Since your Alternative Hypothesis argues that one of the populations will have a higher value than the other, then you are interested only in one end of the distribution curve. However, if your Alternative Hypothesis simply asserts that there will be a significant difference between the populations (without saying which will be higher or lower), then you need the twotail figures. For example, you will need a two-tailed test for any Alternative Hypothesis like the following: "There is a difference in the amounts of alcohol that men and women drink," "Lecturer 1 and Lecturer 2 mark at different standards," Note that the interpretation of the figures is the same, no matter which of the two you are using, but the figures will be different. The P(Z<=z) figure indicates the probability that the two populations are the same. So a figure here of, say, 0.02 would indicate that the probability of the Null Hypothesis being correct (that there is no difference between the populations) is .02 or 2 per cent. Put another way, there is a .98 probability that the Null Hypothesis is not correct (or p = .98). Whether or not the figure for P(Z<=z) enables you to confirm or dismiss the Null Hypothesis will depend upon the confidence level you set. If your level is .05, then a figure of .02 (smaller than the specification) indicates that the Null Hypothesis should be rejected and the Alternative Hypothesis affirmed. However, if the Confidence Level you have set is .01, then a result for P(Z<=z) of .02 (which is higher than the specification) enables you to affirm the Null Hypothesis. Another way quickly of determining whether to affirm or reject the Null Hypothesis is to examine the z Critical figure. This number indicates the value beyond which the z figure is too

high or too low for one to accept the Null Hypothesis. So to determine whether or not one should affirm or deny the Null Hypothesis, simply compare the z figure with the z-Critical figure. If the z figure is less than the z-Critical figure, you affirm the Null Hypothesis; if the z-figure is greater than the z-Critical figure, you reject it. If you change the Confidence Level in a z-test of this sort, you will notice that the z-Critical values will change. For instance, if you go back and start the z-test again, but this time in the Dialogue Box enter a value for Alpha of 0.01 (rather than 0.05), then you are demanding a Confidence Level of 99 per cent or, alternatively, you want a result in which there is only 1 per cent chance (p = 0.01) of your being wrong. If you do that and generate a second z-test: Two Sample for Mean table, you will notice that all the values in that table are the same as for the first table, except for the z-Critical values, which have increased. What that means is that if you want to be more confident of your result, you have to widen the interval within which you judge results to be acceptable. Note that whenever you state a conclusion to a z-test, you must indicate the confidence level you used. As we have discussed in the text, a Null Hypothesis which you reject at a .05 value for Alpha (a confidence of 95 per cent), you may have to accept at a .01 value for Alpha (a confidence of 99 per cent). [Top]

S-ar putea să vă placă și