BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
CaptGrumpy
Calcite | Level 5
Hi All,

I am struggling on something at the moment and am hoping that there is someone out there that can help.

In EM, I am using Bagging With Replacement.

I have 'created 100 samples' and modelled a logistic regression to each and obtained Bagged Estimates via the Ensemble node.

There is only one target and only one input so for the 100 models, the parameters are the same in each model, the estimates are different.

I am really happy with the results.

I now wish to document the level of vairation that was found in each of the 100 samples.

My problem is that I have no idea how to 'get' the 100 samples.

They are not present in any of the libraries.

I looked at the log but could not find anything there that could help.

I found a macro 'dmbag.sas' in my program root directory but that does not seem to give me what I am after.

To be honest I am not sure what the purpose of the macro is.

For example, I inserted the following:

%DMBAG(_TRA=TEST2,_TRAIN=TEST1,_SEED= 12345, _FREQ=,_SUMFREQ=14844, _SIZE=14844,_LOOP= 100)

My sample is unweighted (no freq field) and I have 14,844 records in my sample.

The output was a dataset of 9,333 records.

A new field was created, _resamp_.

The Proc Freq for _resamp_ is

1 5365
2 2784
3 900
4 218
5 57
6 9

I am not sure if this macro does what I want it to do, it says it "PURPOSE: SELECT A BOOTSTRAP SAMPLE"

So, is there a way that I can create the 100 samples??

I am in dire need of those samples.


I would be really grateful for any help here.
1 ACCEPTED SOLUTION

Accepted Solutions
David_Duling
SAS Employee
%DMBAG is not the only code that runs during that process. I believe the easiest way to get your results is to run the process again but use a code node just after the regression node. You will be able to analyze your scored sample and then save intermediate files to any directory you choose. I hope that makes sense.

Also, I am glad to read that you are happy with the results.

View solution in original post

1 REPLY 1
David_Duling
SAS Employee
%DMBAG is not the only code that runs during that process. I believe the easiest way to get your results is to run the process again but use a code node just after the regression node. You will be able to analyze your scored sample and then save intermediate files to any directory you choose. I hope that makes sense.

Also, I am glad to read that you are happy with the results.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1553 views
  • 0 likes
  • 2 in conversation