*! version 3.2.3 31 Dec 2017
help lmdi

Title

lmdi -- Logarithmic Mean Divisia Index (LMDI) Decomposition

Syntax

lmdi decomposed_var = component_vars , t(varname) over(varlist) [ options]

lmdi decomposed_var = (component[k]_vars) component[j]_vars , t(varname) over(varlist) [ options]

t(varname) specifies the time variable.

over(varlist) specifies variables for the decomposition structure, indicating summing over the specific variables.

add indicates additive LMDI; the default is multiplicative form.

zero(real) handles the zero value problem, indicating replacing zero values (and missing values) with a very small real number; default is 1e-20.

tolerance(real) specifies the tolerance; default is 0.01. The value is first used to check whether the specified variables can form an identity. Then it is used to check the difference between the real change and the total of the
decomposed effects.

saving(filename) specifies that the results be saved in filename.dta.

replace specifies saving the results with replace option.

Description

lmdi attributes the total change of the decomposed variable into several predefined components using logarithmic mean divisia index (LMDI) approach.

The command is very flexiable. It can be used for multi-level decomposition. For example, suppose an economy consists of N sectors, and sector i is composed of n_ subsectors, subsector j in sector i consumes four types of energy
(E_, k=1,2,3,4) and generates output Y_. The total energy consumption change can be written as:

E=sum_(E_)=sum_(F_I_S2_S1_Y)

where Y=sum_(Y_); Y_=sum_(Y_); F_=E_/E_; E_=sum_(E_); I_=E_/Y_; S2_=Y_/Y_; S1_=Y_/Y.

LMDI attributes the change of E into 5 components: effect of energy composition (change in F_), intensity effect (change in I_), structural effect at the level 2 (change in S2_),
structural effect at the level 1 (change in S1_), and the activity effect (change in Y).

The data can be organized in a long panel, e,g.,

year sector subsector E F1 F2 F3 F4 I S2 S1 Y
----------------------------------------------------
. i j . . . . . . . . .

The decomposed effects can be obtain through the following command

lmdi E= (F1 F2 F3 F4) I S2 S1 Y, t(t) over(sector subsector)

or equivalently,

if the data is organized as

year sector subsector type E F I S2 S1 Y
----------------------------------------------------
. i j k . . . . . .

The decomposed effects can be obtain through

lmdi E= F I S2 S1 Y, t(t) over(sector subsector type)

Examples

. import excel using "https://gitee.com/kerrydu/Stata/raw/master/lmdi1.xlsx", first

. lmdi E = I S Y, t(year) over(sector)

. lmdi E = (F1 F2) I S Y, t(year) over(sector)

. lmdi E = (F1 F2) I S Y, t(year) over(sector) add

. import excel using "https://gitee.com/kerrydu/Stata/raw/master/lmdi2.xlsx", first

. lmdi E= (I1 I2 I3 I4 I5 I6 I7 I8) (S1 S2 S3 S4 S5 S6 S7 S8) Y, t(year) over(id) sav(res) replace add

References

Ang, B.W., 2004. Decomposition analysis for policymaking in energy: which is the preferred method? Energy Policy 32, 1131–1139.

Ang, B.W., 2005. The LMDI approach to decomposition analysis: a practical guide. Energy Policy 33, 867–871.

Author

Kerry Du

Shandong University

China

E-mail: kerrydu@sdu.edu.cn