Presentation is loading. Please wait.

Presentation is loading. Please wait.

Analysis of Time Series Data

Similar presentations


Presentation on theme: "Analysis of Time Series Data"— Presentation transcript:

1 Analysis of Time Series Data
For AS90641 Part 1 Basics for Beginners This takes students through the things they need to do to gain Achieve and Merit. Achievement Criteria Explanatory Notes Achievement Determine the trend for time series data. This will most likely include: graphing smoothing with moving averages describing the trend in context using smoothed data. This may involve relating factors such as the gradient of the trend line to the situation. Achievement with Merit Use time series analysis to make forecasts. Analysis must include data that has a seasonal effect. Analysis of cyclic effects is not expected. Forecast will most likely be based on: a trend line fitted to smoothed data estimates of seasonal effects. September 2005 Created by Polly Stuart

2 Contents This resource is designed to suggest some ways students could meet the requirements of AS It shows some common practices in New Zealand schools and suggests other simplified statistical methods. The suggested methods do not necessarily reflect practices of Statistics New Zealand. More information about techniques used at Statistics New Zealand is available in the information section on Schools Corner. It is important to be aware that Statistics New Zealand does not use time series analysis for forecasting. In addition, many of the other methods of seasonal adjustment shown here are very much simplified.

3 Aims This presentation takes you through the process of analysing the data in an Excel spreadsheet, drawing the graphs and identifying the trend. It also shows you how to do a forecast. You will need to open the spreadsheet: Example sales.xls Choose the worksheet labelled Hardware. The spreadsheet Example sales.xls needs to be available to students. Students can work through the processes shown in the PowerPoint on the same data in the spreadsheet.

4 Time series data Shows what happens as time passes.
Each data point is made up of 3 components: Trend Seasonal Irregular. For an additive series: Data value = Trend + Seasonal + Irregular The components are a key concept. This PowerPoint assumes that these have been taught already. This slide is just to remind students what we are trying to do by using this process. Discussion of why the additive method rather than multiplicative method is used is covered in the second PowerPoint. It is not required for this level.

5 Beginnings It is important to look at the series you are analysing before you start. Draw a graph. Look for the different components. Think about what might be the best way of analysing it. All analysis should start with students looking at a graph of the series they are analysing. They need to think about what methods they are going to use. The graph is shown on the next slide.

6 the seasonal component the irregular
Look at: the trend the seasonal component the irregular Each point in the series is made up of these 3 components. The seasonal adjustment process isolates each component as far as possible. For clarity only the first quarter of the year is named on the graph with a tick on the September quarter. Students need to use their own graphs to identify points mote exactly. The double lines are a break to show that the axis does not go from zero. This is the Statistics New Zealand standard for showing this.

7 Use this to separate out all the components of the series.
Table Use this to separate out all the components of the series.

8 Set up the column titles in the spreadsheet
The spreadsheet needs to be set with the titles for the columns. The seasonally adjusted column is not needed for Achieve or Merit analysis, but is included for completeness.

9 Step 1 is to identify the trend:
Use a moving average to estimate a trend. Because it is quarterly data, use an order of 4 initially. Then centre the value by doing a moving average order 2. In Excel you can do both columns in one go (see the next slide). Each step describes the process then shows how to do it in subsequent slides. This example uses a short cut method to do both columns in one step. This is preferable as the matching of values is clearer. It is assumed that students are familiar with calculating a centred moving average already.

10 Fill in the boxes by highlighting cells on your spreadsheet.
Click into the column next to the third data value (C9) Click the button to open the function box Choose AVERAGE or MEDIAN. The choice of mean of median for the moving average is not discussed here as it is assumed that students are familiar with this. You may want to switch to the spreadsheet and demonstrate this process. Fill in the boxes by highlighting cells on your spreadsheet.

11 Fill down the column. Rounding: Rounded to 3sf (why?).
It is assumed that basic Excel skills like ‘fill down’ are known by students. The concept of ‘sensible rounding’ is important and may need to be explored with students. Rounding: Rounded to 3sf (why?). Excel will use all the decimals in its calculations so rounding error is not a problem here.

12 Colouring the cells helps to remind you not to use them.
Delete the last 2 trend values. You don’t have enough information for those moving averages. An advantage of the one step method is that 2 cells are left blank at each end. This makes it easy to remember for students. Colouring the cells helps to remind you not to use them.

13 Step 2 is to estimate the seasonal component:
Subtract out the trend to leave the estimated seasonal and irregular components. Use a moving average to estimate the seasonal component value. This is demonstrated in the next few slides.

14 Calculate the seasonal and irregular values by subtracting the trend estimate from the raw data values, as shown below. You are removing the trend leaving these two components. This is called detrending! Fill down the column. We are subtracting out our estimate for the trend and leaving behind our estimate of the other 2 components.

