Module H3 Practical 02 Estimating Trend in a Time Series Objectives: By the end of this practical you should be able to: Explain how to produce a moving average with a specified set of weights Plot the moving average with the raw data to assess whether there is evidence of a trend in the series Fit a straight line to the data and draw it along with the raw data plot Interpret results from the above analyses 1. Open the Excel workbook named H3_data.xls and look at the sheet named Tetetemperature. The data in this worksheet comes from the site Tete in Mozambique. They correspond to annual figures for the years from 1952 to 2005. The raw data from which these summaries have been derived comprise daily rainfall measurements. The variables in the data are: Year of record (in variable year) Average of maximum daily temperature (C) (in variable tmax) Average of minimum daily temperature (C) (in variable tmin) Average of mean daily temperature (C) (in variable tmean) Objective: To explore whether temperature records support the claim that there has been “climate change in terms of increasing levels of termperature”. Working in pairs, carry out the following analyses suggested on the following page. SADC Course in Statistics Module H3 Practical 02 – Page 1 Module H3 Practical 02 (a) Select one of the variables above that you think is most suitable to answer this objective. Use this variable to create, using standard functions in Excel, moving averages as follows: A five point moving average with weights 0.125, 0.25, 0.25, 0.25, 0.125 A nine point moving average with equal weights. (b) Now use SSC-Stat to plot the data along with each of the above moving averages in turn. You will need to use the menu sequence SSCstat, Visualisation, X-Y Scatter Plot. In the resulting dialogue, select both the data column and the moving average column (hold CTRL down to select both) as the Y variables, and year as the X-variable. In the resulting dialogue box, ask for Line and Data Points. Click OK. You might need to make your chart larger to see it more clearly. Is there a trend in the series as judged by the moving average? Write down a statement summarizing your interpretation of this graph. Repeat above process for the second moving average. Note down your conclusions. Is there any benefit from using one moving average over the other? Which one would you prefer and why? SADC Course in Statistics Module H3 Practical 02 – Page 2 Module H3 Practical 02 (c) Now find the line of “best fit” for the data of your chosen variable. Use the Excel analysis tools, i.e. use the menu sequence Tools, Data Analysis. (If you don’t find Data Analysis as a sub-menu of Tools, find the sub-menu called Add-ins and click on Analysis ToolPak.). Select Regression and click OK. In the resulting dialogue give your selected data variable range as the Y-range and Year as the X-range. Click OK. The output will appear on a new worksheet. Ignore most of the output since we are not interested in a formal regression analysis here. All you want is to find the equation of the line. This will appear in the table at the bottom of the output. The value next to Intercept is the constant in the constant (i.e. the intercept) of your fitted line. The number beneath that is the slope of your line. Note down your fitted line, y = a + bx below with appropriate values substituted for a and b. Now plot your fitted line together with the data points. You will again need to use the menu sequence SSCstat, Visualisation, X-Y Scatter Plot but in the resulting dialogue, select only the data column of your chosen variable as the Y-variable, and Year (as before) as your X-variable. This time, click on “Show trend line(s)” and again request “Line and Data Points”. Click OK. What conclusions do you draw from the graph you get? How does is compare with the moving average plot? Which do you think is more useful? Note down your main findings below. SADC Course in Statistics Module H3 Practical 02 – Page 3 Module H3 Practical 02 2. This second exercise is aimed at consolidating ideas covered in the lecture and knowledge gained in the first exercise of this practical. Go into CAST for SADC: Higher Level. Click on Section 2. Time Series. You will see three sub-titles as: 2.1 Trends and forecasting 2.2 Cyclical pattern 2.3 Seasonal data In this practical, you will be using sub-section 2.1. Read and work through sections on (a) Page 1: Time Series Plots (b) Page 2: Smoothing with moving averages (c) Page 4: Trendlines and forecasts. Note down the particular time series concepts you learnt while doing this practical. Comment on features that you found easy or particularly difficult during your work above. SADC Course in Statistics Module H3 Practical 02 – Page 4