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

st: Re: Axis scale for boxplot


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: Re: Axis scale for boxplot
Date   Thu, 22 Jan 2004 22:20:54 -0600

For the Y-axis you use custom axis labels.  For example:

 sysuse auto
(1978 Automobile Data)

. qui sum price

. gen p2 = price/r(max)

. graph box p2, medtype(line) over(rep) ylabel(.1 "10%" .2 "20%" .3 "30%" .4
"40%" .5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%" 1 "100%") mark(1, mlab(p2) )


hope this helps,
Scott

----- Original Message ----- 
From: "Steve Harvey" <[email protected]>
To: <[email protected]>
Sent: Thursday, January 22, 2004 9:29 PM
Subject: st: Axis scale for boxplot


> Dear Stata listers,
>
> I have a data set of exam scores (knowledge of skilled birth attendants
> from different countries) expressed as percentage of questions answered
> correctly.  I want to create boxplots that show the scores from each
> country in a different boxplot.  Creating the plot itself is no
> problem.  However, the scores are stored as decimals (75.2% is stored as
> 0.752), so my Y axis displays as .0, .2, .4,... 1.0.  I would like it to
> display instead as 0%, 20%, 40%,... 100%.  Is there any command that will
> allow me to do this?  If at all possible, I would like the "%" character to
> be included (20%, not just 20).  I would like labels for outliers to
> display the same way (i.e., 27.5% instead of 0.275).
>
> I could create a new variable: scorep = score*100 but I would like to avoid
> this if possible, since I am also reporting out a variety of sub-scores
> (e.g., "total" knowledge, knowledge of labor monitoring, knowledge of
> pre-eclampsia, etc.).  If this is the only option, I would have to create
> newvars for each sub-score in addition to the total score.
>
> I am using Stata 8.
>
> Many thanks in advance.
>
> Steve Harvey
>

*
*   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