Statalist The Stata Listserver

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

RE: st: -mlowess- available on SSC

From   "Nick Cox" <>
To   <>
Subject   RE: st: -mlowess- available on SSC
Date   Wed, 18 Oct 2006 18:17:59 +0100

-lowess- has long been an official Stata command, 
although the original program was a user-written
program by Patrick Royston. 

STB-3   gr6 . . . . . . . . . . . . . . . . . . . . . . . . . Lowess smoothing
        (help ksm)  . . . . . . . . . . . . . . . . . . . . . . . . P. Royston
        9/91    pp.7--9; STB Reprints Vol 1, pp.41--44
        incorporated into Stata 3.0

The other programs you mention all remain user-written. 

-running- has accreted authors over time: 

SJ-5-2  sed9_2  . . . . . . . . . . . . . . . . .  Software update for running
        (help running if installed) . .  P. Sasieni, P. Royston, and N. J. Cox
        Q2/05   SJ 5(2):285
        running rewritten to support Stata 8 graphics and otherwise
        modernized;  now attributable to the three authors named above

STB-41  sed9.1  . . . . . . . . . . Pointwise confidence intervals for running
        (help running if installed) . . . . . . . .  P. Sasieni and P. Royston
        1/98    pp.17--23; STB Reprints Vol 7, pp.156--163
        improved version that allows analytic weights, standard errors
        and confidence bands to be calculated and added to the graph,
        twicing, maximum span of 2 for a running line smoother

STB-24  sed9  . . . . . . . . . .  Symmetric nearest neighbor linear smoothers
        (help running if installed) . . . . . . . . . . . . . . . . P. Sasieni
        3/95    pp.10--14; STB Reprints Vol 4, pp.97--101
        alternative to ksm; for use when the number of observations is
        large (because faster than ksm); does not permit arbitrary weights

-mrunning- has a single manifestation: 

SJ-5-3  gr0017  . . . . . . . . . . . . . A multivariable scatterplot smoother
        (help mrunning, running if installed) . . . . P. Royston and N. J. Cox
        Q3/05   SJ 5(3):405--412
        presents an extension to running for use in a
        multivariable context

and -mlowess- was just posted on SSC. 


1. -mrunning- and -mlowess- smooth a response given multiple predictors. 
They will work with single predictors but it is simpler and more
efficient to use -running- and -lowess- if you have just one predictor. 

2. Otherwise the main difference is in how you smooth. 
What I call the "smoothing industry" in statistical science 
have come up with numerous different smoothers. But the usual
heretical (or banal, depending on circles) comment if you are 
not one of the inventors is
that reasonable smoothers usually produce very similar smooths, 
given comparable degrees of smoothing, so the choice is partly 
a matter of taste -- or perhaps even something external, 
such as how easy will it be to explain this to my audience. 

3. A difference that some people may care about is that -running- 
and -mrunning- produce standard errors. However, the usual
danger is that people will want to use such standard errors
more literally than the theory or their data will justify, 
especially in the presence of serial correlation. 

Truth to tell, I haven't an enormous amount of _experience_
with any of these programs, certainly not over a wide 
range of datasets and dataset sizes. I'm just the third
author of -running-, the second author of -mrunning- 
and the first and only author of -mlowess-. In the case of -running-
and -mrunning- my main contribution was porting the 
graphics to Stata 8/9 and otherwise modernising the code.
In the case of -mlowess- I just took the framework of -mrunning-
and translated the ideas to a base of -lowess-, cutting and adding options
as appropriate. 

For what it's worth, my experience with -mlowess-
is that its defaults, which are just copied from -lowess-, work
nicely as defaults. With -running- and -mrunning- I find that 
the defaults often undersmooth compared with seems scientifically 
reasonable to me. Also -running- and -mrunning- are somewhat cryptic
about what default was actually used, and so the user is more
in the dark than they should be about how to get smoother 
or rougher results. That's something the authors (i.e. we) should 
probably attend to if either program is revised.

I also have an -mlocpoly-, but I'm sitting firmly on it. -locpoly-
is a more versatile program than -lowess-, but to apply it seriously 
to multiple predictors requires the flexibility to specify 
different smoothing choices for different predictors. I can program that, 
but it doesn't appeal for various reasons. As -lowess- specifies 
smoothing in terms of a fraction of the data, it doesn't seem
outrageous to smooth w.r.t. each predictor to the same degree, and
that's wired into -mlowess-. Again, I could program that, but then
the author and possibly some users might start taking that too 

I am very happy if anybody finds this stuff interesting or useful, 
but they are just automated equivalents of the eyeball and freehand 


Fred Wolfe
> Could you provide a brief comparison of the mlowess and 
> mrunning programs 
> (and running and lowess) for those of us who are not expert? 
> Where would 
> you use one as opposed to the other?
> >-mlowess- is for lowess smoothing with multiple predictors.
> >It follows -fractileplot-, posted recently.
> >
> >Stata 8 is required.
> >
> >-mlowess- computes lowess smooths of a response
> >on specified predictors simultaneously; that is,
> >each smooth is adjusted for the others.  Fitted
> >values may be saved in new variables. By default,
> >adjusted values of the response and the lowess
> >smooth are plotted against each predictor.
> >The approach is based on methodology for
> >generalised additive models, but -mlowess- is
> >primarily intended for exploratory graphics,
> >rather than model fitting with inferential apparatus.
> >For example, it might be useful to check whether
> >predictors are worth including in a model at
> >all, or as such or transformed.

*   For searches and help try:

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