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
points.
reg x1 x2
predict yhat1
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
predict yhat2
yhat2 shall be the second trend line over selected data points (x4 is
a
dummy)
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.
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/