経済学書専門出版 エコノミスト社
Top書籍情報計量経済・統計ソフトウェアRATSReading In Data
ファイナンス大系
リアルオプション
Excelとその応用
統計学大系
経済学大系
e-ビジネス
計量経済学
ゲーム理論
経済数学
環境問題・環境経済学
人口学講座
ナレッジマネジメント
ビジネス書
NLP理論
複雑系経済学
経営学・商学大系
マーケティング
心理学・行動科学大系
金融工学・数理ファイナンス
マクロ経済学
法情報学
企業法学講座
経営工学大系
計量経済・統計ソフトウェア
オペレーションズ・リサーチ
会計学・簿記・税務
楽しい数学
時系列分析ソフトウェア
RATS

3-2. RATS Basics: Reading In Data


Now we need to read our data from a disk file into memory. We do that with the OPEN DATA and DATA instructions. OPEN DATA specifies the name of the file containing the data, while DATA actually does the work of reading the data from the file.


Our Example Program
After adding the appropriate OPEN DATA and DATA instructions, our example program looks like this:

CALENDAR 1922
ALLOCATE 1941:1
OPEN DATA C:\RATS\FOODDATA.RAT
DATA(FORMAT=RATS) / FOODCONS PRRETAIL DISPINC FOODPROD PRFARM


In this case, our data is stored on a RATS format file called FOODDATA.RAT, located in the directory C:\RATS. FOODCONS, PRRETAIL, etc., are the names of the series we want to read in (consumption of food products, retail prices, etc.).


Other File Formats
RATS format is specially designed to handle time series data. You may find it convenient to convert your data to RATS format, but it's certainly not required, because RATS can read data directly from many other types of files, including text files, WKS or Excel spreadsheets, dBase files, and MicroTSP files. You can also write data to any of these file formats using the COPY instruction.

Here's how you would read the same data set from a WKS format file and a free-format (comma, tab, or space delimited) text file, respectively:

OPEN DATA FOODDATA.WKS
DATA(FORMAT=WKS,ORG=OBSERVATION)

OPEN DATA FOODDATA.DAT
DATA(FORMAT=FREE,ORG=OBSERVATION) / FOODCONS PRRETAIL DISPINC FOODPROD PRFARM


Converting Data Frequencies
The DATA instruction provides many options for automatically converting data from a higher frequency to a lower frequency, including taking averages, sums, or geometric means, or selecting particular subperiods. For example, you could convert monthly data to quarterly data by taking averages, or by taking the value of the third month of each quarter. RATS also includes two procedures for interpolating low frequency data to a higher frequency.


←3-1. Defining Your Data Set →3-3. Examining The Data


←RATSのTopページに戻る