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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Splines


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Splines
Date   Thu, 21 Feb 2013 01:28:23 +0000

You were asked to read the FAQ before posting. That explains that you
are asked not to give minimal name (date) references. Also, BTSCS
looks to me like jargon from your field. It is difficult not to use
jargon on a list like this, but unexplained jargon nevertheless cuts
down the number of people who might both read and reply to your posts.

In terms of your question, running -lowess- and calling the smooth a
spline does not make it a spline. There are many classes of spline,
but I doubt that there's any definition that generous.

The most common kinds of splines are linear and cubic. -mkspline-
creates either kind. My best advice is to read the manual entry on
-mkspline- and run through the examples in the help.

I can't easily follow what you are trying to do otherwise. If you are
saying that your response (dependent variable, in your terms) flips
between states of 0 and states of 1, it sounds quite unsuitable for
splines. But you seem to be trying to model it as a function of
duration, not time; sorry, but you lost on me on that.

My bottom line is that -lowess- is _not_ a spline method.

Nick

On Thu, Feb 21, 2013 at 1:08 AM, Marc Peters <marcpeters32c@gmail.com> wrote:

> I have never used splines before and have a rather silly question. I
> am running a BTSCS model and have read up on my Beck, Katz and Tucker
> (1998) and understood that I should use either temporal dummies or
> splines to adjust for temporal dependence.
>
> The data is structured as duration data, with events coded as 1 and
> non-events as 0. The dependent variable is measured at discrete
> intervals (years) and an event can go on for several years (it often
> does).
>
> From the data I have created a variable (duration) counting the number
> of years since the last event. The variable is coded as 0 as long as
> the event is ongoing.
>
> From this variable I create lowess splines using
>
> lowess Y duration, gen (spline)
>
> and then:
>
>
> logit Y X spline, cluster(id)
>
>
> I have understood that this is what you are supposed to do, but since
> the spline is defined on the dependent variable the spline variable
> always take on a high value when duration=0 (i.e. there is an event).
> Consequently, when running the model I receive the following message
> when running the command:
>
>
> spline > .4679623 predicts data perfectly
>
>
> I would be very grateful if anyone could help me with what it is I am
> doing wrong. In the end, I should probably use cubic splines but first
> I want to understand the simple principle.
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index