[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: graph with two trend lines
Hans J. Baumgartner wrote
I would like to draw a graph that shows all data point and (i) a trend
line over all data points and (ii) a trend line over selected data
reg x1 x2
graph yhat1 x1 x2, connect (l.) symbol(i[x3]) trim (3)
This shows the desired graph with one trend line over all data points.
reg x1 x2 if x4==1
yhat2 shall be the second trend line over selected data points (x4 is
How has the graph command to look like?
>>> Just add in the new variable:
gra x1 yhat1 yhat2 x2, c(.ll) sy([x3]ii) trim(3) sort
Defining some variable labels beforehand will also help.
* For searches and help try: