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

st: RE: graph problem: combined graph?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: graph problem: combined graph?
Date   Mon, 16 Dec 2002 11:12:35 -0000

Hung-Jen Wang
> 
> I'd like to know whether its possible to draw a scatter plot with
> both point-to-point connections and cubic splines.
> 
> To illustrate the problem, consider the following data.
> 
> ---------- data begin -----------
> input y  x
>      0.5 1
>      0.1 2
>      0.2 3
>      0.7 4
>      0.9 5
>      0.4 6
>      0.3 7
>      0.7 8
>      0.5 9
>      0.2 10
> end
> ---------- data end --------------
> 
> The following command draws the graph with each points of y
> connected together.
> 
>    graph y x, c(l) s(o)
> 
> I can also draw the graph with cubic splines to show the
> "tendencies" of y. This is done using the -bands()- option.
> 
>    graph y x, c(s) s(o) bands(4)
> 
> My problem: I would like to have a "combined" graph with one of
> the above graphs superimposes onto the other. That is, I want to
> have a graph that shows both kinds of lines: point-to-point
> connections, and the cubic splines.
> 

graph y y x, c(ls) sy(oi) bands(4) 

Nick 
[email protected] 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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