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-2024.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

Register now!

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.

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
  • 3 replies
  • 291 views
  • 1 like
  • 3 in conversation