SPSS FAQ How can I output the results of my regression to an SPSS data file?

Sometimes it is useful to output the results of a regression analysis to a data file for further analyses.  To do this in SPSS,  you can use the output subcommand of the regression command.  You have two choices of what to save using this subcommand:  you can save the covariance matrix of the coefficients (with the covb option) or you can save the correlation matrix of the coefficients (with the covr option).  Let us use a data set called hsb2 as an example.  We will save the results and the covariance matrix of the coefficients in a file called out1.sav.

get file 'd:\hsb2.sav'.
regression
/dep = write
/outfile = covb('d:\out1.sav').

get file 'd:\out1.sav'.
list.

DEPVAR_  ROWTYPE_ VARNAME_   CONST_     READ   FEMALE

WRITE    COV      CONST_       7.36     -.13     -.70
WRITE    COV      READ         -.13      .00      .00
WRITE    COV      FEMALE       -.70      .00     1.03
WRITE    EST                  20.23      .57     5.49
WRITE    SE                    2.71      .05     1.01
WRITE    SIG                    .00      .00      .00
WRITE    DFE                 197.00   197.00   197.00

Number of cases read:  7    Number of cases listed:  7

As you can see above, the covariances between the estimates have been saved to this file, as well as the estimates, their standard errors, the significance and the error degrees of freedom.  Note that the precision of the values saved in out1.sav is greater than the two decimal places shown here.  Two decimal places are shown because that is the default number of decimal places to display in an SPSS data set.  You can easily increase the number of decimal places shown by going to the "Variable View" of the SPSS Data Editor and increasing the value in the column labeled "Decimals" (you may have to increase the column width first).

Now let's run the same regression and this time use the corb option instead.

get file 'd:\hsb2.sav'.
regression
/dep = write
/outfile = corb('d:\out2.sav').

get file 'd:\out2.sav'.
list.
DEPVAR_  ROWTYPE_ VARNAME_   CONST_     READ   FEMALE

WRITE    COR      CONST_       1.00     -.96     -.25
WRITE    COR      READ         -.96     1.00      .05
WRITE    COR      FEMALE       -.25      .05     1.00
WRITE    EST                  20.23      .57     5.49
WRITE    SE                    2.71      .05     1.01
WRITE    SIG                    .00      .00      .00
WRITE    DFE                 197.00   197.00   197.00

Number of cases read:  7    Number of cases listed:  7

As we can see, the correlations between the coefficients have been saved to the data set, as well as the estimates, their standard errors, the significance and the error degrees of freedom.

Results can also be saved into data sets using the Output Management System (OMS).  For more information on how to use OMS to output results to data sets, please see How can I output my results to a data file in SPSS? .

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.