Download presentation
Presentation is loading. Please wait.
Published bySharon Richards Modified over 9 years ago
1
Analyzing Data Over Time - Part 2 Analyzing Data Over Time Part 2, Slide 1Copyright © 2004, Jim Schwab, University of Texas at Austin
2
Forecasting with an irregular time series In this exercise we will chart change in TANF (AFDC) recipients and forecast one time period into the future using a moving average. We use a moving average when there is no particular pattern to the number of clients from one year to the next. A moving average forecasting strategy will fit almost any time- series very well. Its limitation is that it is generally ineffective at forecasts more than one time period into the future. It should not be used if either a linear or exponential time series fits the historical data well. To obtain data for this analysis, we look to the web site for the Administration for Children and Families of the U.S. Department of Health and Human Services. Specifically, we will use the table: Temporary Assistance for Needy Families (TANF), Percent of Total U.S. Population, 1960-1999. In this activity, we will also gain some insight into one of the reasons for the success of welfare reform initiatives, which is the fact that the number of families on welfare was already starting to decline at the time many of the reform measures began. Analyzing Data Over Time Part 2, Slide 2Copyright © 2004, Jim Schwab, University of Texas at Austin
3
Administration for Children & Families web site Navigate to the Statistics web page for the Administration for Children & Families by typing in the URL shown in the address box. Analyzing Data Over Time Part 2, Slide 3Copyright © 2004, Jim Schwab, University of Texas at Austin
4
Locate Percentage of the US Population on Welfare Scroll down to the bottom of the web page to locate the link to the data for the Percentage of the US Population on Welfare by Year Since 1960 and click on the link. Analyzing Data Over Time Part 2, Slide 4Copyright © 2004, Jim Schwab, University of Texas at Austin
5
The data table for TANF recipients The web page contains a table that includes the number of welfare recipients for each year. Analyzing Data Over Time Part 2, Slide 5Copyright © 2004, Jim Schwab, University of Texas at Austin
6
Copy the data table to the clipboard First, select all of the rows in the table from the header row down through the data for 2002. Second, select the Copy command from the Edit menu to copy the data to the clipboard. Analyzing Data Over Time Part 2, Slide 6Copyright © 2004, Jim Schwab, University of Texas at Austin
7
Paste the clipboard into the worksheet We want to copy the data table on the clipboard to our Excel worksheet. First, select cell A1, if necessary, as the destination for the table. Second, click on the Paste tool button. The table is pasted into the worksheet. Analyzing Data Over Time Part 2, Slide 7Copyright © 2004, Jim Schwab, University of Texas at Austin
8
Save the data as an Excel Workbook To rename the workbook and save it in a directory where we can later find it, we complete the specifications in the Save As dialog box. We will name the workbook TANFRecipients.xls and save it as an Excel file on our computer’s hard drive. Analyzing Data Over Time Part 2, Slide 8Copyright © 2004, Jim Schwab, University of Texas at Austin
9
Delete extraneous columns C and D We do not need the data in columns C and D, so we delete them from the worksheet, leaving only the Year column and the Recipients column. Analyzing Data Over Time Part 2, Slide 9Copyright © 2004, Jim Schwab, University of Texas at Austin
10
Remove the web formatting from the table To remove the web formatting (colors and fonts) from the cells, select the cells A1 through B42 and choose the Clear > Formats command from the Edit menu. Analyzing Data Over Time Part 2, Slide 10Copyright © 2004, Jim Schwab, University of Texas at Austin
11
Format the recipient data First, select the cells with the recipient data: B2 through B42. Second, click on the Comma Style tool button to add comma separators to the population numbers. Third, click on the Decrease Decimal tool button twice to eliminate the decimal and trailing zeros added by the comma formatting. Analyzing Data Over Time Part 2, Slide 11Copyright © 2004, Jim Schwab, University of Texas at Austin
12
Format the table First, bold and center both column headers. Second, put outside borders around cells A1 through B1, cells A1 through A42, and cells B1 through B42. Analyzing Data Over Time Part 2, Slide 12Copyright © 2004, Jim Schwab, University of Texas at Austin
13
Delete the entry for 2000 from the table Change the entry in cell A42 from June 2000 to 2000. We will try to predict the value for the year 2000. Clear the value for 2000 from the table. This is the value that we will forecast. Right click on cell B42 and select Clear Contents from the popup menu. We note the actual value of 5,780,543, which we can compare to our predicted value. Clear the value for 2000 from the table. This is the value that we will forecast. Right click on cell B42 and select Clear Contents from the popup menu. We note the actual value of 5,780,543, which we can compare to our predicted value. Analyzing Data Over Time Part 2, Slide 13Copyright © 2004, Jim Schwab, University of Texas at Austin
14
Create chart for population by year First, select the data for the chart, cells A2 through B41. Second, open the Chart tool bar and select the XY (Scatter) Chart as the type of chart to create. After the basic scatter chart has been created, close the Chart tool bar. We will use a line chart to show the average progress for each review period. Though Excel has a chart type called a Line chart, we will use the XY (Scatter) chart. Analyzing Data Over Time Part 2, Slide 14Copyright © 2004, Jim Schwab, University of Texas at Austin
15
Position the chart Move the chart so that its top, left corner is in the upper left corner of cell C1. Analyzing Data Over Time Part 2, Slide 15Copyright © 2004, Jim Schwab, University of Texas at Austin
16
Resize the chart Resize the chart on the worksheet by dragging its handles. Analyzing Data Over Time Part 2, Slide 16Copyright © 2004, Jim Schwab, University of Texas at Austin
17
Add lines to connect the data points The default XY (Scatter) chart does not connect the data points with lines. We will change the chart type to add the lines, even though there are so many data points that they appear to follow a line. Right click on the chart area, and select Chart Type from the popup menu. Analyzing Data Over Time Part 2, Slide 17Copyright © 2004, Jim Schwab, University of Texas at Austin
18
Make chart scatter with data points connected by lines In the Chart Type dialog box, click on the thumbnail sketch of a scatter chart with data points connected by lines. Click on the OK button to change the chart type. Analyzing Data Over Time Part 2, Slide 18Copyright © 2004, Jim Schwab, University of Texas at Austin
19
Remove the legend from the chart To remove the legend from a chart, right click on the legend and select Clear from the popup menu. We have only one series of data on the chart, so we do not need the legend, which does not really contain any useful information on its own. Analyzing Data Over Time Part 2, Slide 19Copyright © 2004, Jim Schwab, University of Texas at Austin
20
Add a title to the chart and to the axes Right click on the chart and select Chart Options from the popup menu. Click on the Titles tab. Right click on the chart and select Chart Options from the popup menu. Click on the Titles tab. First, click in the Chart title text box and type TANF Recipients, 1960-1999 as the chart title. After a slight delay, Excel adds the chart title to the thumbnail sketch of the chart. Second, select the Value (X) axis text box and type Year. Third, select the Value (Y) axis text box and type Number of Recipients. Analyzing Data Over Time Part 2, Slide 20Copyright © 2004, Jim Schwab, University of Texas at Austin
21
Reduce the size of the title font Select the chart title and reduce the size of the text to 12 point Bold Arial. Analyzing Data Over Time Part 2, Slide 21Copyright © 2004, Jim Schwab, University of Texas at Austin
22
Reduce the size of the title font for the axes Select the vertical axis title and reduce the size of the text to 10 point Bold Arial. Select the horizontal axis title and reduce the size of the text to 10 point Bold Arial. Analyzing Data Over Time Part 2, Slide 22Copyright © 2004, Jim Schwab, University of Texas at Austin
23
Format the font for the axes labels Format the data labels and the labels on both axes so that they are displayed in 8 point, Arial Bold. Analyzing Data Over Time Part 2, Slide 23Copyright © 2004, Jim Schwab, University of Texas at Austin
24
Clear the plot area background color Right click on the Plot Area of the bar chart and select Clear from the popup menu. This will clear the gray background color from the plot area. We will not remove the grid lines. With so many data points, we cannot use data labels, so the only means we have for estimating values for any given year is supported by the grid lines. Analyzing Data Over Time Part 2, Slide 24Copyright © 2004, Jim Schwab, University of Texas at Austin
25
Add a trend line to the chart Right click on one of the data points and select Add Trendline from the popup menu. Analyzing Data Over Time Part 2, Slide 25Copyright © 2004, Jim Schwab, University of Texas at Austin
26
Complete the add trend line dialog box First, the default Linear trend line is the one we want to test first, so we accept the default. Second, we click on the OK button. Analyzing Data Over Time Part 2, Slide 26Copyright © 2004, Jim Schwab, University of Texas at Austin
27
The linear trend line on the line chart The trend line is drawn as a straight black line through the middle of the data points. It should be immediately obvious that the straight line is ineffective in representing the pattern of the data. Analyzing Data Over Time Part 2, Slide 27Copyright © 2004, Jim Schwab, University of Texas at Austin
28
Change the type of the trend line We will try another type trend line to see if we can obtain a pattern that better fits the historical data. Double click on the trend line to open the Format Trendline dialog box. Analyzing Data Over Time Part 2, Slide 28Copyright © 2004, Jim Schwab, University of Texas at Austin
29
Trend lines that change direction First, if necessary, click on the Type tab in the Format Trendline dialog box. The thumbnail sketches for the Polynomial and the Moving Average trend lines are capable of changing direction, similar to the pattern we see in the TANF data. Polynomial trend lines are difficult to work with and can easily be over-fitted to a set of points without any real understanding of why we would expect the pattern to hold true in the future. We will test the application of a Moving Average trend line. Polynomial trend lines are difficult to work with and can easily be over-fitted to a set of points without any real understanding of why we would expect the pattern to hold true in the future. We will test the application of a Moving Average trend line. Analyzing Data Over Time Part 2, Slide 29Copyright © 2004, Jim Schwab, University of Texas at Austin
30
Request an moving averages trend line The trend line that can fit a difficult pattern like this is a moving averages trend line. In a moving averages trend line, each forecast is the average of some previous number of data points. We will use a two-period moving average. First, click on the Moving Average thumbnail sketch to select it. We will accept the default of 2 for Period. Second, click on the OK button to display the trend line on the chart. Analyzing Data Over Time Part 2, Slide 30Copyright © 2004, Jim Schwab, University of Texas at Austin
31
TANF recipients chart with moving averages trend line The moving averages trend line fits the pattern of our data points very well. It has a drawback, however, in that it can only really be used to predict one time period into the future. Analyzing Data Over Time Part 2, Slide 31Copyright © 2004, Jim Schwab, University of Texas at Austin
32
Format the trend line We will change the color and thickness of the trend line to improve its visibility on the chart. Double click on the trend line to open the Format Trendline dialog box. Analyzing Data Over Time Part 2, Slide 32Copyright © 2004, Jim Schwab, University of Texas at Austin
33
Change the color and thickness of the trend line First, click on the Patterns tab where color selection is located. Second, click on the Color drop down palette and select the Red color swatch. Third, click on the Weight drop down arrow and select the thickest line available, the last one in the list. Fourth, click on the OK button to apply the color. Analyzing Data Over Time Part 2, Slide 33Copyright © 2004, Jim Schwab, University of Texas at Austin
34
The revised moving averages trend line The trend line with a thick red line is displayed on the chart. Analyzing Data Over Time Part 2, Slide 34Copyright © 2004, Jim Schwab, University of Texas at Austin
35
Forecasting with moving averages Each point on the moving averages trend line is computed by averaging the values for the previous two time periods. For example, the value for 1999 on the moving averages trend line is the average of the values for 1998 and 1999 ( 8,770,376 + 7,202,639 / 2 = 7,986,508). To forecast the future time period of 2000, we would compute the average of the last two available data points, 1998 and 1999. We will compute this forecast with the average function on the next slide. We should not try to forecast past 2000, because the forecast would actually be based on a number that was itself a forecast, i.e. 2001 would be forecast as the average for 2000 and 1999, but 2000 is itself a forecasted number rather than historical data. Analyzing Data Over Time Part 2, Slide 35Copyright © 2004, Jim Schwab, University of Texas at Austin
36
Forecasting the TANF families for 2000 First, to distinguish our forecast from the years for which we have actual data, we type the title 2002 Forecast in cell A42. Autofit the width of the column so that the cell contents are completely visible. Second, select cell B42 and type the average function: =AVERAGE(B40:B41). Our prediction for the next year is the same as the average of the two previous years. Second, select cell B42 and type the average function: =AVERAGE(B40:B41). Our prediction for the next year is the same as the average of the two previous years. Note: we ignore the error warning that Excel inserted in cell B42. Analyzing Data Over Time Part 2, Slide 36Copyright © 2004, Jim Schwab, University of Texas at Austin
37
Add a discussion text box at the base of the chart To add a discussion text box for the line chart, click on the Text Box tool button and click an insertion point at the base of the chart. Type the text in the text box: Using a two-period moving average, the forecast number of TANF recipients in 2000 is 7,986,508. The chart for forecasting the with a moving averages trend line is now complete. Analyzing Data Over Time Part 2, Slide 37Copyright © 2004, Jim Schwab, University of Texas at Austin
38
The last time series on number of TANF recipients did not follow any long term trend that would facilitate forecasting the future number of recipients. In such cases, we might look for a relationship between some other factor over time that demonstrates a more useful pattern on which we can base our forecasts. This can be an especially effective forecasting strategy if the variable we want to base the forecast on occurs prior to the number we are trying to predict. For example, we might want to forecast the number of employees we need in the next year based upon the number of clients in the current year, or some measurable client characteristic. To demonstrate how this might, I have assembled some data from the census bureau on the number of persons in poverty in Texas by year, and the number of state public welfare employees in the following year. If there is a suitable relationship between these two variables, then I can use the number of persons in poverty in the current year to estimate the number of employees that will be needed in the following year. Since time is not directly included in the analysis, we will chart the data with a scatter plot, but not use a line to connect the points. Forecasting one time series based on a second series Analyzing Data Over Time Part 2, Slide 38Copyright © 2004, Jim Schwab, University of Texas at Austin
39
Open the data set in Excel Download the data set WelfareEmployeesAndPoverty.xl s from the course web site and open it in Excel. The first two columns contain the year and the number of persons in poverty. The third column contains the number of state public welfare employees in the following year. We are missing the number of state employees for 1995, so Excel will not include that year in the analysis of the relationship. The first two columns contain the year and the number of persons in poverty. The third column contains the number of state public welfare employees in the following year. We are missing the number of state employees for 1995, so Excel will not include that year in the analysis of the relationship. Analyzing Data Over Time Part 2, Slide 39Copyright © 2004, Jim Schwab, University of Texas at Austin
40
Chart for welfare employees by persons in poverty First, select the data for the chart, cells B1 through C11. Second, open the Chart tool bar and select the XY (Scatter) Chart as the type of chart to create. After the basic scatter chart has been created, close the Chart tool bar. Analyzing Data Over Time Part 2, Slide 40Copyright © 2004, Jim Schwab, University of Texas at Austin
41
Position the chart Move the chart so that its top, left corner is in the upper left corner of cell D1. Analyzing Data Over Time Part 2, Slide 41Copyright © 2004, Jim Schwab, University of Texas at Austin
42
Resize the chart Resize the chart on the worksheet by dragging its handles. Analyzing Data Over Time Part 2, Slide 42Copyright © 2004, Jim Schwab, University of Texas at Austin
43
Remove the legend from the chart To remove the legend from a chart, right click on the legend and select Clear from the popup menu. The legend does not really contain any useful information in a scatter plot of the relationship between two variables, we will delete it. Analyzing Data Over Time Part 2, Slide 43Copyright © 2004, Jim Schwab, University of Texas at Austin
44
Add a title to the chart and to the axes Right click on the chart and select Chart Options from the popup menu. Click on the Titles tab. Right click on the chart and select Chart Options from the popup menu. Click on the Titles tab. First, click in the Chart title text box and type Welfare Employees by Poverty as the chart title. After a slight delay, Excel adds the chart title to the thumbnail sketch of the chart. Second, select the Value (X) axis text box and type Persons in Poverty. Third, select the Value (Y) axis text box and type Welfare Employees. Analyzing Data Over Time Part 2, Slide 44Copyright © 2004, Jim Schwab, University of Texas at Austin
45
Reduce the size of the title font Select the chart title and reduce the size of the text to 12 point Bold Arial. Analyzing Data Over Time Part 2, Slide 45Copyright © 2004, Jim Schwab, University of Texas at Austin
46
Reduce the size of the title font for the axes Select the vertical axis title and reduce the size of the text to 10 point Bold Arial. Select the horizontal axis title and reduce the size of the text to 10 point Bold Arial. Analyzing Data Over Time Part 2, Slide 46Copyright © 2004, Jim Schwab, University of Texas at Austin
47
Format the font for the axes labels Format the labels on both axes so that they are displayed in 8 point, Arial Bold. Analyzing Data Over Time Part 2, Slide 47Copyright © 2004, Jim Schwab, University of Texas at Austin
48
Re-scale the vertical axis With the minimum value of the vertical axis set to 0, all of the data points are clustered in the upper right corner of the chart. Double click on the vertical axis and change the minimum scale value to 20,000 and the major unit to 2,500 increments on the axis. With the minimum value of the vertical axis set to 0, all of the data points are clustered in the upper right corner of the chart. Double click on the vertical axis and change the minimum scale value to 20,000 and the major unit to 2,500 increments on the axis. Analyzing Data Over Time Part 2, Slide 48Copyright © 2004, Jim Schwab, University of Texas at Austin
49
Re-scale the horizontal axis With the minimum value of the horizontal axis set to 0, all of the data points are clustered in the right side of the chart. Double click on the horizontal axis and change the minimum scale value to 2,500,000 and the major unit to 500,000 increments on the axis. With the minimum value of the horizontal axis set to 0, all of the data points are clustered in the right side of the chart. Double click on the horizontal axis and change the minimum scale value to 2,500,000 and the major unit to 500,000 increments on the axis. Analyzing Data Over Time Part 2, Slide 49Copyright © 2004, Jim Schwab, University of Texas at Austin
50
Clear the plot area background color Right click on the Plot Area of the bar chart and select Clear from the popup menu. This will clear the gray background color from the plot area. Analyzing Data Over Time Part 2, Slide 50Copyright © 2004, Jim Schwab, University of Texas at Austin
51
Add vertical grid lines to chart We will not remove the horizontal grid lines, and in fact, we will add vertical grade lines. With so many data points, we cannot use data labels, so grid lines are the only means we have for estimating values for any given point. First, right click on the chart area and select Chart Options from the popup menu. In the Chart Options dialog box, click on the Gridlines tab. Second, click on the Major gridlines check box to select it, and click on the OK button to close the dialog. Analyzing Data Over Time Part 2, Slide 51Copyright © 2004, Jim Schwab, University of Texas at Austin
52
The scatter chart with vertical and horizontal grid lines The chart now contains both vertical and horizontal grid lines to facilitate determining the values for a data point. Analyzing Data Over Time Part 2, Slide 52Copyright © 2004, Jim Schwab, University of Texas at Austin
53
Add a trend line to the chart Right click on one of the data points and select Add Trendline from the popup menu. Analyzing Data Over Time Part 2, Slide 53Copyright © 2004, Jim Schwab, University of Texas at Austin
54
Complete the add trend line dialog box First, the default Linear trend line is the one we want to test, so we accept the default. Second, we click on the OK button. Analyzing Data Over Time Part 2, Slide 54Copyright © 2004, Jim Schwab, University of Texas at Austin
55
The linear trend line on the line chart The trend line is drawn as a straight black line through the middle of the data points. The line moves through the center of the points, though the fit is not strong. Ideally, the fit should be stronger to be useful. Nonetheless, we will continue with the example. We could test other trend lines, but the pattern of the points does not indicate that we would expect any stronger relationship. Analyzing Data Over Time Part 2, Slide 55Copyright © 2004, Jim Schwab, University of Texas at Austin
56
Format the trend line We will change the color and thickness of the trend line to improve its visibility on the chart. Double click on the trend line to open the Format Trendline dialog box. Analyzing Data Over Time Part 2, Slide 56Copyright © 2004, Jim Schwab, University of Texas at Austin
57
Change the color and thickness of the trend line First, click on the Patterns tab where color selection is located. Second, click on the Color drop down palette and select the Red color swatch. Third, click on the Weight drop down arrow and select the thickest line available, the last one in the list. Fourth, click on the OK button to apply the color. Analyzing Data Over Time Part 2, Slide 57Copyright © 2004, Jim Schwab, University of Texas at Austin
58
The revised linear trend line The trend line with a thick red line is displayed on the chart. Analyzing Data Over Time Part 2, Slide 58Copyright © 2004, Jim Schwab, University of Texas at Austin
59
Forecasting the welfare employees for 2003 We will use Excel's function wizard to create the FORECAST function. First, select cell C14 as the destination where we will store the result of the FORECAST function. Second, select the Function command from the Insert menu. Analyzing Data Over Time Part 2, Slide 59Copyright © 2004, Jim Schwab, University of Texas at Austin
60
Locate the forecast function by searching We will search for the FORECAST function. The FORECAST function name will appear in the Select a function list box. Click on the OK button access the dialog box where the function arguments are entered. First, type FORECAST in the Search for a function text box. Second, click on the Go button. Analyzing Data Over Time Part 2, Slide 60Copyright © 2004, Jim Schwab, University of Texas at Austin
61
The arguments to the forecast function - 1 The second argument to the FORECAST function is the Known_y's, which are the known welfare employee figures, in cells C2 through C11. The first argument to the FORECAST function is the X, or number of persons in poverty in the previous year for which we want to estimate the number of welfare employees needed. The number of persons in poverty for which we want a forecast is 3,362,000 in cell B14. Analyzing Data Over Time Part 2, Slide 61Copyright © 2004, Jim Schwab, University of Texas at Austin
62
The arguments to the forecast function - 2 The third argument to the FORECAST function is the Known_x's, which are figures for which we have known number of persons in poverty in cells B2 through B11. Click on the OK button to compute the function. Analyzing Data Over Time Part 2, Slide 62Copyright © 2004, Jim Schwab, University of Texas at Austin
63
The forecast for welfare employees for 2003 The forecast for 2003 using a linear trend method is approximately 25,914. A forecast of 25,914 is a sharp increase over the known number of employees in 2002 (20,874 on row 11). This is probably not a realistic forecast. The forecast for 2003 using a linear trend method is approximately 25,914. A forecast of 25,914 is a sharp increase over the known number of employees in 2002 (20,874 on row 11). This is probably not a realistic forecast. Analyzing Data Over Time Part 2, Slide 63Copyright © 2004, Jim Schwab, University of Texas at Austin
64
Add a discussion text box at the base of the chart To add a discussion text box for the line chart, click on the Text Box tool button and click an insertion point at the base of the chart. Type the text in the text box: Based on a linear trend line, the estimated number of public welfare employees for 2003 is 25,914. The chart for the forecasting the with a linear trend is now complete. Analyzing Data Over Time Part 2, Slide 64Copyright © 2004, Jim Schwab, University of Texas at Austin
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.