Thanks as usual to Kit Baum, a single command package -pchipolate- has
been added to SSC. Stata 10 is required. If interested, install with
-ssc-.
-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:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/