BookmarkSubscribeRSS Feed
sastuck
Pyrite | Level 9

Hello,

 

Typically proc reg, along with standard regression output (coefficients, r^2, etc), will also give you residual plots. For this iteration of my model, however, I am not seeing any residuals. Any clue as to why? Perhaps it's because I have so many dependent variables? 

 

proc reg data=paper.ceo_firm3;
	model salary=annual_return bonus annual_return_VOL_thou  
	stock_awards option_awards othcomp age male
	outdoors mining utilities construction wholesale 
	information finance real_estate professional 
	waste education healthcare arts food other manufacturing transportation retail VOL_thou  / acov clb;
run;

Thanks for the help!

 

-SAStuck

15 REPLIES 15
Reeza
Super User
Add the PLOTS option tot he PROC REG statement.
sastuck
Pyrite | Level 9

I added a plots statement (thanks for the tip) but am still not seeing anything.

 

*Model A. level-level salary model controlling for industry (and other factors) // good fit;
proc reg data=paper.ceo_firm3 plots=all;
	model salary=annual_return bonus annual_return_VOL_thou  
	stock_awards option_awards othcomp age male
	outdoors mining utilities construction wholesale 
	information finance real_estate professional 
	waste education healthcare arts food other manufacturing transportation retail VOL_thou  / acov clb;
run;
PaigeMiller
Diamond | Level 26

You need to turn on ods graphics if it is not already on, and open an output destination (if one is not already opened). For example:

 

ods graphics on;
ods html;
--
Paige Miller
sastuck
Pyrite | Level 9

Ah good point. Something is still wrong though. Here's the code I ran:

 

*Model A. level-level salary model controlling for industry (and other factors) // good fit;
ods graphics on;
ods html;
proc reg data=paper.ceo_firm3 plots=all;
	model salary=annual_return bonus annual_return_VOL_thou  
	stock_awards option_awards othcomp age male
	outdoors mining utilities construction wholesale 
	information finance real_estate professional 
	waste education healthcare arts food other manufacturing transportation retail VOL_thou  / acov clb;
run;
ods graphics off;

and the log that followed:

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.
 71         
 72         *Model A. level-level salary model controlling for industry (and other factors) // good fit;
 73         ods graphics on;
 74         ods html;
 NOTE: Writing HTML Body file: sashtml5.htm
 ERROR: Insufficient authorization to access /pbr/biconfig/940/Lev1/SASApp/sashtml5.htm.
 ERROR: No body file. HTML output will not be created.
 75         proc reg data=paper.ceo_firm3 plots=all;
 76         model salary=annual_return bonus annual_return_VOL_thou
 77         stock_awards option_awards othcomp age male
 78         outdoors mining utilities construction wholesale
 79         information finance real_estate professional
 80         waste education healthcare arts food other manufacturing transportation retail VOL_thou  / acov clb;
 81         run;
 
 WARNING: ODS graphics with more than 5000 points have been suppressed. Use the PLOTS(MAXPOINTS= ) option in the PROC REG statement 
          to change or override the cutoff.
 82         ods graphics off;
 83         
 84         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 96    

I also tried this without the 

ods html;

piece, and that made the error go away, but I still did not see any residual plots. 

 

Any ideas @PaigeMiller ?

PaigeMiller
Diamond | Level 26
 ERROR: Insufficient authorization to access /pbr/biconfig/940/Lev1/SASApp/sashtml5.htm.
 ERROR: No body file. HTML output will not be created.

Not really familiar with SAS Studio, but the error seems to indicate you cannot write the file in the location shown. You might need something like this:

 

ods html path="/folder/subfolder/subsubfolder" file="myfile.html";

where you have write access to the folder/subfolder/subsubfolder contained in the PATH= argument.

--
Paige Miller
sastuck
Pyrite | Level 9

I having trouble envisioning what the 

/folder/subfolder/subsubfolder

