SAS Macro : Variable Selection based on Wald Chi-Square

Variable Selection based on Univariate Analysis (Wald Chi-Square and Standardized Coefficient)
PROC LOGISTIC is run on each of the variables and tracking p-value of wald chi-square and standardized coefficient,

%macro perf(data=,targetvar=,vars=,output=);

%let n=%sysfunc(countw(&vars));
%do i=1 %to &n;
%let val = %scan(&vars,&i);

ods select none;
ods output ParameterEstimates=Estimate&i;
proc logistic data=&data;
model &targetvar(event='1')=&val / stb;

data Estimate&i;
set Estimate&i;
length Sig $15;
where Variable NE 'Intercept';
if ProbChiSq < .05 then Sig ='Significant';
else if ProbChiSq >= .05 then Sig = 'Non-Significant';
help = abs(StandardizedEst);


data &output;
set Estimate1 - Estimate&n;

proc datasets library=work
nodetails nolist;
delete Estimate1 - Estimate&n;

proc sort data = &output;
by descending help;

data &output;
set &output (drop = help DF);

%mend perf;

options symbolgen mlogic;
%perf(data=imputed ,targetvar= ins,vars= mmbal income ilsbal posamt ,output= resultf);
Spread the Word!
Related Posts
About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 10 years of experience in data science. During his tenure, he has worked with global clients in various domains like Banking, Insurance, Private Equity, Telecom and Human Resource.

4 Responses to "SAS Macro : Variable Selection based on Wald Chi-Square"
  1. This comment has been removed by the author.

  2. This comment has been removed by the author.

  3. This comment has been removed by the author.

  4. I want someone to do my assignment cheap UK formatted on these Wald chi-square hypotheses. I missed my lecture on this topic and I don’t know how to do this. This is why any professional assistance can guide me and teach me that how it is done and what it is about. If not this, then I just want my assignment to be completed on time with quality so that I may submit it to my teacher and she praises me.


Next → ← Prev