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]

Re: st: How to change scale of yaxis from proportion with lots of decimals to per 100000


From   roland andersson <[email protected]>
To   [email protected]
Subject   Re: st: How to change scale of yaxis from proportion with lots of decimals to per 100000
Date   Mon, 19 Nov 2012 15:32:28 +0100

I found out that I can edit the individual yaxis labels in Graph Edit.
Roland

2012/11/18 Nick Cox <[email protected]>:
> -y1label()- is I think syntax of your own invention.
>
> -by()- here is an option, not a statement.
>
> Otherwise I think you are right in implying that insisting on
> particular y axis labels clashes with a -rescale- suboption.
>
> I fear that you need to define graphs individually and then -graph combine-.
>
> Nick
>
> On Sun, Nov 18, 2012 at 2:38 PM, roland andersson
> <[email protected]> wrote:
>> Nick
>> I have tried no 3 method. I still have problems. I have made a twoway
>> graph with a by statement which produces 4 graphs with different
>> yscales - no1 is from 0.00005 to 0.00015, no2 is from 0.0005 to
>> 0.0025, no 3 is from 0.01 to 0.04 and no4 from 0.01 to 0.1. I want to
>> multiply all by 100,000.
>> I have individual data for about 2,000,000 infants and want to use the
>> original dataset. I tried the following command
>>
>> twoway fpfitci nec ar,  by( pmatur, rescale legend(off)
>> l1title("Incidence rate per 100,000 live births")) xlabel(1985 1990
>> 1995 2000 2005 2010)  ylabel(0.00005 "5" 0.0001 "10" 0.00015 "15")
>>
>> gives the correct result for one of the graphs. I tried the following
>>
>> twoway fpfitci nec ar,  by( pmatur, rescale legend(off)
>> l1title("Incidence rate per 100,000 live births")  y1label(0.00005 "5"
>> 0.0001 "10" 0.00015 "15") ) xlabel(1985 1990 1995 2000 2005 2010)
>>
>> but got error message that y1label was not allowed.
>>
>> How can I make different ylabels for each graph?
>>
>> Roland
>>
>>
>>
>> 2012/11/16 Nick Cox <[email protected]>:
>>> There are various possible solutions.
>>>
>>> 1. -replace- the variable with itself multiplied by 100000.
>>>
>>> 2. -clonevar- the variable ditto.
>>>
>>> In either case, you will need to change the variable label if you are
>>> like me and put units of measurement in variable labels.
>>>
>>> 3. Stata will accept  e.g. -ylabel(42 "foobar")- and so -ylabel(1
>>> "100,000")- etc.
>>>
>>> 4. A helper command for #3 is -mylabels- (SSC).
>>>
>>> The principles here apply to nonlinear re-scales too. See
>>>
>>> SJ-8-1  gr0032  . . . . . . .  Stata tip 59: Plotting on any transformed scale
>>>         . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
>>>         Q1/08   SJ 8(1):142--145                                 (no commands)
>>>         tip on how to graph data on a transformed scale
>>>
>>> Accessible to all at http://www.stata-journal.com/sjpdf.html?articlenum=gr0032
>>>
>>> Nick
>>>
>>> On Fri, Nov 16, 2012 at 7:47 AM, roland andersson
>>> <[email protected]> wrote:
>>>> I want to make twoway graphs of the trend over time of the incidence
>>>> rate of a rare disease by four groups where this disease varies
>>>> strongly. In one group the disease has changed from 5 to 10 per
>>>> 100,000 live births, in another from 5000 to 10,000 per 100,000 live
>>>> births.
>>>> I want to do the graphs by(groups). My problem is that the yscale
>>>> shows the proportion with lots of decimals, eg 0.00005. I want to
>>>> multiply the yscale with 100,000 so that it shows the number per
>>>> 100,000 live births instead of the proportion with decimals. How can I
>>>> do it?
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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