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

Re: st: Axis's limits when one var has missing when other is max


From   Roger Newson <[email protected]>
To   [email protected]
Subject   Re: st: Axis's limits when one var has missing when other is max
Date   Wed, 23 Nov 2005 12:56:15 +0000

Chris might like to try the -regaxis- package, downloadable from SSC using the -ssc-command in Stata. -regaxis- produces regular linear or logarithmic axis ranges and label sets, to span a subset of the data and/or extra points such as the zero, and stores them in local macros for use by the user in the -xlabel()-, -ylabel()- and -scale()- options of -graph-.

I hope this helps.

Roger


At 02:21 23/11/2005, Chris wrote:

For what it's worth, here's a little gripe about -graph-.  I wish that
Stata determined the extent of the axes by the points that will be
plotted, rather than conditioning on the maxima and minima of the two
variables.  It's a tiny complaint, but I post for two reasons:

- Other users may be puzzled by this feature.

- The response Stata Technical Support gave me was that "it's just the
way Stata graph commands were written."

Maybe there are arguments in favor of the current functionality, and
maybe there's a "change is bad" argument, but it's easy to increase the
extent of an axis by other means.  It also seems as if it would simple
to change Stata's code to implement the functionality I'm looking for,
although I could be very wrong about that.

Here's an illustration of the issue.

        input x y
        2 4
        1 15
        100 .
        4 20
        end
        scatter y x // The x-axis maximum is 100
        more
        scatter y x if y<. & x<. // The x-axis maximum is 4 (preferred)

Chris

--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
Division of Asthma, Allergy and Lung Biology
King's College London

5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
  or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]
Website: http://phs.kcl.ac.uk/rogernewson/

Opinions expressed are those of the author, not the institution.

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