scatter graph of irregularily spaced data

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

CharlieEVIEWS
Posts: 202
Joined: Tue Jul 17, 2012 9:47 am

scatter graph of irregularily spaced data

Postby CharlieEVIEWS » Tue Jan 06, 2015 4:58 pm

Dear all,

I'm trying to visualise some data. I have one matrix of dimension AxB, and one vector (1xB). I would like to plot a scatter graph, where every element of a column from the matrix is plotted on the y-axis against its fixed corresponding value from the vector. For example, I would like all elements of the second column of the matrix plotted on the y-axis along a vertical line corresponding to an x-axis value corresponding to the second element of the vector.

However, while I'm usually pretty good with visualising data in EViews, I'm unsure as to whether this is even possible (my feeling is that it should be, and probably is), and the problem has generally stumped me.

Any help would be hugely appreciated as always.

Best wishes,

Charlie

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

Re: scatter graph of irregularily spaced data

Postby EViews Gareth » Tue Jan 06, 2015 5:10 pm

The only way to do it is to make a set of two column matrices containing the y and x values of each graph.
Follow us on Twitter @IHSEViews

CharlieEVIEWS
Posts: 202
Joined: Tue Jul 17, 2012 9:47 am

Re: scatter graph of irregularily spaced data

Postby CharlieEVIEWS » Tue Jan 06, 2015 5:29 pm

Sorry for being a bit slow here: I don't quite understand how I'd get the mapping with two column matrices (do you mean a 1xB and the AxB stacked into an (AxB)x1 column?) onto one graph?

What kind of syntax is necessary?

edit: I've found a way to do it in an undated workfile generating NA series and writing a script to fill the corresponding values from the matrix into the series at entries corresponding to the vector, but it's a little cumbersome :oops:

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

Re: scatter graph of irregularily spaced data

Postby EViews Gareth » Tue Jan 06, 2015 5:46 pm

Sorry, I misread the question. Yeah, your way is probably the best.
Follow us on Twitter @IHSEViews

CharlieEVIEWS
Posts: 202
Joined: Tue Jul 17, 2012 9:47 am

Re: scatter graph of irregularily spaced data

Postby CharlieEVIEWS » Tue Jan 06, 2015 8:13 pm

For anyone reading this thread in the future, attached is what the output looks like. If requested, I can send over any code.
Attachments
irregular frequency dot plot example.png
irregular frequency dot plot example.png (10.5 KiB) Viewed 3063 times

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

Re: scatter graph of irregularily spaced data

Postby EViews Glenn » Wed Jan 07, 2015 6:18 am

I'm not 100% certain that I understand the setup, but it seems that all you have to do is to create a matrix of dimension B x (A+1). In the first column of the matrix is your vector. In the remaining columns are the transpose of your original matrix.

Then, if I understand correctly, what you want is to plot, for each row, the first element against the remaining elements of the row. You can do this simply by doing a scatter on the matrix, with the first column against the remaining. That's the default setting, so just choosing scatter should work for you.

CharlieEVIEWS
Posts: 202
Joined: Tue Jul 17, 2012 9:47 am

Re: scatter graph of irregularily spaced data

Postby CharlieEVIEWS » Wed Jan 07, 2015 10:34 am

Thanks Glenn! I didnt realise this was how .scat worked on matrices. It's a far superior solution to mine and allows all of the scatter features (i.e. linefit and others).

Best wishes!

eviews scatter.png
eviews scatter.png (17.22 KiB) Viewed 3028 times


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 1 guest