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

3-4. RATS Basics: Data Transformations


Most work with RATS will involve at least a few data transformations. These are usually done with the SET instruction, although RATS also provides several specialized instructions for various common transformations. The possibilities are nearly endless, so we'll just cover a few simple examples here.


Our Example Program
For our example, we need to create a linear time trend series and a series containing the two-period moving averages of farm prices. The instruction below uses a special reserved variable (T) to set entry 1 of TREND to 1.0, entry 2 of TREND to 2.0, and so on:

SET TREND = T

To create our average, we do:

SET AVGPRICES = (PRFARM+PRFARM{1})/2.0

The notation {1} indicates a one period lag, so this sets each entry of AVGPRICES equal to the sum of the current entry and one-period lag of PRFARM, divided by 2.


Other Transformations
Here are some other common transformations:

Two different ways of taking the first-difference of Y:

SET DY = Y - Y{1}
DIFF Y / DY

Two ways of taking the natural log of X:

SET LX = LOG(X)
LOG X / LX

This uses logical expressions to create a dummy variable. WARTIME will be equal to 1 for the years 1942 through 1946, and 0 elsewhere:

SET WARTIME = T>=1942:1.AND.T<=1946:1


←3-3. Examining The Data →3-5. Estimating OLS Regressions


←RATSのTopページに戻る