Bookmark and Share

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


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

-csipolate- updated on SSC [was: Re: st: cubic spline interpolation in panel data]


From   Nick Cox <[email protected]>
To   [email protected]
Subject   -csipolate- updated on SSC [was: Re: st: cubic spline interpolation in panel data]
Date   Fri, 8 Apr 2011 16:21:48 +0100

Thanks to Kit Baum, -csipolate- has been updated on SSC.

To those who want a brief explanation of this outcome of a thread
started by Ben Ammar:

1. -ipolate- is an official Stata command that just does linear interpolation.

2. -cipolate- is a user-written command (SSC) for cubic interpolation.
This is a classic (18th century if not earlier) based on fitting
cubics to subsets of four distinct points.

3. -csipolate- is another user-written command (SSC) for cubic
_spline_ interpolation.
It is at root just a wrapper for the Mata functions -spline3()- and
-splineval()-

Ben Ammar's dataset exposed a limitation of -csipolate-. It fell over
when asked to interpolate singleton missing values.

That is, there is just one observation; and the variable in question
is missing in that bservation.

In this case there is nothing to interpolate with, so the problem is
insoluble as stated.

Further, discussion with Stata tech support (very clear analysis from
Isabel Canette) establishes that it is clearly my bug in the sense
that the rules for the Mata functions in question certainly exclude
feeding them matrices with 0 rows and 0 columns, which was what
happened here.

So, I have fixed it. Only one line of code needed to be changed.

Thanks to Ben for providing a challenge to meet.

Nick
[email protected]

[...]

>> On Mon, Apr 4, 2011 at 3:57 PM, Ben Ammar <[email protected]> wrote:

>> > I was wondering if there's any possibility to use spline3() with Mata if
>> the dataset is in panel form (400000 observations, 40 years)?

[...]
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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