Correctly Displaying Dates on Graphs

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

ev_ns
Posts: 4
Joined: Sat Apr 02, 2011 7:57 am

Correctly Displaying Dates on Graphs

Postby ev_ns » Sat Apr 02, 2011 8:09 am

I've scoured the eviews documentation, but haven't managed to figure out how to solve my problem.

I have a data series of irregular dates. The dates are formatted YYYY MM DD and I want to display the series as a histogram by month. I transfer the data from the original format into a series of YYYY[m}MM and then graph. However, the axis is labeled with eviews computer numbers--not dates. What I want is for the axis to be labeled by month and year, preferably YYYY[m}MM, but anything that display the month would be fine. There must be a way to fix this...?

Screenshots below:
ev1.JPG
ev1.JPG (92.71 KiB) Viewed 6030 times
ev2.JPG
ev2.JPG (28.35 KiB) Viewed 6030 times

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

Re: Correctly Displaying Dates on Graphs

Postby EViews Glenn » Mon Apr 04, 2011 9:37 am

The issue is that what you want really isn't a histogram, it's a bar chart of frequencies by month/year. Histograms, by definition, are supposed to cut the real line into bins and compute things based on frequencies in the bin. The real line, in this case is the date numbers underlying your dates...so that's what you get with a histogram, even though it's not what you want.

What you should be able to do is to convert these data into something that can be bar graphed. This should be pretty straightforward. Try the following.

First, open your DATE_RESOLVED series, click on the view menu and select One-way tabulation. Uncheck the Show Percentages and Show Cumulatives boxes on the left hand side and uncheck both of the grouping boxes on the right-hand-side of the dialog. Click on OK to display the view.

Next, highlight the relevant part of the table (dates and frequencies) and press CTRL-C (or right-mouse click, and select Copy). Move your cursor to anywhere on the EViews desktop, and right-mouse click, the select Paste as new workfile). You should just be able to click on Finish to create a new workfile.

You should have a new irregular dated workfile. SERIES01 should contain your dates, and SERIES02 should contain the frequencies. The workfile should be structured using SERIES01 to indicate the dates. Rename SERIES02 to DATE_RESOLVED, open it, then select [bGraph/Bar[/b]. That should do it.

ev_ns
Posts: 4
Joined: Sat Apr 02, 2011 7:57 am

Re: Correctly Displaying Dates on Graphs

Postby ev_ns » Wed Apr 06, 2011 12:18 am

Thanks Glenn! I followed your instructions, and the graph IS displaying the information I want. But, I am still failing to understand how to use series1 as the x axis...?
ev3.JPG
ev3.JPG (29.51 KiB) Viewed 6006 times

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

Re: Correctly Displaying Dates on Graphs

Postby EViews Glenn » Wed Apr 06, 2011 10:00 am

Structure your workfile page as an irregular dated using SERIES01, then display the graph.

ev_ns
Posts: 4
Joined: Sat Apr 02, 2011 7:57 am

Re: Correctly Displaying Dates on Graphs

Postby ev_ns » Wed Apr 06, 2011 10:03 pm

Thank you for your patience, Glenn.

Pasting the data in as a new workfile, I denominate Series01 as a "Date Type: Dated." In step four, I then select "Dated -- specified by dated series." I specify "Series01" as the Dated series. This returns the error "Repeated values found in source id series."

The data was originally input in the format YYYYMMDD. I had eviews change the date structure to YYYY{m}MM but, of course, the original structure remained in the file. So, when the data is tabulated, there are multiple repeated YYYY[m]MM in the series. For instance, if datapoint #1 was 2005/01/02 and the second point was 2005/01/04, when transformed this creates two datapoints that both read 2005m01. I assume this is the cause of the error listed above. Alternatively, I could be missing something obvious.

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

Re: Correctly Displaying Dates on Graphs

Postby EViews Glenn » Thu Apr 07, 2011 11:07 am

The original date structure shouldn't matter. The one-way tabulation should have reduced to unique values. What was the left-hand screen-shot of your series depicting and how did you end up with the right-hand shot?

ev_ns
Posts: 4
Joined: Sat Apr 02, 2011 7:57 am

Re: Correctly Displaying Dates on Graphs

Postby ev_ns » Sun Apr 10, 2011 11:32 pm

Left hand shot is showing when court cases were filed, inputted values are Month DD, year.
The right hard shot was created by going into the properties, and changing the "Date Format." I assume that eviews still keeps the original dates and ends up tabulating by day rather than by month... at least, that is what appears to have happened.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests