Introduction
This exercise requires completion of Exercise One: Generating Data From a Linear Model. The model used in this exercise follows the data generating process below:
$$ y_i = 2 + 3.5x_i + \epsilon_i $$
Navigate to the GAUSS Edit Page
We will begin this exercise from the GAUSS Edit Page. Navigate to the Edit Page by clicking the Edit tab on the left of the application.
If the Program Input/Output window is not open on the Edit Page, you may open it from View menu at the top of the Edit Page.
Opening the program file
If the file you created in exercise one is not open, open that file with one of the methods below:
- From the main application menu select File > Open File.
- Use the hotkey
CTRL+O
. - From the main application menu select File > Recent Files.
- Enter:
edit filename.gss;
Running the program file
Using the Run button
The Run button is located on the main application toolbar. There are two ways to use the Run button. You may either click the Run button directly or choose from a list of files to run by selecting the downward-pointing triangle to the right of the Run button.
If you select the downward pointing triangle, you will see a list of files followed by the final option which is Current File. These are the files that you have most recently run. The last file that you ran will be at the top of the list. Selecting Current File will run the last file that your cursor was in.
Hovering over the Run button will provide a tooltip with the name of the file at the top of the list. This list of files is called the Action List. The two buttons to the right of the Run button, the Debug and Edit buttons, operate on the same list of files.
Run your file
If your example file has not been run, place your cursor in the file and select Current File from the Run button's Action List menu. When the program begins, you will see a message on the bottom left of the status bar, Running. This message will be followed by Program Finished at the conclusion of the program run.
Other methods to run a file
- The
CTRL+R
hotkey performs the same action as selecting Current File from the Run button action list. - Entering
run filename.gss;
into the Program Input/Output window.
Saving data
Any GAUSS matrix can be saved and easily reloaded for future use. This is a convenient way to access data and eliminates the need to re-run old program files. To save a matrix x
that exists in your current workspace, enter the command:
save x;
This will save the contents of the matrix x
to a file named x.fmt
in your current working directory. GAUSS's current working directory is indicated by the current working directory combo-box on the main application toolbar.
You may load this matrix back into a later GAUSS session by entering the command:
load x;
This will create a new matrix named x
in your GAUSS workspace with the contents of the file x.fmt
that was saved on disk.
Specifying a save path
If you would like to save your variables to a specific location rather than the current working directory, you may set a save path. You may either set a global save path or a local save path.
Setting a global save path
Setting a global save path will tell GAUSS to save all variables saved with the save
command to this location. To set C:\gauss24\data
to be your global save path, enter:
save path = C:\gauss24\data;
After executing that command, all future variables saved with the save
command will be saved in C:\gauss24\data
.
Setting a local save path
A local save path is in effect for only one statement. If you would like to save the matrix x
to C:\gauss24\data
, but would not like this to affect other uses of the save command, enter:
save C:\gauss24\data=x;
Save the matrix x
and y
from the example program
Run the example program again to create fresh data. Now save the matrices x
and y
for use in the next part of our tutorial with the command:
save x;
save y;