Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: How Do I Plot a Serset?

From   Roger Newson <>
Subject   st: Re: How Do I Plot a Serset?
Date   Fri, 05 Sep 2003 12:57:38 +0100

At 22:51 04/09/03 -0400, Germán Rodríguez wrote:
Roger Newson had a request for examples of using sersets, but I haven't
yet seen any replies.  Like him, I read the documentation on sersets.
The help file says they are used extensively by the graphics system and
refers to the graphics manual. But the manual's index has no entry for
sersets, and my browsing so far has yielded no results.

My interest arose out of missing c(s), the spline option of connect in
the old graphics system.  As far as I can see, the option is gone. (I
know I can use gr7, but that misses the point.) The option was nice
because one could evaluate a log-likelihood function of a scalar
parameter at half-a-dozen points, and then plot a nice smooth curve with
just a few keystrokes.

Looking at sersets I discovered a promising command, serset
create_cspline, which seems to compute everything one would need to do
spline interpolation. I managed to turn my y and x variables into a
serset, and then used serset create_cspline y x to interpolate with a
default of five points between pairs of x's, which is most excellent.

But how do I plot the serset? Could we pretty please have an example
showing how to do a line plot of y and x from a user-defined serset?  Of
course it would be even nicer if someone created a spline connectstyle,
so we could go back to using c(s). Dare I ask?

For what it's worth, I did receive a reply (privately) from Vince Wiggins. I have taken the liberty of quoting it below (on the presumption that that is all right).

I think that what German really wants is a variable containing a spline, to plot on a graph. There are several Stata utilities for creating splines of different kinds. Official Stata has -mkspline-, which only creates linear splines. My own -bspline- package, downloadable from SSC (with a .pdf manual), creates Schoenberg B-splines of any degree (linear, quadratic, cubic, quartic, quintic etc.). Peter Sasieni's -spline- package, downloadable from the STB site, creates natural cubic splines. All of these, and more, can be found by typing

findit spline

in Web-aware Stata.

I hope this helps.


Vince Wiggins wrote:

Hi Roger,

I have not been monitoring statalist closely and just now saw your post about
-serset-, that is why I am responding off list.

There is nothing really hidden about sersets.  What you see in [P] is what you
get.  When [P] sersets says they are used by the "internals" of graphics, it
really means internals.  These internals are not anything currently of
interest to users.

We documented sersets in the interest of being open and because our users
continually surprise us with the creative application of features in ways that
we had never considered.

I don't currently see any advantage of a -sersetcreate()- option for
-parmest-, mainly because you cannot add new variables to a serset without
first making it the current dataset.  I don't believe we will ever add that

   All the best,

-- Vince

Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
  or 020 7848 6605 International +44 20 7848 6605

Opinions expressed are those of the author, not the institution.

*   For searches and help try:

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