might look like. Should this be the file path of my SAS program?

PaigeMiller
Diamond | Level 26

It is a folder that you have write access to.

--
Paige Miller
sastuck
Pyrite | Level 9

I have never heard of write access--after a quick google search I am still confused?

 

Regardless, should I try different plots?

 

This one gave me a different error for example:

 

*Model A. level-level salary model controlling for industry (and other factors) // good fit;
ods graphics on;
proc reg data=paper.ceo_firm3 (maxpoints=none);
	model salary=annual_return bonus annual_return_VOL_thou  
	stock_awards option_awards othcomp age male
	outdoors mining utilities construction wholesale 
	information finance real_estate professional 
	waste education healthcare arts food other manufacturing transportation retail VOL_thou  / acov clb;
run;
ods graphics off;
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.
 71         
 72         *Model A. level-level salary model controlling for industry (and other factors) // good fit;
 73         ods graphics on;
 74         proc reg data=paper.ceo_firm3 (maxpoints=none);
                                           _________
                                           22
 ERROR 22-7: Invalid option name MAXPOINTS.
 75         model salary=annual_return bonus annual_return_VOL_thou
 76         stock_awards option_awards othcomp age male
 77         outdoors mining utilities construction wholesale
 78         information finance real_estate professional
 79         waste education healthcare arts food other manufacturing transportation retail VOL_thou  / acov clb;
 NOTE: The previous statement has been deleted.
 80         run;
 
 WARNING: No variables specified for an SSCP matrix. Execution terminating.
 NOTE: PROCEDURE REG used (Total process time):
       real time           0.00 seconds
       user cpu time       0.01 seconds
       system cpu time     0.00 seconds
       memory              3412.09k
       OS Memory           33984.00k
       Timestamp           04/30/2018 02:33:47 PM
       Step Count                        70  Switch Count  0
       Page Faults                       0
       Page Reclaims                     477
       Page Swaps                        0
       Voluntary Context Switches        3
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           48
       
 
 81         ods graphics off;
 82         
 83         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 95         
Reeza
Super User

This has to do with your installation/set up and it's probably not a 'googleable' question.

 

How is SAS installed for you? Are you using SAS UE, SAS Academics on Demand, a version your company or university installed?


The first two have instructions on setting the path, if it's a custom version (company or Uni) you'll need to check with your IT team to understand where you have access.

sastuck
Pyrite | Level 9

What i'm not understanding ( @PaigeMiller) is why I can get plots easily for other models in the same program. For example, this: 

proc reg data=paper.ceo_firm plots(maxpoints=none);
	model salary=annual_return bonus stock_awards age male;
run;

Gives me the output i'm looking for. 

PaigeMiller
Diamond | Level 26

Maybe you need to sit down with someone at your company who knows SAS Studio and can debug this with you.

--
Paige Miller
PaigeMiller
Diamond | Level 26

PATH= should contain the full path name of a folder somewhere on one of the disks attached to your computer, where you want to write your results to. It has to be a location you are allowed to write to.

--
Paige Miller
ajd555
Fluorite | Level 6
Spoiler
Hello @sastuck ,

Not sure if it's too late to help here, but I believe the reason your plots are not showing is due to a missing option in the proc step. If you keep the rest of your code the same but change the first line to include the following plots option:
proc reg data=paper.ceo_firm3 plots=studentpanel;
It may take care of the issue.

ajd555
Fluorite | Level 6

My former answer was incomplete. Try the following:

ods graphics on;
proc reg data=paper.ceo_firm3 plots=studentpanel;
	model salary=annual_return bonus annual_return_VOL_thou  
	stock_awards option_awards othcomp age male
	outdoors mining utilities construction wholesale 
	information finance real_estate professional 
	waste education healthcare arts food other manufacturing transportation retail VOL_thou  / acov clb;
run;
ods graphics off;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 15 replies
  • 2721 views
  • 3 likes
  • 5 in conversation