Differencing for Panel Data

Basic Concepts

In Two-Period Differencing, we showed how to apply differencing for panel data with only two time periods. Differencing can also be applied when there are more than two time periods.

Example

Example 1: Repeat Example 1 of Two-Period Differencing using the data in Figure 1 (i.e. the same data with one extra year).

Differencing part 1

Figure 1 – Differencing

This time there are three time periods. Differencing is performed in a manner similar to that described for Example 1 in Two-Period Differencing, namely, place the formula =IF($B2<>2012,C2-C3,””) in cell P2, highlight range P2:R25 and press Ctrl-R and Ctrl-D. You can then place the array formula =DELROWS(P1:R25,TRUE) in range T1:V17, as shown in Figure 2.

Differencing part 2

Figure 2 – Regression of differenced data

You can then use OLS regression to obtain the output shown on the right side of Figure 2.

Worksheet Function

Real Statistics Function: The Real Statistics Resource Pack provides the following worksheet function where R1 contains balanced panel data sorted first by unit and then by time period with the data for the dependent variable in the last column (as in columns C, D, and E of Figure 1).

PANEL_DIFF(R1, period, head): returns an array with the first-differencing of the data in R1 based on periods number of time periods; if head = TRUE (default FALSE) then it is assumed that the panel data contains column headings and that these will be used to create column headings for the output.

Thus, we can obtain the values in range T1:V17 via the array formula

=PANEL_DIFF(C1:E25,3,TRUE)

Examples Workbook

Click here to download the Excel workbook with the examples described on this webpage.

References

Gujarati, D. & Porter, D. (2009) Basic econometrics. 5th Ed. McGraw Hill
http://www.uop.edu.pk/ocontents/gujarati_book.pdf

Hill, R. C., Griffiths, W. E., Lim, G. C. (2018) The principles of econometrics. 5th edition. Wiley.

2 thoughts on “Differencing for Panel Data”

  1. Hi Charles,

    I’m confused as to why the differencing calculations for each of the variables are performed as follows: t0-t1 and t1-t2, as opposed to: t1-t0 and t2-t1.

    I would have thought the latter is more in line with the differencing equations so does this lead from a rule of sorts or is either differencing method OK so that it is a matter of personal preference?

    Many Thanks,

    Gareth

    Reply
    • Hi Gareth,
      Yes, you are correct. It would have made more sense to change the direction of the differencing. The results will be the same, except for the sign, in any case.
      Charles

      Reply

Leave a Comment