Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Created:
Mar 4, 2020 8:37 AM
| Last Modified: Mar 4, 2020 8:52 AM
(1435 views)

I'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.

Vince Faller - Predictum

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Hi 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

Michael Crotty

Sr Statistical Writer

JMP Development

Sr Statistical Writer

JMP Development

4 REPLIES 4

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Hi 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

Michael Crotty

Sr Statistical Writer

JMP Development

Sr Statistical Writer

JMP Development

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: bootstrapping 2 simultaneous tables

That's great, thank you for sharing Michael!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: bootstrapping 2 simultaneous tables

Cute.

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.

Vince Faller - Predictum

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: bootstrapping 2 simultaneous tables

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

Michael Crotty

Sr Statistical Writer

JMP Development

Sr Statistical Writer

JMP Development

Article Labels

There are no labels assigned to this post.