

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Economics 201 Cottrell
Gretl is a rather full-featured econometrics program. In this class we will be using only a fraction of its functionality but if you have a good background in statistics you are encouraged to explore some of the more advanced features. Note that there is online help available in most contexts, and there is also a full manual in PDF format: to access this, click the Acrobat icon (on the toolbar at the foot of gretl’s main window).
Here are some pointers for accomplishing various tasks relating to exploration of a dataset (for example the OECD health-spending data). The bold-faced phrases below are keyed to the corresponding phrases in the OECD assignment.
Make a table Make a table displaying the values of one or more selected variables, possibly sorted, and copy-and- paste this table into a Word document.
§ Select your variable or variables. To select a single variable, just click on its line in gretl’s main window. To select a set of contiguous variables, drag the mouse over the variables you want. To select non-contiguous variables, click the first one you want then, with the Ctrl key held down, click on the others.
§ Display the variables. Right-click in gretl’s main window and select “Display values” from the pop-up menu. Or, from the Data menu on the main menubar, select “Display values.” A window will open showing the selected variables: let’s call this a “data window.”
§ Sort the data. If the data should be sorted, click the Sort (A–Z) icon at the top of the data window. A dialog box will appear where you select the variable you wish to use for sorting.
§ Copy the contents of the data window to the clipboard. First click the copy icon at the top of the data window (note that you don’t have to select data in this window with the mouse—by default all the data will be copied). A dialog box appears, giving you some options regarding the format in which the data should be copied.
- If you plan to copy into MS Word, select the option “Tab separated”. - If you’re copying into MS Excel, select “Comma separated”.
§ To paste the data into Word or Excel, Use Edit, Paste (or the shortcut Ctrl-V). In Word, it will not at first look like a real table. Select the material you just pasted (highlight it by dragging the mouse), then from Word’s Table menu select “Table AutoFormat...” If you want to fine-tune the appearance of the table, you may do so at this point (or you can come back to this task later, by right-clicking on the table in Word).
§ Be sure to give your table an informative title, and also be sure to note (in the accompanying text, or in a note under the table) the source of the data.
Find the mean To get summary statistics (including mean, median, standard deviation and so on), first select a variable or variables as described above. Then right-click in gretl’s main window and select “Descriptive statistics.” A window will open showing the relevant statistics. You can copy and paste this into Word, as above. (In this case the material should appear in Word as a properly formatted table automatically, so you don’t need the “Table AutoFormat” step.)
Note that the format of the information differs depending on whether you selected just one variable or a set of variables. One format or the other may be more suitable depending on the context. If the table contains information that you don’t need, feel free to delete the extra stuff. To delete rows in a Word table, first select the rows to delete then right- click on the table and click “Delete Rows” in the pop-up menu (simply pressing the Delete key will delete the contents of the table cells, but not the cells themselves).
Make an X-Y graph To create an X-Y scatter graph, first select two variables in gretl’s main window (using Ctrl if they are non-contiguous). Then right-click and select “XY scatterplot.” Or click the graph icon (third from the right on the toolbar at the foot of gretl’s main window). A dialog box will appear in which you select the variable to be shown on the X axis.
With the graph displayed, click on the graph window for a pop-up menu. This menu gives the option of copying the graph to the clipboard (from where you can paste it into Word), saving the graph in various formats, editing the graph, and so on. If you want to fine-tune the appearance of the graph, explore the possibilities that appear when you click “Edit” in the pop-up menu.
Labeling points in a graph: If the data file contains identifying labels for the observations (as the OECD data files do), you have various options in relation to displaying those labels. With the graph on-screen, individual labels appear when you “brush” the data points with the mouse. To get rid of these, select “Clear data labels” from the pop-up menu. To fix them in place (so they carry over when you copy-and-paste the graph), select “Freeze data labels.” If you want to add data labels for every point, select “Edit” from the graph pop-up and check the box titled “Show all data labels.” (This may or may not produce good results, since the labels may overlap.)
Further graphing options are available if you go to the Data menu on the menubar in the gretl main window (the options “Graph specified vars” and “Multiple scatterplots”). Also worth mentioning are two quite different sorts of graph which give you a fix on the distribution of a single selected variable: a frequency plot or histogram and a “boxplot.” These are both available via the right-click pop-up menu in gretl’s main window when just one variable is selected.
Equation of line of best fit When you create a X-Y graph, if there is a reasonable degree of linear fit then a “line of best fit” is shown, and its equation is displayed at the top-left corner of the graph. To get details on this, click for the graph pop-up and select “OLS estimates.” (OLS = Ordinary Least Squares, which is the most common method for finding the best linear fit.) The OLS output can also be copied into Word, if you wish.