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]

Re: st: cubic spline interpolation in panel data

From   Nick Cox <>
Subject   Re: st: cubic spline interpolation in panel data
Date   Mon, 4 Apr 2011 17:22:50 +0100

That's not a message I've seen before. I tried a few experiments to
see if it would fall over if all values in a group were missing, or
all non-missing, but no problem.

I don't know what you mean about looking at the menu. -csipolate- is
not associated with any menus.


On Mon, Apr 4, 2011 at 5:10 PM, Ben Ammar <> wrote:
> Hi Nick,
> thanks for your answer. You're right, the statistical approach of interpolating the data isn't the best choice but unfortunately the data is only available on a quarterly basis.
> I just used the command that you mentioned as follows:
> -by group: csipolate price date, gen(price2)-
> I generated missing values between the quarterly dates through -tsfill-
> and everything also works fine -ipolate- and -cipolate-.
> But with -csipolate- I receive this:
>               spline3():  3201  x[0,0] found where vector required
>             csipolate():     -  function returned error
>                 <istmt>:     -  function returned error
> I have no idea why that happens. The help-menu does not indicate any further information for the -csipolate- command. Am I missing additional information?
> Regards Ben
> -------- Original-Nachricht --------
>> Datum: Mon, 4 Apr 2011 16:08:15 +0100
>> Von: Nick Cox <>
>> An:
>> Betreff: Re: st: cubic spline interpolation in panel data
>> I think there are two distinct issues here.
>> First, -csipolate- (SSC) is a wrapper for a relative of the Mata
>> function you mention, so that is a positive for you.
>> It's a cousin of -cipolate- (SSC), which you mention, but without
>> giving its source. It would be more accurate to say that it supports
>> -by:- than it knows about panel data as such, but the distinction
>> should not bite you.
>> Second, what you mean by interpolation? If you have prices that are
>> averaged in some way over quarters, no interpolation process will put
>> back detail that has been lost. If you have prices that are measured
>> once a quarter, say 1 Jan 2011, 1 Apr 2011, etc., then clearly you can
>> apply interpolation, although its appropriateness for price variation
>> seems moot to me.
>> On Mon, Apr 4, 2011 at 3:57 PM, Ben Ammar <> wrote:
>> > Hi everyone,
>> >
>> > I was wondering if there's any possibility to use spline3() with Mata if
>> the dataset is in panel form (400000 observations, 40 years)?
>> > Currently I have quartely dates with prices but I would like to
>> interpolate those prices on a monthly basis.
>> > -ipolate- works fine but I'm trying to smooth the data as much as
>> possible.
>> > I also installed -cipolate- but I just read it's not a spline function.
>> > Does anyone have an idea how to use the spline3() with panel data
>> (-reshape- the dataset came to my mind, but I don't think that is would help
>> somehow + I'm using Stata IC, which could be tight due to 40 years of
>> observations)or perhaps does someone have another way to approach the interpolation
>> on a monthly basis?

*   For searches and help try:

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