Dynamic Panel Analysis (GMM)
Put the past value of the outcome in the model, and use values from further back as instruments.
A company's productivity isn't set from scratch every year. A company that was highly productive last year is likely to stay highly productive this year, because its production facilities, technology and skilled workforce don't change completely in a short time.
So when you analyze how a company's research and development (R&D) investment affects productivity, shouldn't you take this past productivity into account too? For example, you could make this year's productivity the dependent variable and include last year's productivity as a predictor.
But there's a problem. In panel data that follow the same companies over several years, putting the past value of the dependent variable into an ordinary fixed-effects model can bias the estimates.
Also, how much a company invests in R&D may itself be affected by productivity. More productive companies can secure bigger R&D budgets, and companies that expect productivity gains in the future may increase their R&D investment.
When you need to account for both the influence of the past and the endogeneity of predictors like this, the method to use is dynamic panel data analysis.
In dynamic panel analysis, estimation based on the generalized method of moments (GMM) is widely used.
In this article we'll cover the basic principles of dynamic panel models, the endogeneity problem, the difference between Difference GMM and System GMM, a worked example, and diagnostic tests and how to interpret the results.
What is dynamic panel analysis?
Dynamic panel analysis models a structure in panel data where current outcomes are affected by past outcomes.
An ordinary panel regression analyzes how variables such as advertising spending, R&D investment or headcount relate to sales or productivity. A dynamic panel model adds the past value of the dependent variable. For example, last year's productivity can be included as a predictor of this year's productivity.
Such models are useful for analyzing how much current productivity depends on past productivity, and how changes in other variables affect current and later outcomes. A dynamic panel model can be written as:
Yit = ρ·Yi,t−1 + β·Xit + αi + λt + εit
| Symbol | Meaning |
|---|---|
| Yit | Productivity of firm i at time t |
| Yi,t−1 | Productivity of the same firm in the previous period |
| ρ | Coefficient capturing the persistence of productivity |
| Xit | Predictors such as R&D investment |
| β | Coefficient on the predictors |
| αi | Time-invariant characteristics of each firm |
| λt | Common effect of each year |
| εit | Error term |
The key quantity in this model is ρ. If it is positive, then, other things equal, firms with higher past productivity tend to have higher current productivity. Including a lagged dependent variable, however, doesn't automatically solve the endogeneity problem. In fact, it can create a new source of bias in estimation.
Why isn't an ordinary fixed-effects model enough?
A fixed-effects model can control for characteristics of each firm that don't change.
For example, it is useful for removing characteristics that stay constant over the observation period, such as a firm's management culture or long-held technological strengths. But things change when the previous period's dependent variable is included as a predictor. A fixed-effects model removes time-invariant characteristics by subtracting each firm's mean.
Even after this transformation, though, a correlation can remain between the past dependent variable and the transformed error term. Especially when there are many firms but each is observed over only a short period, the ordinary fixed-effects estimator is biased. This is called Nickell bias.
For example, even if you observe 500 firms, if each firm has only 4–5 years of data, a fixed-effects model with a lagged dependent variable can give distorted estimates. Dynamic panel GMM tackles this problem by using values of past variables as instruments.
GMM, too, gives consistent estimates only if the required exogeneity conditions for the instruments hold.
Worked example: how R&D investment affects firm productivity
Suppose a researcher collected productivity and R&D investment data on 300 manufacturing firms from 2018 to 2025.
If every firm was observed for 8 years, there are 2,400 observations in all. The researcher wants to analyze how R&D investment affects firm productivity while also accounting for productivity in the previous year.
Analysis data
| Variable | Role | Description |
|---|---|---|
| Labor productivity | Dependent variable | Log of real value added per employee |
| Last year's labor productivity | Lagged dependent variable | Log labor productivity one year earlier |
| R&D investment | Main predictor | Log of real R&D spending |
| Capital intensity | Control variable | Log of real capital per employee |
| Firm ID | Unit identifier | 300 manufacturers |
| Year | Time identifier | 2018–2025 |
Here we assume only positive values that can be log-transformed are used. The research question is:
"Taking past productivity and firm-specific characteristics into account, how are changes in R&D investment related to current productivity?"
You can also look at what effect R&D investment leaves on productivity over the following years. In this example we assume that R&D investment is an endogenous variable that may be related to productivity shocks, and that capital intensity may also be endogenous. So you need to distinguish the endogeneity assumptions for each variable and set up suitable instruments.
What is GMM?
The generalized method of moments (GMM) estimates a model's parameters using particular moment conditions.
Moment conditions are relationships such as the requirement that the expected product of a valid instrument and the error term be 0. Put simply:
E[ Zit · εit ] = 0
Here Zit is an instrument. The condition means the instrument must be uncorrelated with the model's error term. Dynamic panel GMM often uses previously observed values of variables as internal instruments.
For example, if it is reasonable to assume that sufficiently old past values of productivity are uncorrelated with the current error term, they can be used as instruments. GMM estimates the regression coefficients so that these conditions are satisfied. But not every variable becomes a valid instrument just because it is a past value.
You need to consider serial correlation in the error term, the exogeneity of the predictors and the relevance of the instruments together.
How does Difference GMM work?
Difference GMM is a dynamic panel estimator known as the Arellano–Bond estimator.
First, the original model is differenced to remove each firm's time-invariant characteristics.
Differencing removes the firm fixed effect αi. But the differenced past dependent variable ΔYi,t−1 can be correlated with the differenced error term Δεit. So you shouldn't just apply ordinary OLS.
Difference GMM uses values of the dependent variable from even earlier periods as instruments. For example, if a suitable no-serial-correlation condition holds for the error term, Yi,t−2 and earlier values can be used as instruments for the differenced equation.
This is how it tries to deal with the correlation between the past dependent variable and the error term.
How is System GMM different from Difference GMM?
System GMM is an extension of Difference GMM.
Difference GMM uses the differenced equation, while System GMM uses both the differenced equation and the level equation.
Especially for variables like productivity, where past and current values are highly related, the past levels used in Difference GMM can be weak instruments for the differenced variables. System GMM uses additional moment conditions to try to make estimation more efficient and stable.
| Aspect | Difference GMM | System GMM |
|---|---|---|
| Representative method | Arellano–Bond | Arellano–Bover / Blundell–Bond |
| Equations used | Differenced equation | Differenced + level equations |
| Main instruments | Past levels | Past levels and past differences |
| Advantage | Removes time-invariant unit effects | Can do better with highly persistent variables |
| Caution | Instruments may be weak | Extra moment conditions must be valid |
System GMM is not always better than Difference GMM. If the additional instrument conditions for the level equation don't hold, it can actually give inappropriate estimates. So when choosing between the two, consider not only the persistence of the variables but also the validity of the instruments.
How do you interpret actual GMM results?
Suppose System GMM is applied to the panel data on the 300 manufacturing firms from earlier.
Dynamic panel System GMM results
| Variable | Coefficient (B) | Standard error | p-value |
|---|---|---|---|
| Last year's labor productivity (log) | 0.62 | 0.08 | < .001 |
| R&D investment (log) | 0.12 | 0.04 | .003 |
| Capital intensity (log) | 0.18 | 0.06 | .003 |
Year dummies included. Standard errors are assumed to come from two-step GMM estimation with a finite-sample correction.
The coefficient on last year's labor productivity is 0.62. This means that, other things equal, a firm with 1% higher productivity last year tends to have about 0.62% higher productivity this year. The coefficient on R&D investment is 0.12.
Since both the dependent variable and R&D investment are log-transformed in this model, it can be interpreted as a relationship in which 1% higher R&D investment goes with about 0.12% higher current labor productivity.
The coefficient on capital intensity is 0.18: 1% higher capital intensity goes with about 0.18% higher current labor productivity.
To interpret these results as causal effects, however, the instrument conditions for the endogenous variables and the model specification must be valid.
In particular, the relationship between R&D investment and productivity can be influenced by firms' investment decisions and their outlook for future productivity, so the mere fact that GMM was applied doesn't mean endogeneity has been fully resolved.
How do short-run and long-run effects differ?
A dynamic panel model lets you distinguish the short-run and long-run effects of a predictor.
In the example above, the coefficient on R&D investment was 0.12 and the coefficient on last year's labor productivity was 0.62. If R&D investment rises permanently to a new level and the model's other conditions stay the same, the long-run multiplier in a stable dynamic model can be calculated as:
Long-run multiplier = β ÷ (1 − ρ) = 0.12 ÷ (1 − 0.62) ≈ 0.316
So the short-run elasticity is about 0.12 and the long-run multiplier is about 0.316. This means that, with other conditions and the model structure held constant, the long-run change in labor productivity corresponding to a sustained 1% increase in R&D investment is estimated at about 0.316%.
This long-run calculation, however, assumes a stable model with |ρ| < 1 and a sustained change in the predictor, among other things. Also, the confidence interval for the long-run multiplier can't be obtained by simply dividing the confidence intervals of the two coefficients. You have to account for the uncertainty in both estimates and their covariance.
Why do instruments matter in GMM?
Dynamic panel GMM deals with endogeneity by using suitable instruments.
But the number of instruments can get too large. For example, as the observation period gets longer, more lags of past variables become available.
Using all of these lags as instruments can make the number of instruments grow quickly. This is called instrument proliferation.
With too many instruments, they can overfit the endogenous variables, or the overidentification test can lose power and fail to detect invalid instruments. So in practice you consider limiting the lag range of the instruments or collapsing the instrument matrix.
For example, instead of using every possible lag, you might use only lags 2 to 3. The appropriate lag range, however, depends on the exogeneity assumptions for the variables and the properties of the error term. So rather than automatically using few or many instruments, what matters is choosing instruments that meet the required conditions.
What is the Arellano–Bond autocorrelation test?
In Difference GMM and System GMM, it's important to check for autocorrelation in the differenced error term.
The standard tool is the Arellano–Bond autocorrelation test. It checks the differenced error term for first-order and second-order autocorrelation.
Example autocorrelation test results
| Test | p-value | Interpretation |
|---|---|---|
| AR(1) | .008 | First-order autocorrelation present |
| AR(2) | .412 | No significant evidence of second-order autocorrelation |
In Difference GMM, first-order autocorrelation can appear because of differencing even when the original error term has no autocorrelation. So a significant AR(1) test is generally to be expected.
On the other hand, significant second-order autocorrelation in the differenced error term may mean there is a problem with using level values at certain lags as instruments. That's why the AR(2) test result gets close attention. But a nonsignificant AR(2) test doesn't mean all the instruments are valid.
How do you interpret the Hansen test?
In GMM analysis, you can use the Hansen J test to assess the overall validity of the instruments.
The Hansen test assesses whether the overidentifying restrictions are compatible with the data. Suppose, for example, you got the following results.
| Item | Result |
|---|---|
| Hansen J test p-value | .284 |
| Number of instruments | 24 |
| Number of firms | 300 |
A Hansen test p-value of .284 means there isn't enough evidence at the 0.05 significance level to reject the overidentifying restrictions. But that doesn't prove all the instruments are valid. In particular, with too many instruments the Hansen test's ability to detect invalid instruments can weaken.
So rather than looking only at the Hansen p-value, it's good to also look at the number of instruments, the number of firms and how the instruments were constructed. In System GMM you can also use tests such as the Difference-in-Hansen test to check the additional moment conditions introduced for the level equation.
These tests, too, depend on the model specification and on adequate identification conditions.
What to watch out for in dynamic panel GMM
Check the number of units and the number of time periods.
Difference GMM and System GMM are generally used with panel data that have many units and relatively few time periods. If there are very few firms or the observation period is very long, you may need to consider other estimators.
Keep the number of instruments under control.
With too many instruments, the estimates and the Hansen test can become unreliable. So always report the number of instruments and how they were constructed.
Distinguish the endogeneity assumptions for each variable.
Not every predictor has the same endogeneity problem. Distinguish strictly exogenous variables, predetermined variables and endogenous variables, and set up suitable instruments for each.
Check the diagnostic tests together.
Check the results of the AR(1), AR(2) and Hansen J tests, and in System GMM also examine the validity of the additional moment conditions.
Don't judge causal effects from coefficient significance alone.
GMM can deal with endogeneity under suitable instrument conditions, but invalid instruments or a misspecified model can produce biased results.
Specify a dynamic structure that fits the research goal.
If productivity is affected not only by last year's value but also by productivity two years earlier, or if the effect of R&D investment shows up directly over several years, the model's dynamic structure needs further review.
How do you report dynamic panel GMM results?
When reporting dynamic panel GMM results, it's good to present the sample, the observation period, the dependent and independent variables, the GMM method used, the instrument setup, the main coefficients and the diagnostic test results together.
In particular, state clearly whether you used Difference GMM or System GMM, and one-step or two-step GMM estimation.
Summary of results
| Item | Result |
|---|---|
| Number of firms | 300 |
| Observation period | 2018–2025 |
| Estimation method | Two-step System GMM |
| Coefficient on last year's productivity | 0.62 |
| Coefficient on R&D investment | 0.12 |
| AR(1) p-value | .008 |
| AR(2) p-value | .412 |
| Hansen J p-value | .284 |
| Number of instruments | 24 |
Sample write-up
To analyze the dynamic relationship between research and development (R&D) investment and labor productivity in manufacturing firms, two-step System GMM was applied. The sample was panel data on 300 manufacturing firms from 2018 to 2025. The dependent variable was log labor productivity, and the predictors were last year's labor productivity, log R&D investment and log capital intensity. Last year's labor productivity showed a statistically significant positive relationship with current productivity (B = 0.62, SE = 0.08, p < .001). The coefficient on R&D investment was 0.12, meaning that, with other model conditions equal, 1% higher R&D investment was associated with about 0.12% higher labor productivity (B = 0.12, SE = 0.04, p = .003). In the Arellano–Bond test, AR(1) was significant (p = .008), but AR(2) was not (p = .412). The Hansen J test also found insufficient evidence to reject the overidentifying restrictions (p = .284). These diagnostics alone, however, do not prove that all instruments are valid, so the construction of the instruments and the model assumptions need to be reviewed.
In actual research, also present the number of effective observations used in estimation, the lag range of the instruments, whether the instruments were collapsed and the finite-sample correction used. And if you report a long-run multiplier, state clearly which coefficients were used to compute it and the model's stability condition.
Dynamic panel GMM accounts for both the influence of past outcomes and endogeneity.
Dynamic panel analysis models a structure in panel data where current outcomes are affected by past outcomes.
For example, a firm's labor productivity can be affected by its productivity last year, so the past value of the dependent variable can be included as a predictor. But in panel data with short observation periods, using the ordinary fixed-effects estimator can cause bias because of the correlation between the lagged dependent variable and the error term.
Dynamic panel GMM is a method that tries to deal with this problem by using values of past variables as instruments. The main variants are Difference GMM and System GMM, which differ in the equations they use and in their instrument conditions.
But using GMM doesn't automatically solve endogeneity. You need to examine the exogeneity and relevance of the instruments, autocorrelation in the error term and the number of instruments together.
The core of dynamic panel GMM is to reflect how past outcomes affect the present while using suitable instruments to deal with the endogeneity problems that can arise in ordinary panel regression.