Graphing ranges and positions for cross section data

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

Tatha
Posts: 39
Joined: Thu May 21, 2009 2:55 pm

Graphing ranges and positions for cross section data

Postby Tatha » Wed Aug 14, 2013 11:07 am

Hello All,

I’m a long time Eviews user, but mainly deal with time series data. This time, however, I am attempting to create a graph using cross section data – so would appreciate any help you can give.

What would be the easiest way to graph the following: there are 5 variables on which say 30 countries are being ranked; each country has to have its own graph in which the 5 variable names appear on the x-axis, the y-axis shows a line/spike/bar which denotes the entire (min-max) range of that variable in the sample of 30 and then superimposes the specific country’s data value within that range using a dot/symbol. Additionally, the 5 dots for the 5 variables need annotations next to them (which label the data value).

I would then loop through a set of countries and plot where each country features (relative to sample range) on the 5 attributes.

Before I embark on writing a program, I wanted to get a prelim feedback from the experts whether they think that this can be achieved in Eviews or whether one or other problem will become insurmountable.

Best regards, Tatha

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

Re: Graphing ranges and positions for cross section data

Postby EViews Gareth » Wed Aug 14, 2013 11:23 am

I can't really visualise what you're asking. But can't you just put the series in a group, graph the group, then set the sample to each observation.

Tatha
Posts: 39
Joined: Thu May 21, 2009 2:55 pm

Re: Graphing ranges and positions for cross section data

Postby Tatha » Wed Aug 14, 2013 11:46 am

Hi Gareth,

It’s a bit similar to what the Eviews manual shows under categorical plots (box plot option). The range of sample variation is plotted like a bar, and within that bar, a symbol is plotted to show where a country lies on the range of variation.

Or, one can visualise a open-low-close type graph that is used on time series, only I need that style within cross section data. And, I definitely need the ability to annotate the data value on such a chart.

I can email you an example achieved by hand in Excel, but maybe you get the drift already...

Thanks
Tatha

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

Re: Graphing ranges and positions for cross section data

Postby EViews Gareth » Wed Aug 14, 2013 11:47 am

Just attach the image of the graph you want to the forum.

Tatha
Posts: 39
Joined: Thu May 21, 2009 2:55 pm

Re: Graphing ranges and positions for cross section data

Postby Tatha » Wed Aug 14, 2013 12:33 pm

Hi,

Here is an example for any 1 country in a sample. I need to generate it using command language for, say, 30 countries. Those orange bars would be the same in all charts (that's range of entire sample), but the green dots would move relative to the range as you change the country.

Thanks
Tatha.png
Sample graph
Tatha.png (35.57 KiB) Viewed 12142 times

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

Re: Graphing ranges and positions for cross section data

Postby EViews Gareth » Wed Aug 14, 2013 1:27 pm

I don't think that type of graph would be possible.

Tatha
Posts: 39
Joined: Thu May 21, 2009 2:55 pm

Re: Graphing ranges and positions for cross section data

Postby Tatha » Wed Aug 14, 2013 2:27 pm

Ok, still thanks for having a look Gareth.

Tatha
Posts: 39
Joined: Thu May 21, 2009 2:55 pm

Re: Graphing ranges and positions for cross section data

Postby Tatha » Thu Aug 15, 2013 2:45 am

I guess the simple trick that would solve my problem would be the ability to 'layer' (e.g. ggplot in R) or superimpose (e.g. Mathematica) graphs in the multiple graph function. Then I would just do a spike chart for the range, and a line chart for the data-points separately, then show them layered/superimposed. Maybe worth adding to the wish list?

Tatha
Posts: 39
Joined: Thu May 21, 2009 2:55 pm

Re: Graphing ranges and positions for cross section data

Postby Tatha » Thu Aug 15, 2013 3:49 am

Actually, I can do it now. the command:

spike(l) x y

works on cross section data as usual. Then I change the line graph to show only symbol (this generates the green data points).

Tatha
Posts: 39
Joined: Thu May 21, 2009 2:55 pm

Re: Graphing ranges and positions for cross section data

Postby Tatha » Thu Aug 15, 2013 4:16 am

I guess I'm still finding myself unable to display the data value next to the points, or any way of annotating data labels next to the points in a programmatic way....

Is there a way around this?

Tatha
Posts: 39
Joined: Thu May 21, 2009 2:55 pm

Re: Graphing ranges and positions for cross section data

Postby Tatha » Thu Aug 15, 2013 4:23 am

Finally, I can work around this by using the addtext command with specific coordinates.


Return to “Data Manipulation”

Who is online

Users browsing this forum: EViews Gareth and 2 guests