Analysis of Time Series For AS90641 Part 2 Extra for Experts September 2005 Created by Polly Stuart 1 Contents • This resource is designed to suggest some ways students could meet the requirements of AS 90641. • 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. 2 Aims • This presentation (and the next) takes you through some extra types of analysis you could try for time series data. • It also makes suggestions for writing your report • You will need to open the spreadsheet: Example sales.xls • Choose the worksheet labeled Clothing. 3 Beginnings • You have already learned a basic analysis of a time series and how to isolate some components. • We are now going to do a more complex analysis. • Before doing any analysis you need to: – Graph the raw data – Identify the components of the data – Decide on the best method of analysis. 4 Look at : the trend the seasonal component the irregular component C l o t hi ng and so f t g o o d s sal es 550 $(million) 500 450 400 350 300 2500 M ar M ar M ar M ar M ar M ar M ar M ar M ar M ar M ar M ar M ar 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 5 Step 1: Using Indexes Indexes show how prices have changed over time. They show the percentage increase in prices since a base period. The index for the base period is usually 1000. An index of 1150 shows that prices have increased 15 percent since the base period. You can use indexes to ‘deflate’ time series data which contains dollar values. Statistics New Zealand indexes include: Consumers Price Index Labour Cost Index Food Price Index Farm Expenses Price Index 6 Consumers Price Index • The Consumers Price Index (CPI) measures the change in prices of a specific basket of goods and services in New Zealand. • For retail sales of clothing this is an appropriate index to use as clothing is included in the ‘basket’ of goods priced. • Open the CPI worksheet and copy the series into the next column of the clothing worksheet. Look at the CPI data. Which is the base period? How do you know? 7 If the value of sales from clothing shops are increasing over time there several possible reasons: • Prices have increased because of inflation • The number of people in the population is growing so there are more possible customers needing clothes • Sales are actually increasing because people are buying more clothing • Something else? To help find out if total sales are increasing because of inflation we can turn the sales into constant 1999 dollars using the value of the CPI for each year. 8 Constant dollars The present base period for the Consumers Price Index (CPI) is 1999. Assume that the CPI now is 1150. In 1999, $100 could buy the same amount as: 1150 100 $115 1000 can buy now Now, $100 can buy the same amount as: 1000 100 $86.96 1150 could buy in 1999 9 Calculate your deflated value Use this formula to calculate the value in constant 1999 dollars. We will use constant 1999 dollars for the rest of this exercise. 10 Step 2: Deciding on an appropriate model • Some data follows an additive model where: Data value = trend + seasonal + irregular • Other data follows a multiplicative model where: Data value = trend x seasonal x irregular 11 Additive When the size of the seasonal component stays about the same as the trend changes, then an additive method is usually best. Series for which an additive series is appropriate 250 200 150 100 50 0 Mar 1991 Mar 1992 Mar 1993 Mar 1994 Original series Trend series 12 Multiplicative When the size of the seasonal component increases as the trend increases, then a multiplicative method may be better. Series for which a multiplicative model is appropriate 300 250 200 150 100 50 0 Mar 1991 Mar 1992 Mar 1993 Mar 1994 Original series Trend series 13 Look again at the graph below • Which model seems more suitable? In the previous PowerPoint we used an additive model and we will do this also for this data (An example of using a multiplicative model is given at the end of the third presentation). C l o t hi ng a nd s o f t g o o d s r e t a i l t r a d e 550 500 450 400 350 300 250 $million 0Mar 1991 Mar Mar Mar Mar Mar Mar Mar Mar 1992 1993 1994 1995 1996 1997 1998 1999 2000 Mar Mar Mar Mar 2001 2002 2003 14 Step 3: Analyse the data • Do the spreadsheet analysis as far as calculating the seasonally adjusted data. • Use the constant dollar values for your analysis. 15 Your spreadsheet should look like this: 16 Step 4: Describe and justify your model for the trend • Try some different models for the moving average. • Decide which one will give a sensible forecast. 17 Trend Describe what you can see. y = -0.0864x + 381.6 Clothing and softgoods sales $(m illion) 500 Clothing 1999 dollars Estimated trend 450 400 350 Linear (Estimated trend) 300 2500 Mar 1991 Mar 1993 Mar 1995 Mar 1997 Mar 1999 Mar 2001 Mar 2003 Does this linear trend model look sensible? 18 • Many trends cannot be modelled by a single straight line • A quadratic model may be tempting… y = 0.1097x 2 - 5.572x + 431.66 Clothing and softgoods sales $(m illion) 500 Clothing 1999 dollars Estimated trend 450 400 350 Poly. (Estimated trend) 300 2500 Mar 1991 Mar 1993 Mar 1995 Mar 1997 Mar 1999 Mar 2001 Mar 2003 But is it realistic? 19 • Remember the shape of a parabola. • Do you think that sales (in constant dollars) are going to grow at that rate? y = 0.1097x 2 - 5.572x + 431.66 Clothing and softgoods sales $(m illion) 600 550 500 450 400 350 300 2500 Mar 1991 Clothing 1999 dollars Estimated trend Poly. (Estimated trend) Mar 1993 Mar 1995 Mar 1997 Mar 1999 Mar 2001 Mar 2003 20 • An option is to use a linear model over the trend at the end of the series. • This is likely to give the most realistic forecast. Clothing and softgoods sales from 1998 y = 4.3368x + 335.87 $(million) 500 450 400 350 300 2500 Mar 1998 Clothing 1999 dollars Estimated trend Mar 1999 Mar 2000 Mar 2001 Mar 2002 Mar 2003 Linear (Estimated trend) 21 Step 5: Describing the seasonal component • A graph can help you to see the patterns more clearly. 22 Seasonal sales patterns $(m illion) 50 0 Mar 1991 Mar 1995 Mar 1999 Mar 2003 -50 Describe the patterns you can see. You can also identify amounts easily from the graph. 23 Step 6: Analysing the irregular component • There is always random variation in a time series, the irregular component. • When a very unusual event happens it may cause a spike in the data, called an outlier. • This can distort the trend and seasonal component values. • The larger the spike the more distortion. • It is useful to calculate the irregular component and look for outliers. 24 Subtract the values in the ‘Seasonal’ column from the ‘Seasonal and Irregular’ column. A graph is often useful. 25 Outliers Highlight the date and irregular columns for the graph. Irregular Com ponent $ m i l l i on 19 9 9 15 10 5 0 M ar 1991 M ar 1995 M ar 1999 M ar 2003 -5 -10 Both the pattern of the irregular component and any extreme values are worth commenting on. 26 This is not the end! Continue the analysis and write a report on retail clothing sales. Some ideas are given in the next presentation, Reporting. 27