Denton’s method with Stata

In this blog, you will learn to use the Denton method with Stata to interpolate a series to a higher frequency. I will show you a simple example using the DENTON package written by Christopher Baum and Sylvia Hristakeva, initially written in 2001, the DENTON package has been revised in 2021.

The authors of this package provide the following description: “the proportional Denton method of interpolation of a low-frequency flow time series by use of an associated high-frequency “indicator series”, imposing the constraints that the interpolated series obeys the low-frequency totals. The method is recommended in IMF publications as “relatively simple, robust, and well-suited for large-scale applications.” It may be particularly useful in cases where, due to sizable statistical discrepancy, quarterly series do not integrate to annual totals. The indicator series only contribute their pattern to the interpolation. The routine can interpolate annual data to quarterly or monthly, and quarterly data to monthly. The stock option allows the routine to handle stock (rather than flow) series.

I will use the usmacro dataset provided by Stata, which provides the policy rate, the CPI inflation, the output gap for the US economy between the third quarter of 1954 to the last quarter of 2010 (source: FRED). The dataset needs to be declared as a time series dataset with the following commands:

webuse usmacro, clear
tsset 

You can note that I drop the year 1954 to have complete years:

drop if date<tq(1956q1)
twoway (line fedfunds year) (line ogap year) ///
 (line inflation year), name(G3, replace)

Now, I will use the command collapse to transform my quarterly dataset into a yearly dataset. Before, I need to generate the year associated to the quarters with the date functions of Stata. The time variable has to be formatted, and the yearly database saved.

gen year=yofd(dofq(date))
collapse (mean) fedfunds inflation ogap, by(year)
list
format %ty year
tsset year, yearly
save usmacro_ann.dta, replace

Now, we will see how to use the Denton’s method and compare the original quarterly series and the one obtained with the Denton’s method. In the command, I have to specify which yearly variable will be interpolated, inflation in this example, the output database with the interpolated series, usmacro_denton.dta. Then, the quarterly variable used for the interpolation, the indicator series, inflation in the quarterly database, usmacro.dta has to be specified. Lastly, we can choose a name for the output series, rate, and specify the stock option.

Note: The indicator series only contribute their pattern to the interpolation; thus it is quite feasible to use both quarterly and annual flow series expressed at an annual rate. In this instance, the interpolated series will be at a quarterly rate.

use usmacro_ann.dta, clear 
assert _N == 55 
 
denton inflation using usmacro_denton.dta, /// 
 interp(inflation) from(usmacro.dta) generate(rate) stock  
 
use usmacro_denton.dta, clear 

twoway (line rate date), name(G4, replace)

The interpolated series for inflation is obtained and compared to the original one:

drop inflation
 
merge 1:1 date using usmacro.dta 
drop _merge

twoway (line inflation rate date) ///
 , name(G5, replace)

As we have seen in this blog, the DENTON package allows estimating a high-frequency series by interpolating a lower frequency series, thanks to an indicator series. The files for replicating are available on my GitHub.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.