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
- :
- Using "Make Into Matrix" in JSL

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
- Permalink
- Email to a Friend
- Report Inappropriate Content

Jul 11, 2017 5:00 AM
(2342 views)

Hi folks,

I would like to extract a table out of a report (Multivariate -> Multivariate) into a matrix as part of my script. Currently I am working with this:

```
collist = {:"X1", :"X2", :"X3", :"X4", :"X5"};
cor = Eval(Eval Expr(Multivariate(
Y( Expr(collist)),
Estimation Method( "Row-wise" ),
Matrix Format( "Square" ),
Scatterplot Matrix( 0 )
)));
r = (col <<Report)[Outline Box("Correlations")][1][1] << Make into Matrix
```

Sadly there is no documentation (?) on the message "Make into matrix" and I cannot figure out how to store the resulting matrix in a variable without the dialog appearing.

For the moment I will work with "Make into Table". But it would be great to know how to use "Make into matrix".

Cheers,

Sebastian

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Jul 11, 2017 5:29 AM
(4618 views)

```
dt = Open( "$SAMPLE_DATA/Fitness.jmp" );
multi var = dt << Multivariate(
Y( :Age, :Weight, :Oxy, :Runtime, :RunPulse, :RstPulse, :MaxPulse ),
Estimation Method( "Row-wise" ),
Matrix Format( "Square" ),
Scatterplot Matrix(
Density Ellipses( 1 ),
Shaded Ellipses( 0 ),
Ellipse Color( 3 )
)
);
multi var rep = multi var << Report;
corr = multi var rep["Correlations"][MatrixBox(1)] << Get;
```

Learn it once, use it forever!

7 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Jul 11, 2017 5:19 AM
(2340 views)

This code will bypass the dialog box. It uses the standars and documented JSL components

```
names default to here(1);
dt=open("$SAMPLE_DATA\semiconductor capability.jmp");
collist = {:"NPN1", :"PNP1", :"NPN2", :"PNP2", :"NPN3"};
cor = Eval(Eval Expr(Multivariate(//invisible,
Y( Expr(collist)),
Estimation Method( "Row-wise" ),
Matrix Format( "Square" ),
Scatterplot Matrix( 0 )
)));
r = ((cor <<Report)[Outline Box("Correlations")][1][1] << Make into data table(invisible))<<get as matrix
```

Jim

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Jul 11, 2017 5:29 AM
(4619 views)

```
dt = Open( "$SAMPLE_DATA/Fitness.jmp" );
multi var = dt << Multivariate(
Y( :Age, :Weight, :Oxy, :Runtime, :RunPulse, :RstPulse, :MaxPulse ),
Estimation Method( "Row-wise" ),
Matrix Format( "Square" ),
Scatterplot Matrix(
Density Ellipses( 1 ),
Shaded Ellipses( 0 ),
Ellipse Color( 3 )
)
);
multi var rep = multi var << Report;
corr = multi var rep["Correlations"][MatrixBox(1)] << Get;
```

Learn it once, use it forever!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Jul 11, 2017 5:35 AM
(2328 views)

Thanks a lot , Mark. That was just what I was looking for.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Jul 11, 2017 6:46 AM
(2323 views)

It's good that there are workarounds.

But, as Sebastian points out 'Make Into Matrix' does not appear in the Scripting Index as a message one can send to a 'MatrixBox()' (and the editor tooltip gives 'unknown message for object'). Yet it does appear as a context choice in the UI, and one can send the message via JSL (both giving the modal dialog he mentions).

Using Mark's (or JIm's) method, one could replicate the functionality of the dialog in scripting, but it's still a little strange.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Oct 18, 2017 5:11 PM
(1544 views)

I tried to apply this technique to the Bivariate Fit platform to retrieve Parameter Estimates. However the values are not in MatrixBox(1), but rather, they are in NumberColBox**(****13) **and I get an error trying to retrieve them. I can manually store the entire set as a global variable and retrieve the values from the resulting matrix, but I haven't found any way to do that through jsl.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Oct 18, 2017 7:25 PM
(1538 views)

You can see all of the messages available to a Number Col Box() by going to

Help==>Scripting Index==>Number Col Box

you will see that a

obj << get

Will retireve the vector of data from a Number Col Box(). Or you may want to look one level up at the Table Box() object, which the Number Col Box() is an element of, and see what messages are available to it.

Jim

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Oct 19, 2017 9:30 AM
(1495 views)

Thanks, your comments pointed me down the right path. It still seems not as elegant as the one-click method of storing the matrix as a global variable, but my script is working and that's what counts!