1 / 42

หลักการใช้โปรแกรม E-Views

หลักการใช้โปรแกรม E-Views. Wasin Siwasarit Faculty of Economic, Thammasat University January 2009. บทนำ : Introduction. Title Bar. พื้นที่ในหน้าต่างหลัก :The EViews Window. Main Manu. Command Window. Work Area. การสร้างแฟ้มงาน และการนำเข้าข้อมูล :Creating a Workfile and Importing Data.

sol
Download Presentation

หลักการใช้โปรแกรม E-Views

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. หลักการใช้โปรแกรมE-Views Wasin Siwasarit Faculty of Economic, Thammasat University January 2009

  2. บทนำ : Introduction Title Bar • พื้นที่ในหน้าต่างหลัก:The EViews Window Main Manu Command Window Work Area

  3. การสร้างแฟ้มงาน และการนำเข้าข้อมูล:Creating a Workfile and Importing Data • ถ้าจะสร้างแฟ้มงานขึ้นมาใหม่ให้เลือกFile/New/Workfile…

  4. จะปรากฏ dialog box ซึ่งเป็นที่ที่เราจะตั้งช่วงเวลา/จำนวนชุดข้อมูล (ขึ้นอยู่ว่าเป็น Cross-section/Time series/Pooled data)

  5. วิธีการเลือกจุดเริ่มต้นและจุดสิ้นสุดของข้อมูล:How to determine the range • ข้อมูลรายปี:Annual>example 1990-2003 • ข้อมูลรายไตรมาส:Quarterly>example1990:1-1990:4 • ข้อมูลรายเดือน:Monthly>example1990:01-1990:12 • ข้อมูลรายครึ่งปี:Semi-Annual>example1990:01-1997:02 • ข้อมูลรายสัปดาห์และรายวัน:Weekly and Daily>01:01:1990-12:31:1990

  6. Remark: ในการกำหนด workfile range หากเราต้องการที่จะพยากรณ์ผลการประมาณการไปข้างหน้า เราต้องทำการเพิ่ม range ในช่วงเวลาดังกล่าวไว้ด้วย

  7. การนำเข้าข้อมูลไปยังแฟ้มงาน:Import data into the workfile • เลือกProcs/Import/Read Text-Lotus-Excel…

  8. จะพบ Windows file dialog box ให้ทำการเลือก drive&folder ที่เก็บชุดข้อมูลเอาไว้ • Double-click ที่ file ที่ต้องการ

  9. เราจะพบ Excel spreadsheet import dialog ปรากฏขึ้นมา

  10. Data order:ให้เลือกว่าข้อมูลที่อยู่ใน Excel file มีการจัดเรียงในรูปแถวหรือหลัก • Excel5+sheet name:ให้ใส่ชื่อของ Sheet name ที่มีข้อมูลเก็บอยู่ • Upper-left data cell:ให้พิจารณาดูที่ Excel file ว่า Series แรกของข้อมูลอยู่ที่แถวไหนและหลักที่เท่าไร (ให้ใส่ cell แรกของข้อมูล) • Name for seriesor Number if named in file :ถ้าหากชุดข้อมูลในExcel file มีชื่อของแต่ละชุดข้อมูลอยู่แล้ว ให้ใส่จำนวนของชุดข้อมูลลงไป(เช่น ถ้าข้อมูลมี 2 series คือ x และ y ก็ให้ใส่ 2 ลงไป) แต่ถ้าในExcel file ยังไม่มีชื่อของแต่ละSeries ก็ให้พิมพ์ชื่อของแต่ละ Series ลงไปโดย ชื่อแต่ละSeries จะต้องเว้นวรรคด้วยเลือก Ok โปรแกรม Eviews จะทำการนำเข้าข้อมูลจาก Excel file มา โดย series ที่นำเข้ามาจะปรากฏในworkfile window:

  11. ชุดข้อมูลจะปรากฏ เป็น icons ใน workfile window:

  12. นอกจากนี้เรายังสามารถสร้างชุดข้อมูลได้โดยหลักการcopy-and-paste the data จาก Excel spreadsheet มายัง EViewsได้โดยตรง โดยมีขั้นตอนดังนี้

  13. การสร้าง series:Creating a series • เราสามารถสร้าง Series ได้ 2 วิธี • วิธีที่หนึ่ง คือ เลือกObject/New Object…จาก menu และเลือกSeries

  14. Click Edit to assign Values for the series

  15. วิธีที่สอง เลือกQuick/Empty Group(Edit Series)

  16. นอกจากนี้เรายังสามารถสร้าง series by using mathematical expressionsโดยเลือกQuick/Generate Series…

  17. การตรวจสอบความถูกต้องของชุดข้อมูล:Verifying the Data • หลังจากที่เรามีการนำเข้าชุดข้อมูลหรือสร้างชุดข้อมูลเสร็จแล้ว เพื่อตรวจสอบความถูกต้องของชุดข้อมูล เราสามารถกระทำได้โดยเลือกXใน workfile window จากนั้นกดCTRLแล้วเลือกX1,YและY1

  18. จากนั้นให้ Click ขวา ที่ Mouse แล้ว…. • เลือกOpen/as group…

  19. ทำการตรวจสอบชุดข้อมูลจาก Excel file และจาก work file ของเราว่าถูกต้องหรือยัง หากไม่ถูกต้องให้ทำการแก้ไขให้เรียบร้อย หลังจากที่ข้อมูลใน workfile ถูกต้องแล้ว ให้เราทำการจัดเก็บ workfile โดยเลือก saveใน the workfile window ซึ่งเราจะพบ A save dialog box ให้เราทำการเลือก Drive&folder ที่จะทำการจัดเก็บ โดยให้ตั้งชื่อ workfile name • หลังจากที่เราทำการจัดเก็บ workfile เป็นที่เรียบร้อยแล้ว เราสามารถเรียก workfile ดังกล่าวขึ้นมาใช้งานได้โดยเลือกFile/Open/Workfile…จาก the main menu

  20. การวิเคราะห์ข้อมูลเบื้องต้น:Examining the Data • เราสามารถใช้ EViews ทำการวิเคราะห์ข้อมูลเบื้องต้นได้หลากหลายรูปแบบเช่นถ้าเรา เลือกXใน workfile window จากนั้นกดCTRLแล้วเลือกX1,YและY1 • จากนั้น กดที่ขวาของMouse และเลือกView/Multiple Graph/Line

  21. นอกจากนี้ หากเราเลือกView/Descriptive state/Individual Sample EViewsจะทำการคำนวณค่าทางสถิติที่สำคัญๆต่างให้ ดังตารางข้างล่างนี้

  22. หรือ เลือกView/Correlations/Common ตาราง the correlation matrix of the four series จะปรากฏ

  23. การประมาณสมการถดถอยอย่างง่าย:Estimating a Regression Model • ต่อไปเราจะทำการประมาณสมการถดถอยอย่างง่ายด้วยวิธีการกำลังสองน้อยสุด(OLS) • โดยเป็นสมการการบริโภคกาแฟของสหรัฐฯ(U.S coffee consumption-Y)โดยเป็นฟังค์ชันของราคาขายปลีกเฉลี่ย(average real retail price-X) ระหว่างปี1970-1980 • รูปแบบสมการที่จะประมาณคือ

  24. ขั้นตอนแรก ให้เราลองดู ลักษณะความสัมพันธ์ของข้อมูลและเส้น SRL ที่จะได้จากการประมาณค่าด้วยรูปแบบต่างๆ โดยทำตามขั้นตอนต่อไปนี้ • 1.เลือกตัวแปร/ชุดข้อมูลที่เราจะประมาณสมการถดถอย (โดยเลือกตัวแปรอิสระก่อน-independent variable/s แล้วจึงตามด้วยตัวแปรตาม-dependent variable) • 2.หลังจากนั้น กดขวาที่ mouse แล้วเลือกOpen/as group/View/Graph/Scatter/Scatter with Regression

  25. ขั้นตอนที่สองหากเราต้องการประมาณสมการที่1 ให้เลือก Quickจาก the main menu และเลือกEstimate Equation…จะปรากฏ the estimate dialog. ให้พิมพ์ Equation specification โดยพิมพ์ตัวแปรตามก่อน เว้นวรรค ตามตัว C ซึ่งแทนค่า intercept ในสมการของเรา (ซึ่งถ้า สมการของเราไม่มี intercept เราก็ไม่ต้องใส่ค่า C) เว้นวรรคแล้วตามด้วยตัวแปรอิสระตัวที่1 เว้นวรรค พิมพ์ตัวแปรอิสระตัวที่สอง ทำเช่นนี้ไปจนครบตัวแปรอิสระทุกตัวในสมการของเรา For model (1)

  26. เราจะได้ผลจากการประมาณด้วยวิธี OLS ของสมการที่1 Coefficient P-value (t-Statistic) t-Statistic is calculated from this formula (coefficient/Std. Error) P-value (F-statistic)

  27. ทำการประมาณรูปแบบสมการที่2 ด้วยวิธีการเดียวกัน Model(2)

  28. เราจะได้ผลจากการประมาณด้วยวิธี OLS ของสมการที่ 2

  29. เราสามารถดูสมการที่ได้จากการประมาณค่าโดยเลือกViewแล้วเลือกrepresentationsเราสามารถดูสมการที่ได้จากการประมาณค่าโดยเลือกViewแล้วเลือกrepresentations

  30. หลังจากที่เราได้ผลจากการประมาณค่า(model1) เราสามารถจัดเก็บไว้ใน Workfile ได้โดยเลือกName จากนั้นให้ใส่ชื่อแล้วเลือกOK..

  31. ถ้าเราต้องการเปรียบเทียบค่าจริงของข้อมูล ค่าที่ได้จากการประมาณค่า และค่าความคาดเคลื่อนจากสมการ เราสามารถ กระทำได้โดยเลือกview/Actual,Fitted,Residual/Actual,Fitted,Residual Table

  32. หลังจากที่เราทำการประมาณสมการที่1 เราจะพบว่ามี icon ชื่อ ‘resid’ ปรากฏ ซึ่งก็คือค่าความคลาดเคลื่อนที่ได้จากสมการที่1 นั้นเอง (ระวัง! ค่าตัวเลขใน icon นี้จะมีการเปลี่ยนแปลงไปทุกๆครั้งที่มีการประมาณสมการอื่นๆ) Resid is the Residual from the newest version of model ( It is changing every time you estimate the new model). Therefore, Be careful when use it!

  33. ดังนั้น หากเราต้องการเก็บค่าความคาดเคลื่อนของแต่ละสมการไว้ใช้ในครั้งต่อๆ ไป เราสามารถทำการจัดเก็บไว้ได้โดย • 1.หลังจากที่เราประมาณสมการต่างๆเสร็จแล้ว ให้เราเลือกProcs/ Make residual series… • 2. ใส่ชื่อของ residual name เช่น residual_model1 • 3.กด Save

  34. ตัวอย่าง: Interest and Bond Rates • The AAA bond rate is defied as an average over long-term bonds of firms with AAA rating • The data on the Treasury bill rate are taken form the Federal Reserve Board of governors and data on AAA bonds from Moody’s Investors Services • Data run from January 1950 to December 1999 • Let Xi denote the monthly change in the Treasury Bill rate • Let Yi be the monthly change in the AAA bond rate

  35. รูปแบบสมการ คือ

  36. The variance over the first half of the considered time period is smaller than that over the second half. Why? -The uncertainty of AAA bonds has increased over the time

  37. End

More Related