BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ar558a
Calcite | Level 5

Hi

I am trying to follow code in the SAS Certification Prep Guide: Statistical Business analyst, and it includes the following PROC REG code. 

proc reg data=revenue;
model revenue=adexpense;
output out=diag predicted=yhat residual=residual stdr=stderr_resid student=student;
plot residual.*adexpense modelht=3 statht=3;
plot student.*adexpense modelht=3 statht=3;
run;

But If I try and run this I get the following error 

65   proc reg data=revenue;
66   model revenue=adexpense;
67   output out=diag predicted=yhat residual=residual stdr=stderr_resid student=student;
68   plot residual.*adexpense modelht=3 statht=3;
                                     -
                                     79
                                     76
NOTE: The previous statement has been deleted.
69   plot student.*adexpense modelht=3 statht=3;
                                    -
                                    79
                                    76
NOTE: The previous statement has been deleted.
ERROR 79-322: Expecting a *.
ERROR 76-322: Syntax error, statement will be ignored.
70   run;

I have tried adding and removing spaces but to no avail. Anyone understand what is wrong. 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

The PLOT statement requires that you type a slash before the first option and after the last plot request.

 

plot residual.*adexpense/modelht=3 statht=3;
--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

The PLOT statement requires that you type a slash before the first option and after the last plot request.

 

plot residual.*adexpense/modelht=3 statht=3;
--
Paige Miller
Ar558a
Calcite | Level 5

Many Thanks! Should have tried that. You just take code in a text book as gospel! 

Rick_SAS
SAS Super FREQ

You might be interested in reading about the diagnostic plots that PROC REG can produce automatically.

Documentation: SAS Help Center: PROC REG Statement

 

For most SAS procedures, you just need to enable ODS graphics and use the PLOTS= option to ask the procedure to produce standard plots.

For plots that are not created automatically, you can often use the OUTPUT statement (as in your program) and then use PROC SGPLOT to create the plots.

 

The built-in ODS graphics do not contain all of the options on the PLOT statement, but the output looks much better. Good luck!

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 697 views
  • 1 like
  • 3 in conversation