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

st: Superimposing graphs

From   "Branko Milanovic" <>
To   <>
Subject   st: Superimposing graphs
Date   Thu, 10 Feb 2005 14:49:06 -0500

I am trying to draw two very similar graphs in one figure. The graph for
year X should show dots for that year and fit a regression (qfit or lfit
I don't care). The graph for year Y should do exactly the same thing and
fit the regression for that year across that year's dots. Seems easy?

But while each of the graphs works fine separately, and while one of
them works with both the dots and the line (as it should), the other
shows only the dots or gives the message

1| invalid name

So I cannot get both of them with dots and fits on the same figure. Any
idea why?  The text is given below.

Thanks a lot,

Branko Milanovic

 twoway (scatter capture lngdpppp if year==1988 & group==1 || qfit
capture lngdpppp if year==1988 & group==1)
(scatter capture lngdpppp if year==1998 & group==1 || qfit capture
lngdpppp if year==1998 & group==1)

Ps. "capture" is variable name.

Carnegie Endowment for International Peace
1779 Massachusetts Avenue NW
Washington DC 20036
Email: or
tel: 202-473-6968 (leave a message)

*   For searches and help try:

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