BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
khalillx
Fluorite | Level 6

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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 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;


 

View solution in original post

4 REPLIES 4
Reeza
Super User

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 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;


 

khalillx
Fluorite | Level 6
Oh my god thank you. I'm fairly new to sas so I make a lot of errors like that.
ballardw
Super User

@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
PeterClemmensen
Tourmaline | Level 20

Are the variables testscr and str actually in your data set? 

 

Run a PROC CONTENTS on your data and verify.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 4136 views
  • 1 like
  • 4 in conversation