Notes on using Gauss at UofG


  • In order to avoid problems graphing, saving output, and saving files, each time you start Gauss you will need to change the working directory to a directory in which you have permission to write files. For example, you could change directories to "My Documents". To do so, first open Gauss, then select "File", then selection "Change Working Directory".

    Gauss links and info

    (some links seemed to have changed. If you find the new link please let me know.)

    Miscellaneous Gauss Commands

    Useful commands for working with data are (see command reference for exact usage):

    load - to load data
    miss,missrv -- replace missing value with number and vice versa
    packr -- remove all rows of matrix with missing values

    To set a seed to create reproducible simulation results: use:

    rndseed 2006; @where 2006 could be any number@

    at the top of the program. The rndseed command is documented on p. rndnseed is documented on p. 28-668 of the Gauss 7.0 manual.) Then just use the usual

    rndn(n,k);

    command to create normal random variables.

    Gauss on Unix

  • Dealing with Excel files. The "XLS" commands such as XLSread for excel file manipulation in Guass are not available in unix Gauss. The xls files can instead be saved as .csv files and loaded using the "load" command in Gauss or they can be converted to Gauss data files, using a program such as Stat/Transfer, see here for an example.

  • To run certain commands only when running the Gauss program on unix use #ifUNIX. This can be used for version specific commands to ensure compatibility of the program code on both windows and unix.

  • To run Gauss on a remote unix server use putty to access the account. To enter the gauss program type: tgauss at the command line.
    From here you can run commands at the prompt. This is good for learning the commands. For real work you will want to type your commands into a program. To do this type ed example.gss at the gauss prompt where example.gss is the the name of the file. This will bring you into the emacs editor. To quit and save type control-X control-C. Then at the gauss prompt type run example.gss to run it. Better yet you can run and edit it directly from the command line with out going into gauss as follows:

    To run the program divyield.prg type

    nice --adjustment=19 tgauss -b divyield.prg

    If the program only takes a minute or two to run you can just use

    tgauss -b divyield.prg

    To run it a second time just use the up arrow to get the same command back again.

    To edit a divyield.prg just use emacs divyield.prg.

    You probably want two versions of putty open at the same time, one to run gauss. The other to edit the file.

    To run gauss without having to keep a window open, you can type following command where here I assume fx.prg is the name of the program you are running:

    nice --adjustment=19 nohup tgauss -b fx.prg &

    Since this is to long for me to remember. I usual copy this into a file in the same directory where fx.prg sits using emacs. Then I save the file as say "r" or any other file name. Then on the command line I type

    chmod u+x r

    which allows the file to be executed. All this only needs to be done once. Then each time you want to run the program you just type

    ./r

    from the command line in the directory where fx.prg is in.

    To see if the program is still running you would type

    top

    Here is a link with more and explanation and details on job control