Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
KR029
Calcite | Level 5

I am using Proc PLS for PCR. Below is the code I'm using: 

 

Code.PNG

 

I would like to understand how to calculate the "xscore=factors" columns using my raw data.

 

I have output for model effect loading and model effect weights, but I don't understand how I can use this to calculate the factors that I have outputted in the output file. 

 

Loadings.PNG

 

What is a formula that I can use to calculate the factors to match the columns in the output file using my raw input data? 

 

 

8 REPLIES 8
Reeza
Super User
Just a quick note, I've moved your post to the Statistical Procedures forum, for better responses.
PaigeMiller
Diamond | Level 26

Scores are computed using the centered and scaled x-values (in other words, each x-variable has a mean of zero and a variance of 1).

 

Then the score in dimension i for a single observation is the vector multiplication of loadings (p) times centered and scaled data values (x) transposed

 

Ti = p*x'

 

 

--
Paige Miller
KR029
Calcite | Level 5

Thank you for your response Paige. I have tried that, and the numbers are not matching. 

 

Below are the first few rows of data. The Var 1 -- Var 8 variables I have here are standardized to meet the criteria. 

 

Data.PNG

 

If I take a linear combination of Var1 -- Var 8 with the model effect loadings seen below, I calculate much larger factors than the ones in the data. Please explain how this works. 

 

Loadings.PNG

 

Thank you so much for you help on this!

PaigeMiller
Diamond | Level 26

Show your math. Show the results.

 

Make the actual input data available as a .CSV file or a SAS data set.

--
Paige Miller
KR029
Calcite | Level 5

CSV is attached with std variables, loading, and my calculations. 

PaigeMiller
Diamond | Level 26

In your spreadsheet, in cell Y2, I use the formula =SUMPRODUCT(B2:I2,P2:W2) and I get the exact same value as in cell X2

--
Paige Miller
KR029
Calcite | Level 5

Yes, I calculated cell X2 doing the same in an attempt to match factor 1, which is cell L2. But doing the sumproduct with loading weights and standardized variables does not give me factor 1. 

PaigeMiller
Diamond | Level 26

I believe the difference is a scaling factor, that the variance of column L over the entire data set (not just the 10 rows you show) must be equal to 1. Or it must be equal to eigenvalue 1, I don't really remember now, but it should be easy for you to confirm.

--
Paige Miller

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 2536 views
  • 0 likes
  • 3 in conversation