Help using Base SAS procedures

proc reg VIF issues

Reply
Super Contributor
Posts: 395

proc reg VIF issues

Hi,  I'm trying to check for collinearity (using VIF), so to do variable selection using proc reg.  I need to check more than one x-var at a time, but I'm not geting any results.. but if I do one at a time it works.

WORKS:

proc reg data=Data;

model Price = Var1 / vif tol;

run;

quit; endrsubmit;

DOESN'T WORK:

proc reg data=Data;

model Price = Var1 Var2 Var3 / vif tol;

run;

quit;

Trusted Advisor
Posts: 1,300

Re: proc reg VIF issues

What exactly is the issue you are having with obtaining results?

signon task1 sascmd='C:\Program Files\SAS\SASFoundation\9.2\sas.exe';

%syslput wpath=%sysfunc(pathname(work));

rsubmit task1;

libname out "&wpath";

proc sql;

create view cars as

select *

   from sashelp.cars

  order by type;

quit;

ods output ParameterEstimates=out.pe(keep=Type Variable VarianceInflation where=(Variable ne 'Intercept'));

proc reg data=cars;

model msrp=EngineSize Cylinders Horsepower MPG_City MPG_Highway /vif tol;

by type;

quit;

run;

endrsubmit;

signoff;

Give this a try and see if you can see the output from vif

Super Contributor
Posts: 395

Re: proc reg VIF issues

For some reason when I include a variable it doesn't work, but removing it, totally works... don't understand why.. it's highly correlated with y

Ask a Question
Discussion stats
  • 2 replies
  • 477 views
  • 0 likes
  • 2 in conversation