BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChuksManuel
Pyrite | Level 9

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;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
output out = pattern xscore = scorex yscore = scorey;

Your code captures the scores into a SAS data set, does it not?

--
Paige Miller

View solution in original post

11 REPLIES 11
Reeza
Super User

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;

 

PaigeMiller
Diamond | Level 26
output out = pattern xscore = scorex yscore = scorey;

Your code captures the scores into a SAS data set, does it not?

--
Paige Miller
ChuksManuel
Pyrite | Level 9

Thank you!

It so happens that the scores were actually retained and the scores that i needed for my regression model was the XScores.

 

PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
ChuksManuel
Pyrite | Level 9

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?

 

PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
ChuksManuel
Pyrite | Level 9

I figured it out. Thanks for the help.

Ksharp
Super User

Yeah. I also have the same requirement, which I can deploy PLS into other language like Java or Python .

Reeza
Super User

@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. 

Ksharp
Super User

Good news.

PLS model is available for PMML code ?

Reeza
Super User
I don't know that one....but what happens if you build a model that has a code node and generate the PMML from that? I'd test it and see what happens if you have EM but unfortunately I don't have access to EM to test anything 😞

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 911 views
  • 4 likes
  • 4 in conversation