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;
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
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
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.
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.