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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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