[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Help: Spline model

From   n j cox <>
Subject   Re: st: Help: Spline model
Date   Wed, 18 Jul 2007 18:37:40 +0100

Smoothing people split into those who want make life simple
for their users and those who are obsessed by small advantages
and disadvantages of this method relative to that and quarrels
with other smoothing people. Come to think of it, that applies
elsewhere too.

On the other hand, reasonable smoothing methods applied
to moderately well-behaved situations in similar ways will generally
agree with each other, even if devised on different bases (pun

Homilies apart, note that Stata 10 has added restricted cubic splines to -mkspline-, following some able advocacy from Bill Dupont and Frank Harrell. There hasn't been much publicity about this, but in my view
it is a very welcome addition.

The technique is nicely written up in Frank's book, which I have
just quoted in another post.

I have played around with several examples and written
a wrapper program -rcspline- that calls up -mkspline-,
generating the splines as temporary variables, runs the regression and then plots response, smoothed response, and predictor. Various options
allow tweaking of number and positions of knots, display of confidence
intervals, and so on. Only the tedious job of writing a help file

I have found that the default number and positions of knots usually
work very well. The result is quick and _much_ faster than -lowess-.
Also, the default of -lowess- can leave small blips and burps without
scientific or practical meaning.
Being able to get out confidence intervals is naturally a bonus too.
It is also easier to use than -lpoly-.

In due course, I will ask Kit Baum to put -rcspline- on SSC. Note
as above that Stata 10 is required.


Maarten buis

--- Anita Sayal <> wrote:
> Could someone pl. offer some basic source to that can
> guide in running a "continuous piecewise regression"
> that allowing regression line to change. Also how do
> you determine where the line might change.

A short and easy text is (Marsh and Lewis-Beck 2001). Typically one
decides the location of the knots (places where the line changes) based
on theory or chooses equally spaced knots or locates knots at certain
quantiles. It is also possible to use -nl- to simultaneously estimate
these locations. The principle behind this is also (briefly) discussed
in (Marsh and Lewis-Beck 2006). However, this is a hard maximazation
problem and when I tried it -nl- often did not converge.

Marsh, Lawrence and Michael S. Lewis-Beck (2001), "Spline Regression
Models". Thousand Oaks: Sage.

* For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index