GRETL.OLS - Instruction on how to use GRETL to estimate OLS...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Instruction on how to use GRETL to estimate OLS models. 1. Import data. We will use data in Excel format. First of all, run GRETL. Then press: File‐>Open data‐>Import‐>Excel. Press Enter. There are two main types of data set that we will work with – cross sectional and time series. If you have a variable called ‘year’ in your data set then it is automatically classified as time series data. (for example, in the invent_hdr.xls file, the first column is year, and therefore, gretl interprets it as time series). If you don’t have ‘year’ variable in your data set, then you are given a choice of either interpreting it as time series (order of observation matters ) or cross sectional (order is not important). In most cases (if not said otherwise) you should chose ‘no’ option here. Variables are given both names and numbers. You can use both in order to refer to a variable. Now we are ready to estimate simple OLS model. We can use either Console (third button from the left in the bottom row) or OLS Model (second button from the right in the bottom row or in menu: Model‐ >Ordinary Least Squares). 2. Let’s start with Console. Console can be started by pressing a third button in the bottom row. You start a line with specifying the estimation method. In your case it is OLS. Then you type the name of the dependent variable. Then you have a choice of either including intercept in your model (then you type 0 as your first independent variable) or not (then your first independent variable would be cgdp in our case). Please note that variable names are case sensitive. After you press Enter, you get results in the same window. First couple of lines is devoted to summary of the estimated model (number of observations, explanatory variable, estimation method, etc). Then you see a table where parameter (coefficient) estimates are reported. They come with some statistics that we will use to test various hypothesis regarding these parameters (s.e. ,t‐ratio, p‐value). Two columns below the table contain performance statistics of the model overall. We will study them in more details later. If you want to save the results for future use you can press Save button in the left hand corner of GRETL console. The results as well as commands are saved in txt file. You can “recycle” commands by copy‐pasting them in future. In order to export results to MS Word, you can type “tabprint ‐‐rtf” after the model output. This command creates an rtf file in My Documents/gretl folder on your computer. Output has a better formatting than txt file. 3. Now let’s consider the OLS button. You can either use a shortcut located in the bottom row of buttons or use menu (Model‐> Ordinary Least Squares). With blue arrow you select a dependent variable. With green arrow you add independent (explanatory variables. Constant term (intercept) is already on the list of explanatory variables. You can get rid of unnecessary explanatory variables with the red arrow. Press ok to run a standard OLS. The output will appear in a new window. You can save this output to txt file for future references. File‐>Save As‐>RTF. 4. Exiting gretl. After you finish working with your model and wish to exit gretl, it asks you if you want to save the list of commands that you executed (even if you used OLS window interface, there is still a list of commands that gretl executes for you). It is recommended that you press yes. The file will have inp extension. The file can be opened by double click and contains only a list of commands run (without model output). ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online