15 [click on the first then hold down Ctrl to choose the others]
Calculate a moving average over 3 values of the seasonal and irregular column for the quarter you want. (September in this case as it is the first quarter with a value in.) This is a preferred method to the one often used, which averages over the whole series. It is particularly useful where the seasonality is not stable. This is a long series and often the seasonality varies over the time period. The use of moving averages will give a more responsive value for the seasonal component as it will capture these changes.

16 Fill down, then copy and paste (values only) the nearest 4 values into the spaces.
We are using the closest values as the best estimate of the missing ones. Do the same for the bottom 4 values. This is a simplification to estimate the end values as we don’t have enough information to calculate them.

17 Calculate the seasonally adjusted values.
The seasonally adjusted values are the actual values with the seasonal component removed.

18 Graphs

19 Step 3 is to find a linear model for the trend:
Be aware that the linear trend line gives a simplified estimation of the trend. Fitting a straight line to the whole length of your moving average trend gives you a model to estimate its slope. We look at other possible models in the PowerPoint Extra for Experts. Students need to understand that using least squares regression does not always give a good estimation of the trend. The moving average is much more responsive to changes in the slope of the trend. The linear model is an estimation to give a model for doing the forecast.

20 Insert a new column at the start and put a count in it.
Fill down past the end of your table The count is to make it easier to do the forecast.

21 Highlight the next 3 columns and click on the graph icon to draw the line graph .
Sometimes students need to change options to make the graph clear enough. I have not detailed these as it can be quite complicated. I am assuming some knowledge of using Excel throughout this presentation.

22 You can adjust it to look better if you want.
As discussed before, making the graph prettier is optional.

23 Estimating trend This can be done in two ways
By looking at the moving average line at various points By fitting a regression line. The first way gives a more accurate estimate of the most recent trend. Fitting a regression line is not very accurate, particularly over a long series. Giving an average for the last part of the data (from the last turning point) will give a better result. The trend can be described this way for each part of the data, but the most useful result is what the latest figures show.

24 Method 1 Notice that from September 1998 the moving average rises steadily. From the spreadsheet you can see that it rose $42 million over the 4 years to September 2002. So from September 1998 hardware sales rose by approximately $10.5 million per year. This could be done per quarter, but the yearly figure is possible more relevant.

25 Method 2 Get excel to put a linear regression line on the data
This should be based on the moving average line. This will give an estimate for the whole period of the series. It may not be very accurate for the most recent values This is the more usual method used in schools.

26 Choose the option to display the equation.
On the graph, right click on a trend estimate data value and select Add trendline. Make sure that Trend Estimate is highlighted in the lower box. Click on options. A linear model for the trend is preferred at this level. It is easy to interpret in context and to use for the forecast. The R2 value is not really relevant to time series analysis. Choose the option to display the equation.

27 The formula can be moved to be easier to see
Is the line a good model for forecasting terms in the series? How could you do a better one? The best line would use only the end of the data for the estimation. Some discussion of this is worthwhile. Students may be interested in using a quadratic instead. This is a poor model for forecasts as it increases so quickly. Generally this is not realistic. The use of different models is discussed in more detail in the ‘Extra for Experts’ PowerPoint. The formula can be moved to be easier to see

28 Identify the trend in context
The value of the trend must be quantified and the units and time period given. The linear model for the trend line shows an increase in hardware sales of $1.01 million per quarter. This is approximately $4 million per year.

29 Step 4 is to calculate your forecast:
Use the formula from your model of the trend line. This gives an estimate of the trend component. Add back the seasonal component. We will do an estimate for March 2004. This is covered in detail over the next few slides.

30 To forecast for March 2004 Make sure the count goes down to the quarter you want to forecast for. Putting in a count and continuing the dates makes it much easier to do the calculations for the correct quarter.

31 Use the formula from your trend line to calculate the estimated trend value for March.
The calculation is placed in the trend column to help remind students that this is not their final forecast.

32 Then the forecast is placed in the actual values column with the seasonal added in. Might be worthwhile stressing that its not always March added back. Add back the seasonal effects for March using the most recent March value.

33 Forecast 50 Jun 2003 51 Sep 2003 52 Dec 2003 53 Mar 2004 218.71 In March 2004 the forecasted value for Retail Hardware sales using this model is $219 million (3s.f). This is calculated by substituting the number of periods since March 1991 into the formula for the trend. Then the seasonal adjustment for March is added back in. Forecast = x BUT: you need to be aware that your line did not follow the trend estimates very closely at the end. The next presentation looks at some ways of making better models. Students need to describe the process and results in context.

34 A worked example of the report you could produce for Sales of Retail Hardware is available for you to check your results. The sample report is provided to show how all this fits together. Putting the results into a coherent report in a word document is worthwhile. It is easier to read and to see what has been done than using the Excel spreadsheet. It also gives a lead in to the Excellence part of the standard where a report is required.

35 But see Extra for Experts!
The End But see Extra for Experts!


Download ppt "Analysis of Time Series Data"

Similar presentations


Ads by Google