|
|
|
|
|
|
時系列分析ソフトウェア
RATS |
|
3-1. RATS Basics: Defining Your Data Set
In our example program, we want to read in some data, create a couple of new series, run some OLS regressions, and compute forecasts. The first step in any program that uses data series is to describe the data set to RATS, using the instructions CALENDAR and ALLOCATE.
CALENDAR sets the dating scheme and specifies the starting date for the data. ALLOCATE sets the default length of the data series (the CALENDAR instruction is omitted when using cross-sectional data).
Our Example Program
We'll be working with a short annual dataset, which begins in 1922 and runs through 1941, so we start with the following instructions:
CALENDAR 1922
ALLOCATE 1941:1
The first line tells RATS that we'll be using annual data starting in 1922. The second line indicates that 1941 is the default ending period for our data. Date references in RATS take the form of year:period (for annual, monthly, quarterly data) or year:month:day (most other frequencies). For annual data, the period value is always 1, since there is only one period per year.
Other Frequencies
RATS supports virtually any time series frequency, including annual, semi-annual, monthly, quarterly, weekly, and daily, as well as panel data (pooled cross section time series data) and daily data with multiple observations per day. Here are a few other CALENDAR and ALLOCATE examples:
Monthly data, from February, 1965 through December, 1995:
CALENDAR 1965 2 12
ALLOCATE 1995:12
Daily data (Mondays through Fridays only), from January 2nd, 1995 through December 29th, 1995:
CALENDAR(DAILY) 1995 1 2
ALLOCATE 1995:12:29
As above, but seven days per week:
CALENDAR(SEVENDAY) 1995 1 2
ALLOCATE 1995:12:29
Data with 24 periods per year, starting in 1950:
CALENDAR 1950 1 24
ALL 1995:24
|
|
|
←RATSのTopページに戻る |
|
|