/* The following program is used to read data into gauss and to plot ** the time series using the the publications quality graphics library. ** The first line reads all 134 lines (and 8 columns) into a matrix ** called AUTO1. From there the first line of auto1, which contains ** variables names, is parsed out. A sequence of numbers from 1 to 133 ** is created to be used in the graphs. ** The appropriate columns of the data are assigned names. The graphs are ** drawn on a single page in 'windows'. */ load auto1[134,8]=a:\auto1.asc; /* Loads an ascii matrix from the a: drive into gauss */ vnames=auto1[1,.]; /* The first row has variable names in it */ /* Note, vnames contains words and is a string */ data=auto1[2:134,.]; /* Rows 2 through 134 contain the numeric data */ $vnames; /* $ before vnames means print a string */ meanc(data); /* This will take the column means of the data and print them to the screen */ timeline=seqa(1,1,133); /* A vector containing a sequence of observation numbers 1-133 */ price=data[.,6]; /* Extracts the price series from the data matrix */ income=data[.,7]; /* Extracts the income series from the data matrix */ gas=data[.,8]; /* Extracts the gas series from the data matrix */ library pgraph; /* Initiates the publication quality graphics library. */ window(2,2,0); /* Requests space for 4 windows (2 cols by 2 rows) */ setwind(1); xlabel("Time"); /* The label for the x axis */ ylabel("Price"); /* Label for Y axis --note that it changes between windows */ xy(timeline,price); /* XY(a,b) plots a on the X axis and b on the Y */ nextwind; ylabel("Gas"); xy(timeline,gas); nextwind; ylabel("Income"); xy(timeline,income); endwind; /* Signals the end of the graphing windows */