Problem

You're working with a time series that shows some seasonal variation and you'd like to compute the seasonal indices prior to deseasonalizing the data.

Solution

You can compute seasonal indices using any of a number of methods. I'll show you how easy it is to compute such indices in Excel using the *average-percentage* method.

Discussion

Take a look at the time series shown in Figure 6-23.

Figure 6-23. Average monthly temperatures

This time series consists of average monthly temperatures for the state of Louisiana from 1996 to 1999. The vertical gridlines correspond to three-month quarters, and it's clear there's an obvious seasonal variation in average temperatures. In Recipe 6.9, I'll show you how to forecast the average monthly temperatures for the year 2000 given this historical data. Part of that forecast analysis requires you to isolate the seasonal variation in temperatures. To do so, you must first compute the seasonal indices.

There are many standard methods for computing seasonal indices. The method I'll show you to illustrate how to use Excel for such calculations is the *average-percentage* method.

I'll use the series shown in Figure 6-23 as an example. To apply the average-percentage method, compute the annual average temperature for each year and then express each monthly temperature as a percentage of the average annual temperature for the corresponding year. Then you average these percentages for corresponding months over all years to arrive at the seasonal index for each month.

The data shown in Figure 6-23 was given as a series of temperature values over a range of months from 1 to 49, covering the years 1996 to 1999. To compute the seasonal indices, it's convenient to reorganize the data as shown in Figure 6-24.

Figure 6-24. Original data and averages

The original data is now in a table with rows representing monthly values over years represented by columns. Now it's a simple matter of applying the `AVERAGE` worksheet formula to compute annual averages. The last row of the table in Figure 6-24 computes these averages using formulas of the form `=AVERAGE(F69:F80)`.

The next step is to divide each monthly temperature value by the annual average for the corresponding year. Figure 6-25 shows the table I set up for this calculation.

Figure 6-25. Seasonal indices

This table is similar in format to the one shown in Figure 6-24; however, each value in the table represents the ratio of monthly temperature to annual average for corresponding years. For example, the cell formula in cell F85 corresponding to January 1996 is `=F69/F$81`, which is the temperature value for January 1996 from the table shown in Figure 6-24 divided by the annual average for the year 1996, from the last row of the table in Figure 6-24. The cell formulas are similar for the other months and years in the table in Figure 6-25.

The last column in Figure 6-25 contains the seasonal index for each month. The seasonal index is simply the average of the ratios for the corresponding month over all years. For example, the January seasonal index in cell J85 is computed using the formula `=AVERAGE(F85:I85)`. The remaining indices are computed similarly.

The average of the seasonal indices for all months should come out to a value of 1. If it does not, then a suitable factor should be applied to each index so that the average does indeed work out to a value of 1. Cell J98 computes the average seasonal index as a check. As you can see, it comes out to a value of 1.00, so no adjustments are required.

The seasonal indices computed here confirm the observation made earlier that the temperatures are seasonally higher in the middle months of the year (over the second and third quarters of each year). You can see this by observing that the seasonal indices for the months of May through October are above the average index of 1, while the remaining indices are below this average.

See Also

You can decompose a time series such as the one discussed here to isolate the seasonal variation in a manner similar to the way in which we isolated the long-term trend in Recipe 6.6. Further, as you can also deseasonalize a time series. The next recipe shows you how.

Using Excel

- Introduction
- Navigating the Interface
- Entering Data
- Setting Cell Data Types
- Selecting More Than a Single Cell
- Entering Formulas
- Exploring the R1C1 Cell Reference Style
- Referring to More Than a Single Cell
- Understanding Operator Precedence
- Using Exponents in Formulas
- Exploring Functions
- Formatting Your Spreadsheets
- Defining Custom Format Styles
- Leveraging Copy, Cut, Paste, and Paste Special
- Using Cell Names (Like Programming Variables)
- Validating Data
- Taking Advantage of Macros
- Adding Comments and Equation Notes
- Getting Help

Getting Acquainted with Visual Basic for Applications

- Introduction
- Navigating the VBA Editor
- Writing Functions and Subroutines
- Working with Data Types
- Defining Variables
- Defining Constants
- Using Arrays
- Commenting Code
- Spanning Long Statements over Multiple Lines
- Using Conditional Statements
- Using Loops
- Debugging VBA Code
- Exploring VBAs Built-in Functions
- Exploring Excel Objects
- Creating Your Own Objects in VBA
- VBA Help

Collecting and Cleaning Up Data

- Introduction
- Importing Data from Text Files
- Importing Data from Delimited Text Files
- Importing Data Using Drag-and-Drop
- Importing Data from Access Databases
- Importing Data from Web Pages
- Parsing Data
- Removing Weird Characters from Imported Text
- Converting Units
- Sorting Data
- Filtering Data
- Looking Up Values in Tables
- Retrieving Data from XML Files

