Page 1 of 1

Categorical graphs

Posted: Wed Jan 27, 2010 12:34 pm
by javiersan
Hi,

I have a group of time series and I want to do a categorical bar chart where each category is defined by the series

group g1 x y z w

Manually, when I click on the group, select graph, bar and categorical chart the chart created comes as I want it. However, I am not sure about the command for plotting this and the help is not very clear.

If I use
g1.bar(contract=raw)

EViews shuts down (well, the option "raw" doesn't exist but it is the closest to the options in the graph menu).

Could you please help?

Thanks,

Javier

Re: Categorical graphs

Posted: Wed Jan 27, 2010 3:06 pm
by EViews Pamela
You can define a categorical graph using the "within" and "across" keywords. For instance,

g1.bar within(s1)

Note that if you do not define an across or within series in the dialog, it will produce a standard graph even though you have selected Categorical graph in the dropdown.

Re: Categorical graphs

Posted: Wed Jan 27, 2010 4:50 pm
by javiersan
Thanks Pamela, g1.bar within() did work.

I have now 4 charts in one and they have as legend the series name, is there a way I can do two things (i) change the labels without changing the name of the series and (ii) change individual charts axis range?

Thanks,

Javier

Re: Categorical graphs

Posted: Wed Jan 27, 2010 6:44 pm
by EViews Pamela
To change the legend text, use the "legend" option with the "setelem" command. For instance, to modify the second series:

graph01.setelem(2) legend("new_text")

You may use the "axis" command to set the data endpoints for all graphs simultaneously:

graph01.axis range(-2,2)

Pamela

Re: Categorical graphs

Posted: Thu Jan 28, 2010 2:44 am
by javiersan
Unfortunately it doesn't seem to work for me.

None of the two options below work:

group g1 x y z w
g1.bar within()
g1.setelem(1) Series x '<------ this gives an error

group g1 x y z w
freeze(g1_chart) g1.bar within()
g1_chart.setelem(1) Series x '<------- this doesn't show anything

Other options for the 'freeze' chart work such as addtext or align.

Any clues why?

Thanks,

Javier

Re: Categorical graphs

Posted: Thu Jan 28, 2010 2:45 am
by javiersan
Correction: I meant .setelem(1) legend("Series x")

Re: Categorical graphs

Posted: Thu Jan 28, 2010 12:33 pm
by EViews Pamela
The setelem command should be used with a graph. So it is true that group01.setelem will not work; you will need to freeze the graph first and use graph01.setelem.

graph01.setelem(1) legend("legendtext") should change the legend text.

Also, let me emphasize that if you do not specify an across or within series, you are not really getting a categorical graph.