bootstrapping 2 simultaneous tablesI'm wondering if anyone knows how to bootstrap or simulate two separate tables at once. For instance.
Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");
dt << Fit Model(
Y( :height ),
Effects( :weight, :age, :weight * :age ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit( Estimation Method( Lasso ), Validation Method( AICc ) )
),
);
Let's say I want to get the AICc of the values for this model in a bootstrap and have that line up with the estimates of a bootstrap?
Can I just give them both the same random seed? If so, wouldn't that make the bootstrap take twice as long?
My guess is that bootstrapping is already multithreaded?
*Edit* Well it looks like bootstrapping isn't multithreaded (from what I can tell), but Parallel Assign can't use displayboxes anyway. Crap.
Re: bootstrapping 2 simultaneous tablesYou could do the same thing by setting the random seed inside the Bootstrap() call. Random Reset() is just the function that enables you to set the internal seed for the random number generator at a specific time in your script.Re: bootstrapping 2 simultaneous tablesCute.
I was trying to do that interactively, cool that I can just do it by scripting.
I've never seen `random reset()`, it seems that it's the same as sending random seed() to `bootstrap`. Pretty cool.
This seems to do exactly what I want.
Re: bootstrapping 2 simultaneous tablesThat's great, thank you for sharing Michael!
Re: bootstrapping 2 simultaneous tablesHi Vince,
I think this script should show you how to do it. I don't know of an interactive way to do it, but you can use JSL to select multiple columns in the report and then send the Bootstrap message to one of them. The bootstrap is then performed on all tables that have a selected column. See the example below for a way to get the parameter estimates along with the corresponding AICc value.
Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");
fm = dt << Fit Model(
Y( :height ),
Effects( :weight, :age, :weight * :age ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit( Estimation Method( Lasso ), Validation Method( AICc ) )
),
);
rpt = report(fm)["Normal Lasso with AICc Validation"];
rpt["Model Summary"][NumberColBox("")] << select;
rpt["Parameter Estimates for Original Predictors"][NumberColBox("Estimate")] << select;
randomreset(10373520);
dtlst = rpt["Parameter Estimates for Original Predictors"][NumberColBox("Estimate")] << Bootstrap(10, Fractional Weights(1));
dtlst[3] << Set Name("Measure Results");
dtlst[4] << Set Name("Parameter Estimates");
dtnew = dtlst[4] << Join(
With( dtlst[3] ),
By Matching Columns( :Name( "BootID•" ) = :Name( "BootID•" ) ),
Select( dtlst[4] << Get Column Names ),
Select With( :AICc ),
Preserve Main Table Order( 1 ),
Drop Multiples( 0, 0 )
)
Hope that helps,
Michael