Subscribe Bookmark RSS Feed

PLS: Save Scores, Distances, and T Squared Formulas

ih

Community Trekker

Joined:

Sep 30, 2016

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.

  1. Does anyone know the JSL message to save the score formulas?
  2. Is it possible to save the distance and T squared formulas as opposed to just the values?
2 ACCEPTED SOLUTIONS

Accepted Solutions
markbailey

Staff

Joined:

Jun 23, 2011

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!
ian_jmp

Staff

Joined:

Jun 23, 2011

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
markbailey

Staff

Joined:

Jun 23, 2011

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!
markbailey

Staff

Joined:

Jun 23, 2011

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!
ian_jmp

Staff

Joined:

Jun 23, 2011

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.

ih

Community Trekker

Joined:

Sep 30, 2016

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.

ih

Community Trekker

Joined:

Sep 30, 2016

PS: I guess there can be two solutions, who knew...