Gretl commands can be collected and put into a file that can be executed at once and saved to be used again. This is accomplished by opening a new command script from the file menu. The command File>Script files>New script from the pull-down menu opens the command script editor shown in Figure 1.11. Type the commands you want to execute in the box using one line for each command. Notice that in the first line of the script, "I:Program Filesgretldatapoefood. gdt", the complete file and path name are enclosed in double quotes,
If you have a very long command that exceeds one line, use the backslash () as a continuation command. Then, to save the file, use the “save” button at the top of the box (first one from the left). If this is a new file, you’ll be prompted to provide a name for it.
To run the program, click your mouse on the “gear” button. In the figure shown, the food. gdt gretl data file is opened. The series commands are used to take the logarithm of y and x, and the ols command discussed in section 2.4 is used to estimate a simple linear regression model that has ln(y) as its dependent variable and ln(x) as the independent variable. Note, the model also includes constant.
A new script file can also be opened from the toolbar by mouse clicking on the “new script” button " or by using the keyboard command, Ct. rl+N.
One of the handy features of the command script window is how the help function operates.
At the top of the window there is an icon that looks like a lifesaver. Click on the help button and the cursor changes into a question mark. Move the question mark over the command you want help with and click. Voila! You either get an error message or you are taken to the topic from the command reference. Slick!