XY Line where first series is an alpha

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

XY Line where first series is an alpha

Postby startz » Sat Sep 13, 2014 2:10 pm

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 6933 times
Attachments
ed at a glance salary paths.WF1
(28.58 KiB) Downloaded 244 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: XY Line where first series is an alpha

Postby EViews Gareth » Sat Sep 13, 2014 9:15 pm

Intended behavior. The alpha is a series full of NAs, which makes a boring graph

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: XY Line where first series is an alpha

Postby startz » Sun Sep 14, 2014 8:01 am

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 6916 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: XY Line where first series is an alpha

Postby EViews Gareth » Sun Sep 14, 2014 3:43 pm

Define the expected behaviour.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: XY Line where first series is an alpha

Postby startz » Sun Sep 14, 2014 3:48 pm

Use the observation number for the x-axis, but label the x-axis using the first series rather than the observation number.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: XY Line where first series is an alpha

Postby EViews Gareth » Mon Sep 15, 2014 8:15 am

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

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: XY Line where first series is an alpha

Postby startz » Mon Sep 15, 2014 10:06 am

Wow, really nice.

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: XY Line where first series is an alpha

Postby EViews Gareth » Mon Sep 15, 2014 10:20 am

Yep
Attachments
2014-09-15_101837.png
2014-09-15_101837.png (30.73 KiB) Viewed 6887 times

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: XY Line where first series is an alpha

Postby startz » Mon Sep 15, 2014 10:24 am

Oh. So is the trick to make a line graph ignoring the label series, and then stick in the labels???

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: XY Line where first series is an alpha

Postby EViews Gareth » Mon Sep 15, 2014 10:40 am

Right.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: XY Line where first series is an alpha

Postby startz » Mon Sep 15, 2014 11:57 am

Not in may case, but I can see where that could be an issue.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: XY Line where first series is an alpha

Postby EViews Glenn » Mon Sep 15, 2014 11:58 am

[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.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: XY Line where first series is an alpha

Postby startz » Mon Sep 15, 2014 2:26 pm

Thanks Glenn. Gareth's setobslabel "trick" avoids having to restructure the page. Any advantages or disadvantages one way or the other?

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: XY Line where first series is an alpha

Postby EViews Glenn » Mon Sep 15, 2014 3:45 pm

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.).

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: XY Line where first series is an alpha

Postby startz » Mon Sep 15, 2014 4:05 pm

Got it.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest