Hello programmers,
I am running a PLS analysis for a diet data and i want to know how i can retain the factors scores in PLS.
I am very familiar with retaining factor scores of the PCA analysis for use in my regression model but how to retain factors that are derived from PLS is a little problematic. Attached is my pls code.
proc pls data = zthree method = pls nfac=4 varss details;
model iron calc = T_mean l_mean vc_mean vd_mean vr_mean cn_mean e_mean mp_mean mr_mean /solution;
output out = pattern xscore = scorex yscore = scorey;
run;
output out = pattern xscore = scorex yscore = scorey;
Your code captures the scores into a SAS data set, does it not?
Here's some instructions and explanations on how to capture output that is shown.
https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods...
@ChuksManuel wrote:
Hello programmers,
I am running a PLS analysis for a diet data and i want to know how i can retain the factors scores in PLS.
I am very familiar with retaining factor scores of the PCA analysis for use in my regression model but how to retain factors that are derived from PLS is a little problematic. Attached is my pls code.
proc pls data = zthree method = pls nfac=4 varss details; model iron calc = T_mean l_mean vc_mean vd_mean vr_mean cn_mean e_mean mp_mean mr_mean /solution; output out = pattern xscore = scorex yscore = scorey; run;
output out = pattern xscore = scorex yscore = scorey;
Your code captures the scores into a SAS data set, does it not?
Thank you!
It so happens that the scores were actually retained and the scores that i needed for my regression model was the XScores.
@ChuksManuel wrote:
Thank you!
It so happens that the scores were actually retained and the scores that i needed for my regression model was the XScores.
I'm curious, as you wouldn't normally use the X-Scores from PLS in a regression model; they are already computed as part of a regression model, and using them in another regression model doesn't seem to make sense here.
In the PCA, i retained the rotated factor patterns and used them for regression.
In the PLC, is there a way i can retain the derived factors for use in a regression analysis?
In PLS the scores are already part of a regression. PLS is a regression.
Your terminology has changed from "scores" to "derived factors", not the same thing at all. Which part of PLS are you talking about?
I figured it out. Thanks for the help.
Yeah. I also have the same requirement, which I can deploy PLS into other language like Java or Python .
@Ksharp wrote:
Yeah. I also have the same requirement, which I can deploy PLS into other language like Java or Python .
If you have EM you can get the PMML code which Java or Python should consume.
Good news.
PLS model is available for PMML code ?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.