Choose Language Hide Translation Bar
Highlighted
Level VII

## PLS: Save Scores, Distances, and T Squared Formulas

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
Highlighted
Staff

## Re: PLS: Save Scores, Distances, and T Squared Formulas

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!
Highlighted
Staff

## Re: PLS: Save Scores, Distances, and T Squared Formulas

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 5
Highlighted
Staff

## Re: PLS: Save Scores, Distances, and T Squared Formulas

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!
Highlighted
Staff

## Re: PLS: Save Scores, Distances, and T Squared Formulas

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!
Highlighted
Staff

## Re: PLS: Save Scores, Distances, and T Squared Formulas

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.

Highlighted
Level VII

## Re: PLS: Save Scores, Distances, and T Squared Formulas

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.

Highlighted
Level VII

## Re: PLS: Save Scores, Distances, and T Squared Formulas

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

Article Labels

There are no labels assigned to this post.