User’s Guide : EViews Fundamentals : Working with Data (Advanced) : Date Series
Date Series
Creating a Date Series
Displaying a Date Series
Editing a Date Series
A date series is a standard EViews numeric series that contains valid date values (see “Dates”). There is nothing that distinguishes a date series from any other numeric series, except for the fact that the values it contains may be interpreted as dates.
Creating a Date Series
There is nothing special about creating a date series. Any method of creating an EViews series may be used to create a numeric series that will be used as a date series.
Displaying a Date Series
The numeric values in a date series are generally of interest only when performing calendar operations. For most purposes, you will wish to see the values of your date series as date strings.
For example, the following series QDATES in our quarterly workfile is a numeric series containing valid date values for the start of each quarter. The numeric values of QDATES depicted here show the number of days since 1 January A.D. 1.
Obviously, this is not the way that most people will wish to view their date series. Accordingly, EViews provides considerable control over the display of the date values in your series. To change the display, click on the Properties button in the series toolbar, or select View/Properties... from the main menu.
EViews will display a dialog prompting you to change the display properties of the series. While you may change a variety of display settings such as the column width, justification, and indentation, here, for the moment, we are more interested in setting the properties of the Numeric Display.
For a date series, there are four settings of interest in the Numeric Display dropdown menu (Period, Day, Day-Time, and Time), with each corresponding to specific information that we wish to display in the series spreadsheet. For example, the Day selection allows you to display date information up to the day in various formats; with year, month, and day all included in the representation.
Let us consider our quarterly workfile example. Here we have selected Period and chosen a specific Date format entry (“YYYY[Q]Q”), which tells EViews that you wish to display the year, followed by the “Q” separator, and then the quarter number. Note also that when Period is selected, there is a Current Workfile setting in the Date format dropdown menu which tells EViews to use the current workfile display settings.
The two checkboxes below the Date format dropdown menu may be used to modify the selected date format. If you select Two digit year, EViews will only display the last two-digits of the year (if the selected format is “YYYY[Q]Q”, the actual format used will be “YY[Q]Q”); if you select Day/month order, days will precede months in whichever format is selected (if you select “mm/dd/YYYY” as the format for a day display, EViews will use “dd/mm/YYYY”).
Applying this format to the QDATES series, the display changes to show the data in the new format:
If instead we select the Day display, and choose the “YYYY-MM-DD” format, the QDATES spreadsheet will show:
There is one essential fact to remember about the QDATES series. Despite the fact that we have changed the display to show a text representation of the date, QDATES still contains the underlying numeric date values. This is in contrast to using an alpha series to hold a text representation of the date.
If you wish to convert a (numeric) date series into an alpha series, you will need to use the @datestr function. If you wish to convert an alpha series into a numeric date series, you will need to use the @dateval function. See “Translating between Date Strings and Date Numbers” for details.
Editing a Date Series
You may edit a date series either by either date numbers, or if the series is displayed using a date format, by entering date strings directly.
Suppose, for example, that we have our date series from above and that we wish to change a value. If we are displaying the series with date formatting, we may enter a date string, which EViews will automatically convert into a date number.
For example, we may edit our QDATES series by entering a valid date string (“April 10, 1992”), which EViews will convert into a date number (727297.0), and then display as a date string (“1992-04-10”). See “Free-format Conversion” for details on automatic translation of strings to date values.
Note, however, that if we were to enter the same string value in the series when the display is set to show numeric values, EViews will not attempt to interpret the string and will enter an NA in the series.