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: Changing the scale of a graph


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: Changing the scale of a graph
Date   Fri, 8 Jun 2012 11:28:22 -0400

Nick--
Hard to know what the poster means by excessive white space, but
perhaps the desideratum is an approximate 45 degree angle in one of
the series, which can be achieved by many means e.g. by changing the
aspect ratio or the range on the x axis.

clear
input high low quarter7
.2958866 .236993                               -6
.2957524 .230218                               -5
.2953402 .2316445                              -4
.3119317 .2338386                              -3
.3281921 .2446502                              -2
.3232706 .2491048                              -1
.3490512 .2641283                              0
end
scatter high low quarter7
scatter high low quarter7, c(l l) xsize(2) ysize(5) name(aspect)
scatter high low quarter7, c(l l) xla(-15/10) name(xaxis)


On Thu, Jun 7, 2012 at 7:12 AM, Nick Cox <[email protected]> wrote:
> From this I can do this
>
> clear
> input high low quarter7
> .2958866 .236993                               -6
> .2957524 .230218                               -5
> .2953402 .2316445                              -4
> .3119317 .2338386                              -3
> .3281921 .2446502                              -2
> .3232706 .2491048                              -1
> .3490512 .2641283                              0
> scatter high low quarter7
>
> and I can't see any problem with that kind of graph. What am I missing about your question may be more obvious to economists.
>
> Nick
> [email protected]
>
> sebas nicaise
>
> I have generated a variable that determines the relative quarters to a specific event :
>  gen byte quarter7=0 if newviol==1
>  replace quarter7=-7 if F7.newviol==1
>  replace quarter7=-6 if F6.newviol==1
>  replace quarter7=-5 if F5.newviol==1
>  replace quarter7=-4 if F4.newviol==1
>  replace quarter7=-3 if F3.newviol==1
>  replace quarter7=-2 if F2.newviol==1
>  replace quarter7=-1 if F.newviol==1
>
> Subsequently, I computed the median leverageratio for 2 groups (firms in competitive and non competitive industries)
> by quarter7, sort : egen float medianleverageratiolow = median(leverageratiolow)
> by quarter7, sort : egen float medianleverageratiohigh = median(leverageratiohigh)
>
> Subset of data looks like this:
> medianleverageratiohigh medianleverageratiolow quarter7
> .2334801 .1243232                              .
> .2334801 .1243232                              -7
> .2958866 .236993                               -6
> .2957524 .230218                               -5
> .2953402 .2316445                              -4
> .3119317 .2338386                              -3
> .3281921 .2446502                              -2
> .3232706 .2491048                              -1
> .3490512 .2641283                              0
> .2334801 .1243232                              .
> .2334801 .1243232                              .
> .2334801 .1243232                              .
>
> Nick
>
>> Can you give us a subset of your data that can be entered
>> interactively to give us a chance of seeing what you mean?
>
> On Thu, Jun 7, 2012 at 10:50 AM, sebas nicaise <[email protected]> wrote:
>
>> > That is not what I mean, I want the graph to show the reader the increase in leverage ratio up to a certain event, with the current graph this is not clearly visible.
>> >
>> > ----------------------------------------
>> >> Date: Thu, 7 Jun 2012 10:37:08 +0100
>> >> Subject: Re: st: Changing the scale of a graph
>> >> From: [email protected]
>> >> To: [email protected]
>> >>
>> >> If this is a characteristic of the data, I don't understand your
>> >> complaint. If there are values near 0.2, the graph extends to show
>> >> them.
>> >>
>> >> On Thu, Jun 7, 2012 at 10:24 AM, sebas nicaise <[email protected]> wrote:
>> >> > Yes the y-axis grid shows the intervals 0.20 0.21 0.22 ... 0.35 but leaves alot of white space at the bottom. Therefore, the scatter looks the same as it did without the ylabel constraint but with different intervals.
>> >> >
>> >> > ----------------------------------------
>> >> >> Date: Thu, 7 Jun 2012 10:16:56 +0100
>> >> >> Subject: Re: st: Changing the scale of a graph
>> >> >> From: [email protected]
>> >> >> To: [email protected]
>> >> >>
>> >> >> Sounds good then, or is there still a problem?
>> >> >>
>> >> >> Nick
>> >> >>
>> >> >> On Thu, Jun 7, 2012 at 10:12 AM, sebas nicaise <[email protected]> wrote:
>> >> >>
>> >> >> > I typed the command: scatter medianleverageratiohigh medianleverageratiolow quarter7, ylabel(0.20(0.01)0.35)
>> >> >> >
>> >> >> > When I plot the original graph,scatter medianleverageratiohigh medianleverageratiolow quarter7, I do not have any outliers. Al values(points) are between 0.20 and 0.35.
>> >> >> >
>> >> >>
>> >> >> Nick Cox
>> >> >>
>> >> >> >> You are not giving the Stata command you typed or telling us much about your data.
>> >> >> >>
>> >> >> >> There must be a reason why you get a lot of white space. Most obviously one or more outlier(s) need to be accommodated. As already emphasised in this thread, whatever you do to -ysc()- or -yla()- will not cause data to be omitted.

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index