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: fitting curves in regplot

From   Nick Cox <>
Subject   Re: st: fitting curves in regplot
Date   Sat, 25 Jun 2011 20:08:02 +0100

Sorry, but I don't understand precisely what your question is. Note
that there are several Nicks active on the list.

-twoway mspline- is able to mimic straight lines, as a piecewise cubic
can be piecewise linear. Consider

. set obs 100
obs was 0, now 100

. gen x = _n

. gen y = 42 + 32 * x

. twoway line y x || mspline y x


On Sat, Jun 25, 2011 at 5:54 PM, Arti Pandey <> wrote:
> Hello
> I am trying to fit curves after regression using glm. I am following Nick's
> various online documents, especially the paper "Speaking Stata: Graphing Model
> Diagnostics", The Stata Journal,2004, 4 No. 4, Pg 449-475". I am trying to get
> the fitted curves to look like those in the paper. Choosing "lowess" for
> plottype looks better but regplot doesnt allow us to play with bwidth.
> So my question is to Nick and anyone else who followed that paper, how can
> mspline give such a perfect curve there. For example. the curve fit by type
> shows perfect linear for one type, would mspline show that.
*   For searches and help try:

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