Page 1 of 1

scatter graph of irregularily spaced data

Posted: Tue Jan 06, 2015 4:58 pm
by CharlieEVIEWS
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

Re: scatter graph of irregularily spaced data

Posted: Tue Jan 06, 2015 5:10 pm
by EViews Gareth
The only way to do it is to make a set of two column matrices containing the y and x values of each graph.

Re: scatter graph of irregularily spaced data

Posted: Tue Jan 06, 2015 5:29 pm
by CharlieEVIEWS
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:

Re: scatter graph of irregularily spaced data

Posted: Tue Jan 06, 2015 5:46 pm
by EViews Gareth
Sorry, I misread the question. Yeah, your way is probably the best.

Re: scatter graph of irregularily spaced data

Posted: Tue Jan 06, 2015 8:13 pm
by CharlieEVIEWS
For anyone reading this thread in the future, attached is what the output looks like. If requested, I can send over any code.

Re: scatter graph of irregularily spaced data

Posted: Wed Jan 07, 2015 6:18 am
by EViews Glenn
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.

Re: scatter graph of irregularily spaced data

Posted: Wed Jan 07, 2015 10:34 am
by CharlieEVIEWS
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 7821 times