Page 1 of 1

XY Line where first series is an alpha

Posted: Sat Sep 13, 2014 2:10 pm
by startz
Suppose you make a group where the first object is an alpha and the rest are numerical series. Then you make an XY line graph. What should happen?

What I was hoping for was that the graph would use the first series as labels. (It would certainly be nice if it did.) What seems to happen is that you get a blank graph. I'm not sure if that's a bug, the intended behavior, no behavior is defined, or user error. Look at group02 in the attached.
Clipboard01.png
Clipboard01.png (7.06 KiB) Viewed 6938 times

Re: XY Line where first series is an alpha

Posted: Sat Sep 13, 2014 9:15 pm
by EViews Gareth
Intended behavior. The alpha is a series full of NAs, which makes a boring graph

Re: XY Line where first series is an alpha

Posted: Sun Sep 14, 2014 8:01 am
by startz
So is there another way to achieve the intended behavior? Excel is willing to
Experienced teacher salaries relative to starting.png
Experienced teacher salaries relative to starting.png (10.95 KiB) Viewed 6921 times

Re: XY Line where first series is an alpha

Posted: Sun Sep 14, 2014 3:43 pm
by EViews Gareth
Define the expected behaviour.

Re: XY Line where first series is an alpha

Posted: Sun Sep 14, 2014 3:48 pm
by startz
Use the observation number for the x-axis, but label the x-axis using the first series rather than the observation number.

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 8:15 am
by EViews Gareth
With your group open, run this:

Code: Select all

d(noerr) temp d(noerr) tempgr %spec = _this.@members %drop = @word(%spec,1) group temp {%spec} temp.drop {%drop} freeze(tempgr) temp.line tempgr.setobslabel(series) {%drop} _this.display tempgr d temp tempgr

I created some data with the following and ran it:

Code: Select all

create u 4 alpha label smpl 1 1 label = "Starting" series us = 100 series oecd=100 series canada = 100 series finland = 100 series korea=100 smpl 2 2 label = "10 years" series us = 123 series oecd=140 series canada = 150 series finland = 122 series korea=150 smpl 3 3 label = "15 years" series us = 136 series oecd=140 series canada = 155 series finland = 128 series korea=160 smpl 4 4 label = "maximum" series us = 150 series oecd=140 series canada = 155 series finland = 140 series korea=275 smpl @all group g label us oecd canada finland korea show g

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 10:06 am
by startz
Wow, really nice.

Is there a gui way to setobslabel to do this manually?

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 10:20 am
by EViews Gareth
Yep

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 10:24 am
by startz
Oh. So is the trick to make a line graph ignoring the label series, and then stick in the labels???

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 10:40 am
by EViews Gareth
Right.

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 11:57 am
by startz
Not in may case, but I can see where that could be an issue.

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 11:58 am
by EViews Glenn
[edit]I previously asked whether there were any repeats in the alpha series which Startz responded to, just as I saw the posted workfile. I then deleted my earlier post so that I could post the following (sorry about the confusion).

In this case, I think there's a better approach. You have one label per observation with no repeats so I think that what you really want to do is to use the alpha series to label observations. In such a setting, I believe that

Code: Select all

pagestruct tenure group group03 us oecd canada finland korea group03.line
would seem to give you want you want.

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 2:26 pm
by startz
Thanks Glenn. Gareth's setobslabel "trick" avoids having to restructure the page. Any advantages or disadvantages one way or the other?

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 3:45 pm
by EViews Glenn
If the alpha are truly obs identifiers, then it's probably better to restructure since everywhere you have obs labels, we'll use them (as in the spreadsheet view, etc.).

Re: XY Line where first series is an alpha

Posted: Mon Sep 15, 2014 4:05 pm
by startz
Got it.