Presentation is loading. Please wait.

Presentation is loading. Please wait.

Eviews 操作 2012/11.

Similar presentations


Presentation on theme: "Eviews 操作 2012/11."— Presentation transcript:

1 Eviews 操作 2012/11

2 I. Getting data into Eviews
The first step is to read your data into an EViews workfile. 1.現有之資料檔: File/Open/EViews workfile,選擇想要的工作檔. 2.新的資料檔(create a new workfile) 以Demo.xls為例,有兩種方式叫入檔案: (1) File/New/ Workfile, 出現Workfile Create視窗, 此例為時間序列資料,故選 Dated-regular frequency,輸入start date 與end date,按OK.

3 I. Getting data into Eviews
→Workfile視窗:按主視窗 File/Import/Read Text-Lotus-Excel,叫入Demo.xls資料檔→出現Excel spreadsheet import,輸入變數個數為4,按OK →Workfile視窗即出現四個序列的資料變數gdp,pr,m1和rs, c為常數項,resid為殘差(後兩者為內建). Note:若為時間序列資料,選Dated-regular frequency, 若為簡單的panel資料,選Balanced panel,餘者資料形態選擇Unstructured.

4 I. Getting data into Eviews
(2) File/Open/Foreign Data as Workfile,選擇想要的檔案 Demo.xls →出現Spreadsheet read視窗,按Finish →即出現工作檔視窗 當建立好新的工作檔後,可按save將此工作檔存成.wf1,再使用時直接用1(現有之資料檔)的方法叫出即可。

5 II. Examining the Data 把資料工作檔建立好後,首先可先對資料變數做檢查,記得確保Excel輸入的資料有正確無誤的讀入。
Examine the characteristics of individual series: 1. 以demo.wf1之M1序列為例, to see the contents of the M1 series, simply double click (雙擊) on the M1 icon in the workfile window, or select Quick/Show… in the main menu, enter m1, and click OK. EViews will open the M1 series object.

6 II. Examining the Data 2. Click on the View button, then select Descriptive Statistics & Tests/Stats Table. EViews will compute descriptive statistics for M1(可逐一檢查每一資料變數之序列, 並計算相關的統計量). 3. 若想同時選擇多個資料變數,則可在工作檔視窗持續按Ctrl,點選所要的變數,再雙擊 →Open Group,出現Group視窗, 其中便是所選擇之變數的序列資料 →Descriptive Statistics,即可同時看到多個資料變數的統計量

7 II. Examining the Data Graph (繪圖)
1. 單圖:當雙擊資料變數名稱,出現 Series 視窗後, 亦可在該視窗select View/Graph... to bring up the Graph Options dialog, and select Line & Symbol from the list of graph types on the left-hand side. 2. 多圖: 當雙擊所選擇之多個資料變數名稱,出現 Group 視窗後,亦可在該視窗select View/Graph... to bring up the Graph Options dialog, and select Line & Symbol.

8 II. Examining the Data Note1: 若想將每個變數劃一個圖,並呈現在同一頁上,View/Graph →在 Graph option之Multiple Series的部份,改選Multiple graphs即可 Note2: 若想在圖形上加陰影或水平/垂直線等 Step 1:在group(或series)物件視窗上,按Freeze將圖存成graph物件 Step 2:滑鼠右鍵Add line& shading

9 II. Examining the Data 原始資料的轉換
Eviews亦允許將所輸入的原始資料作轉換,比如可以將其取ln,轉成自然對數。以demo.wf1為例, 若我們想將M1與GDP取自然對數,PR取自然對數後再取差分,則可在主視窗Quick/Show →輸入log(m1) log(gdp) dlog(pr) →OK,即出現Group物件視窗,再依循前述步驟計算相關的統計量與繪圖。 相關係數矩陣:若想計算所有資料變數(或部份變數)的相關矩陣,挑選好所要的變數後,在Group視窗 View/Covariance Analysis→Correlation

10 III. Estimating a regression model
假設欲估計 a regression model for M1 using data over the period from 1952Q1–1996Q4. The model specification is given by: 其中 log(M1) is the logarithm of the money supply, log(GDP) is the log of income, RS is the short term interest rate, and Dlog(PRt )is the log first difference of the price level (the approximate rate of inflation).

11 III. Estimating a regression model
1. 由主視窗 Quick/ Estimate Equation… to open the estimation dialog.輸入所要估計的迴歸模型 log(M1) c log(GDP) RS Dlog(PR)(先輸入應變數名稱,再依序輸入自變數名稱) 在Equation Estimation視窗,選擇LS - Least Squares method;Sample選1952Q1 1996Q4,按OK即出現迴歸結果。 Note:亦可由工作檔視窗,選 Object/New Object/Equation,之後步驟同前。

12 III. Estimating a regression model
2. 在迴歸結果 Equation 視窗按View/Actual, Fitted, Residual,可看到實際Y值,配適的Y值(即 )與殘差(residuals,即 )。

13 IV. Restricted and unrestricted models
Eviews提供對參數限制的檢定:跑完迴歸後,在Equation視窗點選 View/Coefficient Tests/Wald,在對話方塊輸入限制式即可。 Stability test-Chow test Eviews 提供多種檢定,以檢驗模型參數是否在各子樣本間相同(stable), 其中我們常以Chow breakpoint test來檢定結構性變化。跑完迴歸後,在Equation視窗點選 View/Stability Tests/Chow Breakpoint Test,並在對話方塊輸入作為樣本切割點的日期或第幾筆樣本,比如總樣本為1950 to 1996,若輸入1960 代表Eviews會自動切割樣本為1950 to 1959 和1960 to 1996兩個子樣本來進行Chow test。

14 作業 Exercise.xls 資料檔為21個國家的投資率(Invrate: 投資支出/GDP)與儲蓄率(Savrate: 儲蓄/GDP)
1. 請列出 Invrate 與 Savrate 的基本敘述統計量 2. 請列出 Invrate 與 Savrate 的相關係數矩陣 3. 估計 Show 迴歸結果,以及 與殘差。請解釋 的意義。 4. 檢定 (雙尾) ,令顯著水準為1%。


Download ppt "Eviews 操作 2012/11."

Similar presentations


Ads by Google