Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: -pchipolate- added to SSC

From   Nick Cox <>
Subject   st: -pchipolate- added to SSC
Date   Mon, 3 Dec 2012 19:05:19 +0000

Thanks as usual to Kit Baum, a single command package -pchipolate- has
been added to SSC. Stata 10 is required. If interested, install with

-pchipolate- is the latest of a highly irregular series of
user-written interpolation commands. Many versions ago, Stata added a
command -ipolate- for linear interpolation of some variable, say
-yvar-, with respect to another variable -xvar-.

There are several other interpolation methods of equal or greater use
even for the simple 1-D interpolation problem. SSC now offers
-cipolate- (cubics), -csipolate- (cubic splines), -nnipolate- (nearest
neighbour interpolation) and as of now -pchipolate- for piecewise
cubic Hermite interpolation. This method is often described informally
as "pchip". The piecewise cubics join smoothly, so that both the
interpolated function and its first derivative are continuous. In
addition, the interpolant is  shape-preserving in the sense that it
cannot overshoot locally; sections in which observed -yvar- is
increasing, decreasing or constant with -xvar- remain so after
interpolation, and local extremes (maxima, maxima) also remain so.So,
the result is smoother than linear interpolation but without the
possibility of "looping the loop" artefacts produced by classic cubic
interpolation or cubic spline interpolation.
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index