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

Re: st: Plotting string variables with sencode

From   Roger Newson <>
Subject   Re: st: Plotting string variables with sencode
Date   Thu, 06 Oct 2005 11:33:41 +0100

At 11:12 06/10/2005, Joanna Carrington wrote:
Dear Stata list users,

I am trying to produce a graph that is essentially a forest plot using a combination of a scatter plot and a twoway rcap plot. I have gone down this route as I have found the metagraph and eclplots are not exactly what I need. I have estimates with very different weights and those that are weighted heavily completely engulf the other lightly weighted estimates when metagraph is used (I have tried changing the scale of the weights in the plot and this doesn't help as the smaller weights disappear). The [w="a weight"] option does not work with the eclplot command.

So using the my scatter and rcap plot I need to plot the alphanumerical id of the estimates on the y axis. I have used sencode to produce a new variable that, if I'm correct in thinking, is numerical but keeps the alphanumerical part as a label. Now when I use this variable in the plots I would like the labels to be displayed (automatically preferably to me specifying each individual label using ylabel(1 "" 2 etc)) rather than the number.
Does anyone know how I can do this please?
If you use the option

ylabel(1(1)20, valuelabel)

then the axis labels will be value labels. Otherwise, the axis labels may be value labels or formatted values, depending on the scheme.

Another tip. -eclplot- can do symbols weighted by study size. It does this by specifying weights as part of the -estopts()- option. If you type

eclplot estimate min95 max95 study, estopts(,[aweight=studysize])

(note the comma before the weight), then the estimates will be weighted by study size. And you can also use the -supby()-, -estopts1()- and -estopts2()- options to make the symbols squares for the individual studies and diamonds for the combined meta-analysed estimates. See the on-line help for -eclplot-.

I hope this helps.


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

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

* For searches and help try:

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