Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Roger B. Newson" <r.newson@imperial.ac.uk> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: New version of -regaxis- on SSC |
Date | Tue, 17 Jan 2012 15:40:27 +0000 |
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: r.newson@imperial.ac.uk 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 ----------------------------------------------------------------------------------- TITLEregaxis: 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/