<?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: Applying Results of Principal Component Analysis on New Data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Applying-Results-of-Principal-Component-Analysis-on-New-Data/m-p/230059#M54448</link>
    <description>&lt;P&gt;Thanks - I'll give this a shot tonight.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Less on the procedure but more on the theory side... Once I get the new data scored, it is then appropriate to hand-code the regression equation using the beta coefficients from the old data, and substituting the new scored data in? Greatly appreciate the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
    <pubDate>Thu, 15 Oct 2015 12:01:51 GMT</pubDate>
    <dc:creator>mgilbert</dc:creator>
    <dc:date>2015-10-15T12:01:51Z</dc:date>
    <item>
      <title>Applying Results of Principal Component Analysis on New Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-Results-of-Principal-Component-Analysis-on-New-Data/m-p/229983#M54439</link>
      <description>&lt;P&gt;I started with a small data set (under 20 variables) and conducted truncation, trimming, and imputing. I finally prepped the data where I wanted it to be, and ran PROC PRINCOMP. I then used the results to run a regression model where my response variable (TARGET_WINS) = specified principal components (and only principal components).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm now tasked with applying my model to another data set and scoring it. This new data set is a clone of my original data set, except it has fewer observations and&lt;EM&gt; no response variable&lt;/EM&gt;. If this were a "normal" regression and I did not use principal components, I could construct the beta coefficients from the parameter estimates, and simply substitute the variables in the new data set to create the predicted values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But (as far as I know) since principal components are &lt;EM&gt;relative&lt;/EM&gt; to the other data in the data set, &lt;EM&gt;I have absolutely no clue&lt;/EM&gt; how to go about this. I can create the new principal components in the new data set, but since there's no response variable, I can't model it via PROC REG and score the predicted values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've taken a look at PROC SCORE, but have not had much luck. I have stored the OUTSTAT from PROC PRINCOMP in the original data set, and reduced it to only have principal components used in the regression model (from &lt;A href="https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_score_sect005.htm" target="_blank"&gt;here&lt;/A&gt; and &lt;A href="http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html" target="_blank"&gt;here&lt;/A&gt;). Any thoughts?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 21:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-Results-of-Principal-Component-Analysis-on-New-Data/m-p/229983#M54439</guid>
      <dc:creator>mgilbert</dc:creator>
      <dc:date>2015-10-14T21:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Applying Results of Principal Component Analysis on New Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-Results-of-Principal-Component-Analysis-on-New-Data/m-p/229993#M54441</link>
      <description>&lt;P&gt;Use ODS to get the eigenvectors and then proc score to get the component scores. Here is an example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Keep the first 50 observations for scoring. 
 Compute the two first principal components on the rest */
proc princomp data=sashelp.cars(firstobs=51) n=2 cov;
var engineSize cylinders horsepower weight wheelbase length;
ods output Eigenvectors=EV;
run;

proc transpose data=ev out=evTransposed;
var Prin1 Prin2;
id Variable;
run;

data prinScore;
set evTransposed;
_TYPE_ = "SCORE";
run;

/* Compute the first two component scores for the 
 first 50 observations */
proc score data=sashelp.cars(obs=50) score=prinScore out=scoredCars; 
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Oct 2015 02:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-Results-of-Principal-Component-Analysis-on-New-Data/m-p/229993#M54441</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-15T02:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Applying Results of Principal Component Analysis on New Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-Results-of-Principal-Component-Analysis-on-New-Data/m-p/230059#M54448</link>
      <description>&lt;P&gt;Thanks - I'll give this a shot tonight.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Less on the procedure but more on the theory side... Once I get the new data scored, it is then appropriate to hand-code the regression equation using the beta coefficients from the old data, and substituting the new scored data in? Greatly appreciate the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 12:01:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-Results-of-Principal-Component-Analysis-on-New-Data/m-p/230059#M54448</guid>
      <dc:creator>mgilbert</dc:creator>
      <dc:date>2015-10-15T12:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Applying Results of Principal Component Analysis on New Data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-Results-of-Principal-Component-Analysis-on-New-Data/m-p/230266#M54474</link>
      <description>&lt;P&gt;If&amp;nbsp;"beta coefficients from the old data" means "beta coefficients from the regression that uses the prinipal components as explanatory variables," then the answer is yes.&amp;nbsp; Remember that the prinipal components are just linear combinations of your original explanatory variables.&amp;nbsp;When you score the new data, you are creating coordinates in a new coordinate system in which the prinipal components replace the usual (x,y,z,...) coordinates. Mathematically, this is called a change of basis.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 12:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-Results-of-Principal-Component-Analysis-on-New-Data/m-p/230266#M54474</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-10-16T12:40:28Z</dc:date>
    </item>
  </channel>
</rss>

