Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Graph with varying scales using by() option

    I have data on emissions changes across states over time. The emissions are normalized as a percent change from the first year of the data set. The percent changes across states are considerably different (some hovering near zero change for the entire period, while others see fluctuations of ~200 percent). When I create a line graph for changes in emissions over time by state using the by() option, states with smaller percent changes appear nearly flat. Is there a way to create line graphs using the by() option that allows for different yscales for each graph?

  • #2
    You can use the yrescale option. See #2 in this post: https://www.statalist.org/forums/for...n-xtline-plots and the helpfile for the by option: https://www.stata.com/manuals13/g-3by_option.pdf

    "rescale, yrescale, and xrescale (and norescale, noyrescale, and noxrescale) specify that the scales of each graph be allowed to differ (or forced to be the same). Whether X or noX is the default is determined by style(). Usually, noX is the default and rescale, yrescale, and xrescale are the options. By default, all the graphs will share the same scaling for their axes. Specifying yrescale will allow the y scales to differ across the graphs, specifying xrescale will allow the x scales to differ, and specifying rescale is equivalent to specifying yrescale and xrescale."
    Last edited by Ali Atia; 22 Jan 2021, 08:02.

    Comment


    • #3
      Unfortunately the hard problem is that varying the scale does not necessarily make comparison more effective.

      It's non-standard, but a cube root scale worked well for me in a problem with many small changes and a few very large changes, some positive and some negative in each case.

      Much depends also on how many "states" there are, e.g. whether that means say 6 countries or 50 states of the United States.

      Comment

      Working...
      X