<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: factor score construction from proc pls in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422011#M22218</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;Could you give me their contact information (people who produced the procedure pls in SAS company)?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, I cannot do this because I don't know their contact information, or even their names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I think their source code for the factor score from proc pls when method is pcr, rrr, or pls will be very helpful. Thank you so much!&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;While I don't speak for SAS, I'm quite sure they do not give out source code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You haven't repsonded to my comments about how I can easily reproduce the scores in my example. If you are going to make progress, this (or similar) forum is the only way to get there.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Dec 2017 15:45:10 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2017-12-18T15:45:10Z</dc:date>
    <item>
      <title>factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421702#M22183</link>
      <description>&lt;P&gt;Could professionals (in proc pls) from SAS company help me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am very curious about how is the&amp;nbsp;factor score constructed (output xscore=)&amp;nbsp;in proc pls. I have searched out online (&lt;A href="http://support.minitab.com/en-us/minitab/17/topic-library/modeling-statistics/multivariate/principal-components-and-factor-analysis/what-is-a-factor-score/" target="_blank"&gt;http://support.minitab.com/en-us/minitab/17/topic-library/modeling-statistics/multivariate/principal-components-and-factor-analysis/what-is-a-factor-score/&lt;/A&gt;) about the definition of factor score---"To calculate the factor score, multiply the coefficients with your data."..."You must standardize the variables to obtain the correct factor score."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the XWeights&amp;nbsp;should be&amp;nbsp;the coefficients and I have tried&amp;nbsp;to use them to&amp;nbsp;construct the factor score. For each participant, I calculate the sum of 58 (the number of food groups) products between the&amp;nbsp;xweight and standardized food intake, and then&amp;nbsp;I verify whether the sum equals the factor score obtained from "output xscore=". However, for each participant, the sum of products based on xweights and standardized food intake does not equal the factor score directly obtained from proc pls (output xscore=) no matter what method (pcr, rrr,&amp;nbsp;or pls) has been used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For PCA done via proc factor, I have verified that&amp;nbsp;for each participant, the sum of the 58 (the number of food groups) products between the factor coefficient&amp;nbsp;(statistics&amp;nbsp;in _type_="score"&amp;nbsp;from "outstat=") and standardized food intake equals the factor score directly obtained from proc factor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cannot figure out&amp;nbsp;how the&amp;nbsp;xscore is constructed from proc pls. Could someone help me with this issue? Thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 21:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421702#M22183</guid>
      <dc:creator>xcong</dc:creator>
      <dc:date>2017-12-15T21:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421703#M22184</link>
      <description>&lt;P&gt;In dimension 1, the score should be equal to the sum of the (data*xweight1) values (sum over all variables), where data is properly centered and scaled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In dimension 2, the score should be equal to the sum of the (deflated data)*(xweight2), (sum over all variables) where deflated data is the data after the predictions from Dimension 1&amp;nbsp;are removed (in other words, these are the residuals after dimension 1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And so on&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 20:34:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421703#M22184</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-12-15T20:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421714#M22187</link>
      <description>&lt;P&gt;Thank you so much for the response.&lt;/P&gt;&lt;P&gt;I think I already standardize the data into mean 0 and SD 1. I calculated the sum of the (standardized data*xweight1) values but the sum does not equal the factor score corresponding to the first factor (scorex1 if "&lt;SPAN style="background: white; margin: 0px; font-family: 'Times New Roman',serif; font-size: 12pt;"&gt;&lt;FONT color="#000000"&gt;output xscore=&lt;/FONT&gt;&lt;/SPAN&gt;scorex"; &amp;nbsp;in "xscore=scorex", scorex is the prefix and scorex1 means the factor score corresponding to the first factor).&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 21:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421714#M22187</guid>
      <dc:creator>xcong</dc:creator>
      <dc:date>2017-12-15T21:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421717#M22188</link>
      <description>&lt;P&gt;Can you post your code and we can replicate your process to see where you may be going wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that it says the variables are centered and scaled, I'm assuming that you would use PROC STDIZE to do this and try and replicate the calculations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PLS procedure does have some more details in the Details section of the documentation on how these are calculated, if that's helpful at all. Not sure why you're referencing MiniTab documentation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_pls_details01.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_pls_details01.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, please note that this forum is not only SAS employees, some are, but the majority are users just like yourself.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want an answer from SAS directly, perhaps SAS tech support would be a more appropriate route.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 21:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421717#M22188</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-15T21:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421967#M22204</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182828"&gt;@xcong&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you so much for the response.&lt;/P&gt;
&lt;P&gt;I think I already standardize the data into mean 0 and SD 1.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You say: "I think", that's not good enough, especially if you can't get the&amp;nbsp; calculations to work. You need to confirm that the data has been standardized before you do these calculations.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I calculated the sum of the (standardized data*xweight1) values but the sum does not equal the factor score corresponding to the first factor (scorex1 if "&lt;SPAN&gt;&lt;FONT color="#000000"&gt;output xscore=&lt;/FONT&gt;&lt;/SPAN&gt;scorex"; &amp;nbsp;in "xscore=scorex", scorex is the prefix and scorex1 means the factor score corresponding to the first factor).&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you have made a mathematical mistake somewhere. This process works properly for me, for example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods output xweights=xweight xloadings=xloading;
proc pls data=sashelp.cars nfac=2 details;
	model msrp=horsepower weight;
	output out=pls_stats xscore=t;
run;
proc standard data=sashelp.cars out=cars_std mean=0 std=1;
	var horsepower weight;
run;&lt;/PRE&gt;
&lt;P&gt;Using the data values in data set cars_std, multiplying by the dimension 1 xweight, then adding up across the two variables in the model (horsepower and weight) gives me the exact score shown in the data set PLS_STATS.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 13:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/421967#M22204</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-12-18T13:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422005#M22215</link>
      <description>&lt;P&gt;Could you give me their contact information (people who produced the procedure pls in SAS company)? I think their source code for the factor score from proc pls when method is pcr, rrr, or pls will be very helpful. Thank you so much!&lt;/P&gt;&lt;P&gt;I have sent a note to SAS company and they directed me to these forums. Maybe I did not contact the&amp;nbsp;right person.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422005#M22215</guid>
      <dc:creator>xcong</dc:creator>
      <dc:date>2017-12-18T15:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422011#M22218</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;Could you give me their contact information (people who produced the procedure pls in SAS company)?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, I cannot do this because I don't know their contact information, or even their names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I think their source code for the factor score from proc pls when method is pcr, rrr, or pls will be very helpful. Thank you so much!&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;While I don't speak for SAS, I'm quite sure they do not give out source code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You haven't repsonded to my comments about how I can easily reproduce the scores in my example. If you are going to make progress, this (or similar) forum is the only way to get there.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422011#M22218</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-12-18T15:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422013#M22220</link>
      <description>&lt;P&gt;If you don't have a valid SAS license then you don't have access to SAS tech support. I'm going to guess that's the case here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's unlikely you'll get the source code, since it's proprietary, but you can likely find the calculations in the details and reference section.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:45:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422013#M22220</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-18T15:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422016#M22221</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182828"&gt;@xcong&lt;/a&gt;&amp;nbsp;given&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;ability to recreate the scores, it's likely that you're doing something incorrectly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case the best solution is to provide a fully worked example so that we can replicate your issue, otherwise we have to assume user error or gremlins.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:48:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422016#M22221</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-18T15:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422021#M22222</link>
      <description>&lt;P&gt;Thank you so much for the response.&lt;/P&gt;&lt;P&gt;I can confirm I have already standardized the data before proc pls. I think it is a great way for us to use the same common data to discuss this statistical problem, since I cannot&amp;nbsp;reveal the data or specific SAS code&amp;nbsp;from the research project to others due&amp;nbsp;to the contract. My research project will use proc pls but the&amp;nbsp;method is&amp;nbsp;rrr instead of pls. The number of response variables are two or three&amp;nbsp;and the number of predictor variables will be about 50. I used the data sashelp.cars similarly with the research project with two response variables (msrp and invoice) and four predictor variables (weight, length, Wheelbase, and MPG_Highway).&lt;/P&gt;&lt;P&gt;Based on the following code I wrote, using the data values in data set cars_std, multiplying by the dimension 1 xweight, then adding up across the&amp;nbsp;four (predictor) variables in the model gives me the exact score&amp;nbsp;from proc pls ONLY when method is pls (which is the default method in proc pls as your code indicated. However, this procedure to calculate factor score does not work for method rrr and pcr. Please refer to the following code I have written). Could you help me with this issue? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*standardize to mean 0 std 1*/&lt;BR /&gt;proc standard data=sashelp.cars out=cars_std mean=0 std=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var weight length Wheelbase MPG_Highway;&lt;BR /&gt;run;&lt;BR /&gt;/*standardized car para*/&lt;BR /&gt;data car_std_para;&lt;BR /&gt;&amp;nbsp; set cars_std (keep=weight length Wheelbase MPG_Highway);&lt;BR /&gt;&amp;nbsp; id=_n_;&lt;BR /&gt;run;&lt;BR /&gt;proc transpose data=car_std_para out=car_std_para prefix=id_;&lt;BR /&gt;&amp;nbsp; id id;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=car_std_para; by _name_; run;&lt;/P&gt;&lt;P&gt;/*proc pls; 3 methods: pcr, rrr, or pls*/&lt;BR /&gt;/*factor analysis*/&lt;BR /&gt;%macro fa_pls_car (m, nfct, topic);&lt;BR /&gt;ods listing close;&lt;BR /&gt;ods output XLoadings=&amp;amp;m._&amp;amp;nfct._xld;&lt;BR /&gt;ods output XWeights=&amp;amp;m._&amp;amp;nfct._xwt;&lt;BR /&gt;proc pls data=cars_std method=&amp;amp;m. nfac=&amp;amp;nfct. varss details censcale varscale;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title "&amp;amp;topic. (&amp;amp;nfct. factors) based on 4 car parameters";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model msrp invoice=weight length Wheelbase MPG_Highway/solution;&lt;BR /&gt;&amp;nbsp; output out=car_&amp;amp;m._&amp;amp;nfct. xscore=scorex yscore=scorey;&lt;BR /&gt;run;&lt;BR /&gt;ods listing;&lt;BR /&gt;%mend;&lt;BR /&gt;%fa_pls_car(pcr,3, Principal components regression);&lt;BR /&gt;%fa_pls_car(pcr,2, Principal components regression);&lt;BR /&gt;%fa_pls_car(rrr,2, Reduced rank regression);&lt;BR /&gt;%fa_pls_car(pls,2, Partial least squares);&lt;/P&gt;&lt;P&gt;/*calculate factor score*/&lt;BR /&gt;%macro calc_fs_proc_pls_car(m,nfct,v,n);&lt;BR /&gt;proc transpose data=&amp;amp;m._&amp;amp;nfct._&amp;amp;v.(drop=NumberOfFactors) out=tmp0; run;&lt;BR /&gt;proc sort data=tmp0; by _name_; run;&lt;BR /&gt;data tmp1;&lt;BR /&gt;&amp;nbsp; merge car_std_para tmp0;&lt;BR /&gt;&amp;nbsp; by _name_;&lt;BR /&gt;&amp;nbsp; array qt id_1-id_&amp;amp;n.;&lt;BR /&gt;&amp;nbsp; array score1 sc_1-sc_&amp;amp;n.;&lt;BR /&gt;&amp;nbsp; do over qt;&lt;BR /&gt;&amp;nbsp; score1=col1*qt;&lt;BR /&gt;&amp;nbsp; /*multiply the factor coefficient (xweight) or other stat for factor1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with standardized data (mean 0 std 1)*/&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;&amp;nbsp;create table tmp2 (keep=fs_:) as&lt;BR /&gt;&amp;nbsp;select&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do i=1 %to &amp;amp;n.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;sum(sc_&amp;amp;i.) as fs_&amp;amp;i&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if &amp;amp;i. ne &amp;amp;n. %then %do; , %end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;BR /&gt;&amp;nbsp; from tmp1;&lt;BR /&gt;quit;&lt;BR /&gt;proc transpose data=tmp2 out=tmp2; run;&lt;BR /&gt;data tmp3 (keep=id scorex1);&lt;BR /&gt;&amp;nbsp; set car_&amp;amp;m._&amp;amp;nfct.;&lt;BR /&gt;&amp;nbsp; id=_n_;&lt;BR /&gt;run;&lt;BR /&gt;data fs_&amp;amp;m._&amp;amp;nfct._&amp;amp;v. (keep=id col1);&lt;BR /&gt;&amp;nbsp; set tmp2; id=_n_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title "&amp;amp;m._&amp;amp;nfct._&amp;amp;v.";&lt;BR /&gt;proc means data=fs_&amp;amp;m._&amp;amp;nfct._&amp;amp;v.; var col1; run;&lt;BR /&gt;proc means data=tmp3; var scorex1; run;&lt;/P&gt;&lt;P&gt;data diff_fs_&amp;amp;m._&amp;amp;nfct._&amp;amp;v.;&lt;BR /&gt;&amp;nbsp; merge fs_&amp;amp;m._&amp;amp;nfct._&amp;amp;v. tmp3;&lt;BR /&gt;&amp;nbsp; by id;&lt;BR /&gt;&amp;nbsp; length diff_fs_ind $ 20;&lt;BR /&gt;&amp;nbsp; diff_fs=scorex1-col1;&lt;BR /&gt;&amp;nbsp; if diff_fs&amp;lt;0.01 then diff_fs_ind="diffrence &amp;lt;0.01";&lt;BR /&gt;&amp;nbsp; else diff_fs_ind="diffrence&amp;gt;=0.01";&lt;BR /&gt;run;&lt;BR /&gt;proc freq data=diff_fs_&amp;amp;m._&amp;amp;nfct._&amp;amp;v.; tables diff_fs_ind; run;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;/*For each car, the sum of the&amp;nbsp;4&amp;nbsp;products&amp;nbsp;btw the factor coefficient ("xweight")&amp;nbsp;&amp;nbsp;&lt;BR /&gt;and standardized&amp;nbsp;parameter (mean 0 std 1) does not equal to the factor score directly obtained from proc pls when method is pcr or rrr.&lt;/P&gt;&lt;P&gt;This calculation only works when method is pls*/&lt;BR /&gt;%calc_fs_proc_pls_car(pcr,3,xwt,428);&lt;BR /&gt;%calc_fs_proc_pls_car(pcr,2,xwt,428);&lt;BR /&gt;%calc_fs_proc_pls_car(rrr,2,xwt,428);&lt;BR /&gt;%calc_fs_proc_pls_car(pls,2,xwt,428);&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422021#M22222</guid>
      <dc:creator>xcong</dc:creator>
      <dc:date>2017-12-18T15:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422028#M22224</link>
      <description>&lt;P&gt;I feel totally confused about your first sentence.&amp;nbsp;Have I done something inappropriate?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 16:11:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422028#M22224</guid>
      <dc:creator>xcong</dc:creator>
      <dc:date>2017-12-18T16:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422029#M22225</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;You haven't repsonded to my comments about how I can easily reproduce the scores in my example&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;You do not know how to calculate the score by yourself? I feel totally confused about this sentence.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 16:16:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422029#M22225</guid>
      <dc:creator>xcong</dc:creator>
      <dc:date>2017-12-18T16:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422031#M22226</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;/*For each car, the sum of the&amp;nbsp;4&amp;nbsp;products&amp;nbsp;btw the factor coefficient ("xweight")&amp;nbsp;&amp;nbsp;&lt;BR /&gt;and standardized&amp;nbsp;parameter (mean 0 std 1) does not equal to the factor score directly obtained from proc pls when method is pcr or rrr.&lt;/P&gt;
&lt;P&gt;This calculation only works when method is pls*/&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is different than your original statement, where it did not work for PLS, but now it does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The algorithms for RRR and PCR are different than PLS. I believe you'd need to do some research on the exact algorithm in order to obtain the formula to obtain the score from the data value and PLS weight.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact, I have no idea what the PCR option in PROC PLS does, despite what the documentation says. The scores from PROC PRINCOMP and the scores from using the PCR option in PROC PLS do not match. If you use PROC PRINCOMP, then the score is easily calculated from the PROC PRINCOMP loading times the standardized data value, and then adding these up. I suspect that the PROC PLS scores using method=PLS are not really scores, they are multiplied by sort of regression coefficient, but honestly I do not know for sure. In fact, that would be a good question for someone at SAS to answer, why does PROC PRINCOMP and PROC PLS with the PCR option give different scores but the same loadings? (And furthermore, I would never recommend using the PCR option in PROC PLS, it seems to me to have no legitimate purpose other than to allow users to access algorithms that were popular 30 years ago but are inferior to current methods)&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 16:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422031#M22226</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-12-18T16:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422037#M22227</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182828"&gt;@xcong&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I feel totally confused about your first sentence.&amp;nbsp;Have I done something inappropriate?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, just saying that your code is likely incorrect and until we see it there's not much else that could have been said. You already posted an example above which clarifies why you're not getting the correct results.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 16:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422037#M22227</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-18T16:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422065#M22228</link>
      <description>&lt;P&gt;Thank you so much for the response. I have posted my code. Will it facilitate you to help me find whether there is something wrong within the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already tried my best to find the algorithms from SAS documents (e.g. &lt;A href="https://support.sas.com/documentation/onlinedoc/stat/131/pls.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/131/pls.pdf&lt;/A&gt;) for the factor score when method is rrr&amp;nbsp;or pls when using proc pls, but I cannot find any relevant information. That is why I have to post this question on this forum to ask for help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 17:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422065#M22228</guid>
      <dc:creator>xcong</dc:creator>
      <dc:date>2017-12-18T17:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422069#M22229</link>
      <description>&lt;P&gt;The regression page I originally linked to has the details but it's in linear algebra terms.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_pls_details01.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug_pls001199" target="_blank"&gt;http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_pls_details01.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug_pls001199&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately I don't have the time to delve into such a topic at this moment, but I suspect most of what you're after is in the link above.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally, there's the reference section with the academic references that are used for the procedure.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 17:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422069#M22229</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-18T17:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422073#M22231</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182828"&gt;@xcong&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you so much for the response. I have posted my code. Will it facilitate you to help me find whether there is something wrong within the code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have already tried my best to find the algorithms from SAS documents (e.g. &lt;A href="https://support.sas.com/documentation/onlinedoc/stat/131/pls.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/131/pls.pdf&lt;/A&gt;) for the factor score when method is rrr&amp;nbsp;or pls when using proc pls, but I cannot find any relevant information. That is why I have to post this question on this forum to ask for help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you again!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As I tried to explain, I don't think the problem is your code specifically, I think the problem is that the algorithm for RRR and PCR is doing something different than the PLS algorithm, and so the scores are NOT necessarily the sum of the products (data*xweight). Either that or PROC PLS is giving the&amp;nbsp;&lt;EM&gt;wrong&lt;/EM&gt; scores for RRR and PCR. But that's not something I plan on digging into, you can dig into the formulas and see if you can figure out how to calculate scores in those cases.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 18:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/422073#M22231</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-12-18T18:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/423350#M22283</link>
      <description>&lt;P&gt;Could someone else help me with this issue? About the factor score construction when method is pcr or rrr for proc pls?&lt;/P&gt;&lt;P&gt;Or how could I contact with the technicians/specialists from SAS company to resolve this problem?&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 18:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/423350#M22283</guid>
      <dc:creator>xcong</dc:creator>
      <dc:date>2017-12-22T18:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/423352#M22284</link>
      <description>&lt;P&gt;You could call SAS Technical Support directly.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 18:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/423352#M22284</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-12-22T18:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: factor score construction from proc pls</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/424978#M22350</link>
      <description>&lt;P&gt;Thank you so much for all the responses!&lt;/P&gt;&lt;P&gt;However, I do not think this problem is resolved.&lt;/P&gt;&lt;P&gt;I will try my best to contact with the technicians from SAS company (I may need the SAS license number based on the previous responses; I think I should have one since I can use SAS on the computer) to resolve this problem.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 16:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/factor-score-construction-from-proc-pls/m-p/424978#M22350</guid>
      <dc:creator>xcong</dc:creator>
      <dc:date>2018-01-04T16:43:01Z</dc:date>
    </item>
  </channel>
</rss>

