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

RE: st: Superimposing graphs


From   "Branko Milanovic" <bmilanovic@carnegieendowment.org>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Superimposing graphs
Date   Thu, 10 Feb 2005 16:34:46 -0500

Scott,

Unfortunately, it does not work.  What I find strange is that

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

Works quite fine. But if I repeat the same thing for another year (on
the same figure) it does NOT work. But then if I take that another year
and plot it alone (just to check if something may be wrong with it), the
graph works again. O, it is only when they are together that the things
do not work. (On a related note, it seems to me that the new twoway
options have a fair number of bugs.)

Best, b



Carnegie Endowment for International Peace
1779 Massachusetts Avenue NW
Washington DC 20036
Email: bmilanovic@ceip.org or branko_mi@yahoo.com
tel: 202-473-6968 (leave a message)
www.worldbank.org/research/inequality
http://econpapers.hhs.se/RAS/pmi44.htm
http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=149002


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of
smerryman@kc.rr.com
Sent: Thursday, February 10, 2005 4:26 PM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: Superimposing graphs

You seem to be mixing the ||-separator and ()-binding notation.

Try this:

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)


Hope this helps,
Scott

----- Original Message -----
From: Branko Milanovic <bmilanovic@carnegieendowment.org>
Date: Thursday, February 10, 2005 1:49 pm
Subject: st: Superimposing graphs

> 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.
>


*
*   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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index