turn on suggestions

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

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Scripting: how to close an analysis within a For loop?

Topic Options

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

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

Jul 10, 2016 11:29 AM
(3751 views)

In the simple script below, how can I close each of the Bivariate analysis after I capture its report?

Names Default to Here **(****1)**;

dt = Current Data Table **()**;

m = **{}**;

m1 = **[]**;

m2 = **[]**;

For **(**i=**6**, i<= N Col **(**dt**)**, i++,

bv = Bivariate**(**

Y**(** Column **(**i**))**,

X**(** :mRSS **)**,

Density Ellipse**(** **0.95**, **{**Line Color**(** **{****213**, **72**, **87}** **)}** **)**,

invisible

**)**;

bvr = bv << **report**;

insert into **(**m, Column Name **(**i**))**;

m1 = m1 || bvr **[**Outline Box **(****1)]** **[** Number Col Box **(****3)]** **[****1]**;

m2 = m2 || bvr **[**Outline Box **(****1)]** **[** Number Col Box **(****4)]** **[****1]**;

**)**;

New Table **(**"CORRELATION",

New column **(**"Symbol", character, set values **(**m**))**,

New column **(**"Correlation", numeric, set values **(**m1**))**,

New column **(**"P Value", numeric, set values **(**m2**))**,

**)**;

1 ACCEPTED SOLUTION

Accepted Solutions

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

bv << **close window**;

4 REPLIES

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

bv << **close window**;

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

MS is correct, however, other issues exist in your script. I have taken the liberty to modify your script to make it work

**Names default to here(10);**

**dt = Current Data Table ();**

** **

**m = {};**

**m1 = [];**

**m2 = [];**

** **

**For (i=6, i<= N Col (dt), i++,**

** **

** bv = Bivariate(**

** Y( Column (i)),**

** X( :mRSS),**

** Density Ellipse( 0.95, {Line Color( {213, 72, 87} )} ),**

** invisible**

** **

** );**

** **

** bvr =report( bv );**

** insert into (m, Column Name (i));**

** m1 = m1 || ((bvr [Outline Box (1)] [ Number Col Box (3)])<<get) [1];**

** m2 = m2 || ((bvr [Outline Box (1)] [ Number Col Box (4)])<<get) [1];**

** bv << close window;**

** );**

** **

**New Table ("CORRELATION",**

** New column ("Symbol", character, set values (m)),**

** New column ("Correlation", numeric, set values (m1)),**

** New column ("P Value", numeric, set values (m2)),**

**);**

Jim

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

Hi Jim,

Thanks for cleaning up my simple script. Could you explain to me how the "<< get" command works? I noticed that my simple script worked well by simply adding the "bv << close window" command and leaving out the "<< get" command.

Also, you wrote "Names default to here(10);" I have to admit that I have always left this command with the value 1 without thinking that it could be a larger number. What does the "10" value do to the script?

Thank you for your help.

Sincerely,

Thierry

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

I will first explain the "Names Default to Here(10);" Quite simply, it is a typo. It should be a "1".

The "<< get" is the message, when sent to the object it is pointing to, to retrieve the values.

**bvr [Outline Box (1)] [ Number Col Box (3)])<<get**

retrieves Number Col Box(3)'s column of numbers into a list.

It is a similar to the form of retrieving the text from Outline Box(1) by specifying:

**bvr [Outline Box (1)] <<get title**

Jim