0% found this document useful (0 votes)
150 views

Some Basic Gretl Skills: Make A Table

This document provides instructions for using the econometrics program Gretl to complete common tasks like making tables and graphs from economic data. It explains how to select variables, display and sort data, find summary statistics like the mean, create XY scatter plots, and view the equation for the line of best fit. The document serves as a guide for students in an Economics 201 course on using Gretl's basic functionality.

Uploaded by

greatluckforu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views

Some Basic Gretl Skills: Make A Table

This document provides instructions for using the econometrics program Gretl to complete common tasks like making tables and graphs from economic data. It explains how to select variables, display and sort data, find summary statistics like the mean, create XY scatter plots, and view the equation for the line of best fit. The document serves as a guide for students in an Economics 201 course on using Gretl's basic functionality.

Uploaded by

greatluckforu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Economics 201

Cottrell

Some Basic Gretl Skills


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 gretls 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-andpaste this table into a Word document. Select your variable or variables. To select a single variable, just click on its line in gretls main window. To select a set of contiguous variables, drag the mouse over the variables you want. To select non-contiguous variables, click the rst one you want then, with the Ctrl key held down, click on the others. Display the variables. Right-click in gretls 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: lets call this a data window. Sort the data. If the data should be sorted, click the Sort (AZ) 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 dont have to select data in this window with the mouseby 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 youre 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 rst look like a real table. Select the material you just pasted (highlight it by dragging the mouse), then from Words Table menu select Table AutoFormat... If you want to ne-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), rst select a variable or variables as described above. Then right-click in gretls 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 dont 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 dont need, feel free to delete the extra stuff. To delete rows in a Word table, rst select the rows to delete then rightclick 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, rst select two variables in gretls 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 gretls 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 ne-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 le contains identifying labels for the observations (as the OECD data les 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 x 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 specied vars and Multiple scatterplots). Also worth mentioning are two quite different sorts of graph which give you a x 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 gretls main window when just one variable is selected. Equation of line of best t When you create a X-Y graph, if there is a reasonable degree of linear t then a line of best t 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 nding the best linear t.) The OLS output can also be copied into Word, if you wish.

You might also like