When I run this code
proc reg;
model testscr = str;
output out= mydata p= yhat r= uhat;
run;
I get this error message:
WARNING: No variables specified for an SSCP matrix. Execution terminating.
NOTE: PROCEDURE REG used (Total process time):
real time 0.18 seconds
cpu time 0.03 seconds
NOTE: The data set WORK.MYDATA has 0 observations and 0 variables.
WARNING: Data set WORK.MYDATA was not replaced because new file is incomplete.
I'm not sure why. I already ran a regression using these variables but now I'm trying to print out a graph of the actual and predicted values of testscr against str. Here is the first regression I ran that was successful:
proc reg data=one;
model1: model testscr = str;
plot (testscr predicted.)*str /overlay;
output out=newdat residual= uhat predicted=testscr_hat;
run;
Compare the first line of each procedure. Your first, non-working example, has no DATA set listed, while the second one does.
See the colored section in your code.
@khalillx wrote:
When I run this code
proc reg; * No data input shown here;
model testscr = str;
output out= mydata p= yhat r= uhat;
run;
I get this error message:
WARNING: No variables specified for an SSCP matrix. Execution terminating.
NOTE: PROCEDURE REG used (Total process time):
real time 0.18 seconds
cpu time 0.03 secondsNOTE: The data set WORK.MYDATA has 0 observations and 0 variables.
WARNING: Data set WORK.MYDATA was not replaced because new file is incomplete.
I'm not sure why. I already ran a regression using these variables but now I'm trying to print out a graph of the actual and predicted values of testscr against str. Here is the first regression I ran that was successful:
proc reg data=one;
model1: model testscr = str;
plot (testscr predicted.)*str /overlay;
output out=newdat residual= uhat predicted=testscr_hat;
run;
Compare the first line of each procedure. Your first, non-working example, has no DATA set listed, while the second one does.
See the colored section in your code.
@khalillx wrote:
When I run this code
proc reg; * No data input shown here;
model testscr = str;
output out= mydata p= yhat r= uhat;
run;
I get this error message:
WARNING: No variables specified for an SSCP matrix. Execution terminating.
NOTE: PROCEDURE REG used (Total process time):
real time 0.18 seconds
cpu time 0.03 secondsNOTE: The data set WORK.MYDATA has 0 observations and 0 variables.
WARNING: Data set WORK.MYDATA was not replaced because new file is incomplete.
I'm not sure why. I already ran a regression using these variables but now I'm trying to print out a graph of the actual and predicted values of testscr against str. Here is the first regression I ran that was successful:
proc reg data=one;
model1: model testscr = str;
plot (testscr predicted.)*str /overlay;
output out=newdat residual= uhat predicted=testscr_hat;
run;
@khalillx wrote:
Oh my god thank you. I'm fairly new to sas so I make a lot of errors like that.
SAS will actually try to help you by using the last data set when you don't specify one. The procedure notes should indicate which set was used. An example log where I called proc print without a data set. SAS tells me which set was used. However in some circumstances either a last data set hasn't been used yet or you asked to use variables that didn't exist in the last set.
304 proc print;run; NOTE: Writing HTML Body file: sashtml1.htm NOTE: There were 9 observations read from the data set AAPPS.ALPHASTD. NOTE: PROCEDURE PRINT used (Total process time): real time 0.74 seconds cpu time
Are the variables testscr and str actually in your data set?
Run a PROC CONTENTS on your data and verify.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.