Charting

- Introduction
- Creating Simple Charts
- Exploring Chart Styles
- Formatting Charts
- Customizing Chart Axes
- Setting Log or Semilog Scales
- Using Multiple Axes
- Changing the Type of an Existing Chart
- Combining Chart Types
- Building 3D Surface Plots
- Preparing Contour Plots
- Annotating Charts
- Saving Custom Chart Types
- Copying Charts to Word
- Recipe 4-14. Displaying Error Bars

Statistical Analysis

- Introduction
- Computing Summary Statistics
- Plotting Frequency Distributions
- Calculating Confidence Intervals
- Correlating Data
- Ranking and Percentiles
- Performing Statistical Tests
- Conducting ANOVA
- Generating Random Numbers
- Sampling Data

Time Series Analysis

- Introduction
- Plotting Time Series Data
- Adding Trendlines
- Computing Moving Averages
- Smoothing Data Using Weighted Averages
- Centering Data
- Detrending a Time Series
- Estimating Seasonal Indices
- Deseasonalization of a Time Series
- Forecasting
- Applying Discrete Fourier Transforms

Mathematical Functions

- Introduction
- Using Summation Functions
- Delving into Division
- Mastering Multiplication
- Exploring Exponential and Logarithmic Functions
- Using Trigonometry Functions
- Seeing Signs
- Getting to the Root of Things
- Rounding and Truncating Numbers
- Converting Between Number Systems
- Manipulating Matrices
- Building Support for Vectors
- Using Spreadsheet Functions in VBA Code
- Dealing with Complex Numbers

Curve Fitting and Regression

- Introduction
- Performing Linear Curve Fitting Using Excel Charts
- Constructing Your Own Linear Fit Using Spreadsheet Functions
- Using a Single Spreadsheet Function for Linear Curve Fitting
- Performing Multiple Linear Regression
- Generating Nonlinear Curve Fits Using Excel Charts
- Fitting Nonlinear Curves Using Solver
- Assessing Goodness of Fit
- Computing Confidence Intervals

Solving Equations

- Introduction
- Finding Roots Graphically
- Solving Nonlinear Equations Iteratively
- Automating Tedious Problems with VBA
- Solving Linear Systems
- Tackling Nonlinear Systems of Equations
- Using Classical Methods for Solving Equations

Numerical Integration and Differentiation

- Introduction
- Integrating a Definite Integral
- Implementing the Trapezoidal Rule in VBA
- Computing the Center of an Area Using Numerical Integration
- Calculating the Second Moment of an Area
- Dealing with Double Integrals
- Numerical Differentiation

Solving Ordinary Differential Equations

- Introduction
- Solving First-Order Initial Value Problems
- Applying the Runge-Kutta Method to Second-Order Initial Value Problems
- Tackling Coupled Equations
- Shooting Boundary Value Problems

Solving Partial Differential Equations

- Introduction
- Leveraging Excel to Directly Solve Finite Difference Equations
- Recruiting Solver to Iteratively Solve Finite Difference Equations
- Solving Initial Value Problems
- Using Excel to Help Solve Problems Formulated Using the Finite Element Method

Performing Optimization Analyses in Excel

- Introduction
- Using Excel for Traditional Linear Programming
- Exploring Resource Allocation Optimization Problems
- Getting More Realistic Results with Integer Constraints
- Tackling Troublesome Problems
- Optimizing Engineering Design Problems
- Understanding Solver Reports
- Programming a Genetic Algorithm for Optimization

Introduction to Financial Calculations

- Introduction
- Computing Present Value
- Calculating Future Value
- Figuring Out Required Rate of Return
- Doubling Your Money
- Determining Monthly Payments
- Considering Cash Flow Alternatives
- Achieving a Certain Future Value
- Assessing Net Present Worth
- Estimating Rate of Return
- Solving Inverse Problems
- Figuring a Break-Even Point

Index

Excel Scientific and Engineering Cookbook (Cookbooks (OReilly))

ISBN: 0596008791

EAN: 2147483647

EAN: 2147483647

Year: N/A

Pages: 206

Pages: 206

Authors: David M Bourg

Similar book on Amazon

- Chapter VIII Personalization Systems and Their Deployment as Web Site Interface Design Decisions
- Chapter X Converting Browsers to Buyers: Key Considerations in Designing Business-to-Consumer Web Sites
- Chapter XI User Satisfaction with Web Portals: An Empirical Study
- Chapter XII Web Design and E-Commerce
- Chapter XV Customer Trust in Online Commerce

Flylib.com © 2008-2017.

If you may any questions please contact us: flylib@qtcs.net

If you may any questions please contact us: flylib@qtcs.net