[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: Re: graph matrix by(x, norescale) doesn't work |

Date |
Tue, 9 Dec 2008 23:14:30 -0000 |

Here is a sample. Example sysuse auto lfitcimatrix price mpg \ weight length *! 1.0.0 NJC 9 December 2008 program lfitcimatrix version 8.0 gettoken yvars 0 : 0, parse("\") unab yvars : `yvars' gettoken bs 0 : 0, parse("\") syntax varlist [if] [in] [aweight fweight pweight] /// [, lfitciopts(str asis) scatteropts(str asis) /// combineopts(str asis) ] marksample touse markout `touse' `yvars' quietly { count if `touse' if r(N) == 0 error 2000 foreach y of local yvars { local Y : variable label `y' if `"`Y'"' == "" local Y "`y'" foreach x of local varlist { tempfile f twoway lfitci `y' `x' if `touse' /// [`weight' `exp'] /// , `lfitciopts' /// || scatter `y' `x' if `touse' /// [`weight' `exp'] /// , legend(off) saving("`f'") nodraw /// yti(`"`Y'"') `scatteropts' /// local files `"`files' "`f'""' } } } graph combine `files', `combineopts' end Nick n.j.cox@durham.ac.uk Nick Cox If you try this, you'll find that the -lfitci- graphs have blank -ytitle()-. That is what the original graphs are like; it's not a -cpyxplot- bug. But it does limit the usefulness of -cpyxplot- applied directly. My advice to consider customising your own using a clone of -cpyxplot- as template remains. Nick Cox I think it's difficult to see how -graph matrix- could readily accommodate that kind of addition -- together with the many, many other additions that might be imagined -- without the syntax collapsing into unmanageable complexity. One difficulty is that the user would often want to reach through to tweak lots of details on the individual graphs and that's likely to be a pain to accommodate. In many ways, it is better to think bottom up in terms of looping over variables and emitting a series of graphs to feed to -graph combine-. -cpyxplot- from SSC already implements one strategy of this kind. It lets us you do things like this: sysuse auto, clear cpyxplot price mpg \ weight length , plottype(lfitci) The \ separates responses and predictors. That appears to be more or less what you are asking for. (If what you really want is -scatter- too, that is beyond -cpyxplot-, but a customised clone is obtainable with some programming.) Nick n.j.cox@durham.ac.uk Clive Nicholas One question for StataCorp: Why are there no -(lfit y x)- and -(lfitci y x)- options with -graph matrix? If I'm not missing anything obvious, this would make -graph matrix- even more useful than it already is. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: Re: graph matrix by(x, norescale) doesn't work***From:*"Clive Nicholas" <clivelists@googlemail.com>

**References**:**st: graph matrix by(x, norescale) doesn't work***From:*David Airey <david.airey@Vanderbilt.Edu>

**st: Re: graph matrix by(x, norescale) doesn't work***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**Re: st: Re: graph matrix by(x, norescale) doesn't work***From:*David Airey <david.airey@vanderbilt.edu>

**RE: st: Re: graph matrix by(x, norescale) doesn't work***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**Re: st: Re: graph matrix by(x, norescale) doesn't work***From:*"Clive Nicholas" <clivelists@googlemail.com>

**RE: st: Re: graph matrix by(x, norescale) doesn't work***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**RE: st: Re: graph matrix by(x, norescale) doesn't work***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: RE: re: fw: question** - Next by Date:
**Re: st: Running simple autocorrelation regressions using -forval-** - Previous by thread:
**RE: st: Re: graph matrix by(x, norescale) doesn't work** - Next by thread:
**Re: st: Re: graph matrix by(x, norescale) doesn't work** - Index(es):

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