Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: cubic spline interpolation in panel data


From   "Ben Ammar" <Ben-Ammar@gmx.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: cubic spline interpolation in panel data
Date   Mon, 04 Apr 2011 18:10:11 +0200

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 <njcoxstata@gmail.com>
> An: statalist@hsphsun2.harvard.edu
> 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 <Ben-Ammar@gmx.de> 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:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index