RATS 10.1
RATS 10.1

Functions /

Entry Number, Date, and Panel Data Functions

Home Page

← Previous Next →

RATS includes a perpetual calendar which is valid for dates from 1800 on. (Validity for historical data depends upon when the Gregorian calendar was adopted in a given area.) There are quite a few functions which allow you to make use of this. The first group of these analyze the date information for entries (E argument) in the current CALENDAR setting. A second group looks directly at year:month:day (Y,M,D arguments). Some of the functions take a day of the week as an argument, or return day of the week information. This is coded as 1=Monday to 7=Sunday.

 

The "Julian" functions are all based upon a day numbering scheme which starts at a theoretical extension of the Gregorian calendar back to Jan 1, 0001.

 

%allocend()

Default workspace length

%cal(year,period)

Entry number of specified date

%calendar()

Returns the current CALENDAR setting

%closestdate(y,m,d,dow)

Observance date for y:m:d (closest day of week)

%closestweekday(y,m,d)

Observance date for y:m:d (closest Monday–Friday)

%dateandtime()

Current date and time

%datelabel(t)

Date label for a given date/entry number

%day(t)

Day of month for entry T

%daycount(t)

Number of days in entry T

%dow(y,m,d)

Day of week for given date

%easter(y,m,d)

Dates after March 23rd for (Western) Easter

%floatingdate(y,m,dow,n)

Day of month for floating holiday

%indiv(t)

Individual within a panel set

%julian(t)

Number of (theoretical) days from Jan 1, 0001 to entry T in the current CALENDAR scheme.

%julianfromcoded(x,c)

Number of (theoretical) days from Jan 1, 0001 to the date coded as a real number like 19700530.

%julianfromymd(y,m,d)

Number of (theoretical) days from Jan 1, 0001 to the date described using separate year, month and day values.

%month(t)

Month number (1–12) of entry T

%panelobs()

Size of panel data time dimension

%panelsize()

Size of panel data individual dimension

%period(t)

Period within a panel set

%regend()

Ending entry of most recent regression

%regstart()

Starting entry of most recent regression

%today()

Today’s entry

%tradeday(t,d)

Number of occurrences of day D in period T

%weekday(t)

Day of week of entry T

%year(t)

Year number


Copyright © 2025 Thomas A. Doan