Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: New version of -regaxis- on SSC


From   "Roger B. Newson" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: New version of -regaxis- on SSC
Date   Tue, 17 Jan 2012 15:40:27 +0000

Thanks to Kit Baum, a new version of -regaxis- is now available for download from SSC. In Stata, use the -ssc- command to do this, or -adoupdate- if you already have an old version of -regaxis-.

The -regaxis- package is described as below on my website, and generates regular linear and logarithmic axis scales for use in Stata graphs. The new version fixes a bug, which caused these axis scales only to span the set of values from observations with non-missing values for all variables in the input -varlist-. This is now fixed, so the axis scales now span the set of values from observations with non-missing values for ANY variable in the input -varlist-. This is especially useful if the user wants to produce multiple plots with different symbols for subsets of observations from the same variable. As in:

sysuse auto, clear
clonevar mpg0=mpg if foreign==0
clonevar mpg1=mpg if foreign==1
lab var mpg0 "Mileage (US cars)"
lab var mpg1 "Mileage (non-US cars)"
regaxis mpg0 mpg1, ltick(ylabs) cy(5)
scatter mpg0 mpg1 weight, ylab(`ylabs')

This creates a scatter plot of mileage against weight, with values of mileage on the Y-axis spaced regularly by 5 miles per gallon, and different symbols for US and non-US cars.

Best wishes

Roger


--
Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

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

-----------------------------------------------------------------------------------
package regaxis from http://www.imperial.ac.uk/nhli/r.newson/stata10
-----------------------------------------------------------------------------------

TITLE
regaxis: Regular linear and logarithmic axis scales, ranges and tick lists

DESCRIPTION/AUTHOR(S)
      The regaxis package contains 2 programs, named regaxis and logaxis.
regaxis generates a regular linear axis range and tick list for a list of variables and/or numbers to be included in the axis range. logaxis generates a regular logarithmic axis range and tick list for a list of variables and/or numbers to be included in the axis range. Both programs can output the elements of the axis range and/or tick list to be stored in local and/or global macros, which can then be used in Stata graphics commands as axis options and suboptions, such as the the range() suboption of the xscale() and yscale() options, or the xlabel() ylabel(), xtick() and ytick() options.

      Author: Roger Newson
      Distribution-Date: 12january2012
      Stata-Version: 10

INSTALLATION FILES                                  (click here to install)
      regaxis.ado
      regaxis.sthlp
      logaxis.ado
      logaxis.sthlp
-----------------------------------------------------------------------------------
(click here to return to the previous screen)
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index