Bootstrapping Logistic Regression

Live Online Training : SAS Programming with 50+ Case Studies

- Explain Programming Concepts in Simple English
- Live Projects
- Scenario Based Questions
- Job Placement Assistance
- Get 10% off till Sept 25, 2017
- Batch starts from October 8, 2017

Bootstrapping Logistic Regression

Generates m new training data sets. Each new training data set picks a sample of observations with replacement (bootstrap sample) from original data set. By sampling with replacement, some observations may be repeated in each new training data set. The m models are fitted using the above m bootstrap samples and combined by averaging the output (for regression).
%MACRO boot (data=,target=, ivars=, n=,outfile=);

%DO i=1 %to &n;

data bootstrap;
choice = INT(RANUNI(23456+&i)*n)+1;
set &data POINT = choice NOBS = n;
ch = choice;
j+1;
IF j > n then stop;
run;

ods output ParameterEstimates = mest;
proc logistic data=bootstrap descending;
model &target= &ivars/ selection=stepwise stb;
run;
ods output close;

data mest;
set mest;
helper = abs (StandardizedEst);
run;

proc rank data = mest descending tied = low out=mest (drop= helper);
var helper;
ranks Importance;
run;

proc append base=&outfile data=mest;
%end;

proc means data= &outfile MIN MEAN MEDIAN MAX;
where variable ne 'Intercept';
class variable ;
var Importance;
run;

%MEND boot;

%boot(data=mydata,target= bad, ivars=var1 var2 var3, n=10,outfile=res);

SAS Tutorials : 100 Free SAS Tutorials


Statistics Tutorials : 50 Statistics Tutorials

About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has close to 7 years of experience in data science and predictive modeling. During his tenure, he has worked with global clients in various domains like retail and commercial banking, Telecom, HR and Automotive.


While I love having friends who agree, I only learn from those who don't.

Let's Get Connected: Email | LinkedIn

Get Free Email Updates :
*Please confirm your email address by clicking on the link sent to your Email*

Related Posts:

4 Responses to "Bootstrapping Logistic Regression"

  1. Pls can you provide this in Base SAS codes and not macros?

    Thanks.

    ReplyDelete
  2. Pls can you provide this in Base SAS codes and not macros?Thanks.

    ReplyDelete
  3. hello,
    i really appreciate ur great work.

    but i would like to know how would u specify categorical variable in proc logistic part of this marcro. there is no class statement O.o

    ReplyDelete
    Replies
    1. You can add class statement and define your variable there and make sure adding that categorical variable in the right hand side of model = statement.

      Delete

Next → ← Prev