* SPECIFY THE NAME OF THE DATA FILE
open data consdata.xls
allocate 0 5
data(format=xls,org=obs) 1 5 con inc
table
print
* CONSTRUCT A SCATTER DIAGRAM OF THE DATA
scatter(header='consumption vs. income')
# inc con
* NOTE: THE FIRST ENTRY (inc) APPEARS ON HORIZONTAL SCALE
* NOTE: THE SECOND ENTRY (con) APPEARS ON VERTICAL SCALE
* ESTIMATE THE MODEL BY OLS 
linreg con / resid
# constant inc
* COMPUTE THE PREDICTED OR FITTED VALUES
prj fitted
table
print
compute sesq=%seesq
display sesq
compute ssr=%rss
display ssr
* STORING SS-RESIDUALS AS CONSTANTS IS USEFUL IN SOME 
* HETEROSCEDASTICITY AND AUTOCORRELATION TESTS 

    Source: geocities.com/timessquare/castle/8640

               ( geocities.com/timessquare/castle)                   ( geocities.com/timessquare)