Statalist


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

RE: st: RE: AW: RE: axis(1) and axis(2) scales in graphs


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: AW: RE: axis(1) and axis(2) scales in graphs
Date   Thu, 28 Jan 2010 12:43:01 -0000

Although I've not tried, it doesn't sound as difficult as you imply. You could divide by the standard deviation of the values, or any other appropriate measure of spread, for example. 

Nick 
[email protected] 

Leandro Brufman

Thanks for your answers, the problem has been solved.
I don't think the solution proposed by Nick could make the problem
simpler. I am repeating the same graph for different countries, so the
and the scale of the variables changes a lot from country to country
(gdp growth is usually between -10 and 10 percent for every country,
while nominal exchange rate change ranges from -50 to 400 percent. In
order to implement solution I should divide one of the series by a
constant, and that constant should be different for each country. I
should first decide the magnitude of the constant for each country,
etc.


On Tue, Jan 26, 2010 at 12:09 PM, Nick Cox <[email protected]> wrote:
>
> I certainly understood that Leandro wants zeros on two axes to be
> aligned.
>
> What I didn't (don't) understand why that is problematic in Stata when
> there are solutions of (1) just plot data as they come (2) divide one
> series by a constant so it's comparable with the other. I wouldn't even
> touch the range sub-option.
>
> Nick
> [email protected]
>
> Martin Weiss
>
> " I am not completely clear what the problem is"
>
> Actually, I found the problem exceptionally clear in this case:
>
> *************
> clear*
> set seed 123456
> set obs 100
> gen time=_n
> gen serieA=rnormal()
> gen serieB=rnormal(1,2)
> tw (line serieA time, yaxis(1) yli(0)) (line serieB time, yaxis(2))
> *************
>
> I just did not know how to align the zero point on the left and right
> axis,
> to be honest...
>
> Nick Cox
>
> I am not completely clear what the problem is, but it seems that just
> dividing one series by some constant might be simpler for you.
>
> Is either series ever negative?
>
> Nick
> [email protected]
>
> Leandro Brufman
>
> I am doing a -graph twoway line- with depicting two series over time
> with different axis
> - graph twoway (line serieA time, yaxis(1)) (line serieB time, yaxis(2))
> -
>
> I would like to have both axis(1) and axis(2) with the same "zero
> level".  That is, I would like both axis to be zero at the exact same
> point in the graph.
> I am repeating this graph for many samples, so fiddling with -range
> suboptions- is not very helpful.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index