Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- DFBETAS

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 05-28-2018 07:35 PM
(1419 views)

**HI I AM RUNNING THE FOLLOWING CODE IN ORDER TO COMPUTE THE VALUE OF THE DFBETAS FOR EACH STATE, BUT I AM GETTING MANY WARNINGS AND ERRORS **

proc reg data=newsalaries;

model teach_sal = edu_spen geograph area2 area3/ influence vif;

output out=new1 h=hatdiags p=pred r=resid

student=stres cookd= cooksD dffits= dffits ;

title1 'DFBETAS for each state';

symbol1 value=dot pointlabel = (height = 10pt

'#state');

run;

plot stres*pred;

plot hatdiags*pred;

plot cooksD*pred;

run;

THESE ARE THE WARNINGS AND ERRORS I AM GETTING AND I HAVE TRIED REPLACING THE "PRED" WITH "GEOGRAPH" BUT THEN I GET ANOTHER ERROR. I AM USING SAS VERSION 9.4. I WOULD REALLY APPRECIATE SOME HELP WITH THIS. THANK YOU.

**551 proc reg data=newsalaries;****552 model teach_sal = edu_spen geograph area2 area3/ influence vif;****ERROR: Variable geograph in list does not match type prescribed for this list.****NOTE: The previous statement has been deleted.****553 output out=new1 h=hatdiags p=pred r=resid****554 student=stres cookd= cooksD dffits= dffits ;****555 title1 'DFBETAS for each state';****556 symbol1 value=dot pointlabel = (height = 10pt****557 '#state');****558 run;**

**WARNING: No variables specified for an SSCP matrix. Execution terminating.****NOTE: PROCEDURE REG used (Total process time):****real time 0.04 seconds****cpu time 0.03 seconds**

**NOTE: The data set WORK.NEW1 has 0 observations and 0 variables.****WARNING: Data set WORK.NEW1 was not replaced because new file is incomplete.**

**559 plot stres*pred;****----****180**

**ERROR 180-322: Statement is not valid or it is used out of proper order.**

**560 plot hatdiags*pred;****----****180**

**ERROR 180-322: Statement is not valid or it is used out of proper order.**

**561 plot cooksD*pred;****----****180**

**ERROR 180-322: Statement is not valid or it is used out of proper order.**

**562 run;**

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Fix the errors in the order they appear. When you fix the first ones the latter ones will likely go away too.

So your first error:

**ERROR: Variable geograph in list does not match type prescribed for this list.**

So GeoGraph is likely a character variable when it should be numeric to be included in a regression model for obvious reasons.

Convert the variable to a numeric variable and it will work.

Your PLOT statements later on don't make sense though, they aren't in a PROC. Wherever you're referencing is also very outdated, PLOT statements within PROC REG have been disabled for a while and PROC GPLOT is outdated as well. If you want to create a graph try SGPLOT procedures instead. Make sure to reference the correct documentation for your version of SAS/STAT which you can check using:

`proc product_status;run;`

The latest version is SAS/STAT 14.3

@tanya13 wrote:

HI I AM RUNNING THE FOLLOWING CODE IN ORDER TO COMPUTE THE VALUE OF THE DFBETAS FOR EACH STATE, BUT I AM GETTING MANY WARNINGS AND ERRORS

proc reg data=newsalaries;

model teach_sal = edu_spen geograph area2 area3/ influence vif;

output out=new1 h=hatdiags p=pred r=resid

student=stres cookd= cooksD dffits= dffits ;

title1 'DFBETAS for each state';

symbol1 value=dot pointlabel = (height = 10pt

'#state');

run;

plot stres*pred;

plot hatdiags*pred;

plot cooksD*pred;

run;

THESE ARE THE WARNINGS AND ERRORS I AM GETTING AND I HAVE TRIED REPLACING THE "PRED" WITH "GEOGRAPH" BUT THEN I GET ANOTHER ERROR. I AM USING SAS VERSION 9.4. I WOULD REALLY APPRECIATE SOME HELP WITH THIS. THANK YOU.

551 proc reg data=newsalaries;552 model teach_sal = edu_spen geograph area2 area3/ influence vif;ERROR: Variable geograph in list does not match type prescribed for this list.NOTE: The previous statement has been deleted.553 output out=new1 h=hatdiags p=pred r=resid554 student=stres cookd= cooksD dffits= dffits ;555 title1 'DFBETAS for each state';556 symbol1 value=dot pointlabel = (height = 10pt557 '#state');558 run;

WARNING: No variables specified for an SSCP matrix. Execution terminating.NOTE: PROCEDURE REG used (Total process time):real time 0.04 secondscpu time 0.03 seconds

NOTE: The data set WORK.NEW1 has 0 observations and 0 variables.WARNING: Data set WORK.NEW1 was not replaced because new file is incomplete.

559 plot stres*pred;----180

ERROR 180-322: Statement is not valid or it is used out of proper order.

560 plot hatdiags*pred;----180

ERROR 180-322: Statement is not valid or it is used out of proper order.

561 plot cooksD*pred;----180

ERROR 180-322: Statement is not valid or it is used out of proper order.

562 run;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Converting GEOGRAPH to numeric may not make sense, if the variable is not something that can be converted to numbers (like if it is a US state, then numbers don't make sense). In that case PROC GLM could be used to handle the model fit but it won't compute DFBETAS. Yes, I know, that's not fair.

You could create dummy variables and use PROC REG and computer DFBETAS.

--

Paige Miller

Paige Miller

**Available on demand!**

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

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.