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
- :
- PLS: Save Scores, Distances, and T Squared Formula...

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

May 25, 2017 5:55 AM
(1471 views)

In the Partial Least Squares platform (at least in JMP Pro 13) it is possible to save the score formula, and to save distances and T squared values.

- Does anyone know the JSL message to save the score formulas?
- Is it possible to save the distance and T squared formulas as opposed to just the values?

2 ACCEPTED SOLUTIONS

Accepted Solutions

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

May 25, 2017 6:36 AM
(2924 views)

Solution

Select **Help** > **Scripting Index**. Click the button in the upper left corner and select **Objects**. Now scroll in the first list and select **PLS**. You will see the entire message protocol for this platform populate the second list. You will find the messages you need under *Save Columns*.

Learn it once, use it forever!

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

May 25, 2017 6:46 AM
(2916 views)

Solution

I don't think you were asking for a 'JSL solution' but the code below will reveal all the messages a PLS fit understands. This will generally be a superset of those that appear in the UI.

```
NamesDefaultToHere(1);
// Sample data
dt1 = Open("$SAMPLE_DATA/Baltic.jmp");
// Use PLS
yList = {:ls, :ha, :dt};
xList = {:v1, :v2, :v3, :v4, :v5, :v6, :v7, :v8, :v9, :v10};
pls = dt1 << Partial Least Squares(
Y( Eval(yList) ),
X( Eval(xList) ),
Fit( Method( NIPALS ), Initial Number of Factors( 10 ) )
);
// See what messages we can send to the fit (look in the log)
lrt = Report(pls)["NIPALS ?"] << getScriptableObject;
ShowProperties (lrt);
// Use one of the messages
lrt << saveXScoreFormula;
```

If what you are looking for is not in the list, you could compute it post-hoc if you know the math.

5 REPLIES

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

May 25, 2017 6:36 AM
(2925 views)

Select **Help** > **Scripting Index**. Click the button in the upper left corner and select **Objects**. Now scroll in the first list and select **PLS**. You will see the entire message protocol for this platform populate the second list. You will find the messages you need under *Save Columns*.

Learn it once, use it forever!

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

May 25, 2017 7:49 AM
(1450 views)

My apologies. In my haste, I found the older, deprecated PLS platform instead of the newer Partial Least Squares platform. My suggestion is still, sound, though. You can use the Scripting Index for the newer platform as well. It is actually the Partial Least Squares Fit object that you want to explore.

This message protocol mirrors what is available if you click the red triangle next to your fit (not the platform menu at the very top.) So you can obtain the results you want interactively or with a script.

Learn it once, use it forever!

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

May 25, 2017 6:46 AM
(2917 views)

I don't think you were asking for a 'JSL solution' but the code below will reveal all the messages a PLS fit understands. This will generally be a superset of those that appear in the UI.

```
NamesDefaultToHere(1);
// Sample data
dt1 = Open("$SAMPLE_DATA/Baltic.jmp");
// Use PLS
yList = {:ls, :ha, :dt};
xList = {:v1, :v2, :v3, :v4, :v5, :v6, :v7, :v8, :v9, :v10};
pls = dt1 << Partial Least Squares(
Y( Eval(yList) ),
X( Eval(xList) ),
Fit( Method( NIPALS ), Initial Number of Factors( 10 ) )
);
// See what messages we can send to the fit (look in the log)
lrt = Report(pls)["NIPALS ?"] << getScriptableObject;
ShowProperties (lrt);
// Use one of the messages
lrt << saveXScoreFormula;
```

If what you are looking for is not in the list, you could compute it post-hoc if you know the math.

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

May 25, 2017 7:08 AM
(1457 views)

Thank you Mark and Ian! If I could accept two answers I would.

I am not sure how I failed to find the page in the scripting index link when searching for it; I guess I need to start drilling down through the platform as you describe.

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

May 25, 2017 7:09 AM
(1455 views)