IBM Support

Saving linear regression coefficients and predicted values to case-level file in SPSS

Troubleshooting


Problem

I have a dataset which looks like this: ID Date return mrp hml smb umd 1 01/00 10 12 2 3 4 ... 1 12/05 6 4 1 2 3 2 01/00 11 12 2 3 4 ... 2 12/05 5 4 1 2 3 ... For every ID, I would like to run the following regression, which does not include a constant: : return = b1*mrp+b2*hml+b3*smb+b4*umd The coefficients should be written to the new variables betamrp, betahml, betasmb, betaumd. Moreover, I would like to have a predicted value for RETURN, based on the coefficints for the respective ID, saved as a new variable to every row in the data file. The final dataset should look similar to this: ID Date return mrp hml smb umd betamrp betahml betasmb betaumd preret 1 01/00 10 12 2 3 4 2 1 0.8 0.7 2 ... 1 12/05 6 4 1 2 3 2 1 0.8 0.7 -1 2 01/00 11 12 2 3 4 2.5 0.8 0.7 0.6 1 ... 2 12/05 5 4 1 2 3 2.5 0.8 0.7 0.6 -1 ... Please suggest a set of SPSS commands to perform these tasks.

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Historical Number

69095

Document Information

Modified date:
16 April 2020

UID

swg21479022