<?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: Assigning constant values from observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assigning-constant-values-from-observations/m-p/7551#M97</link>
    <description>Think about this.  As the SET statement is executable, you could read the coefficients, retain them for th DATA step, and then drop the variables from the output dataset; this is done once.  You could have a second SET statement to read in the nObs dataset.&lt;BR /&gt;
&lt;BR /&gt;
* untested code;&lt;BR /&gt;
DATA scored;&lt;BR /&gt;
IF _N_=1 then SET Coefficients;&lt;BR /&gt;
RETAIN  Var1-Var9;&lt;BR /&gt;
DROP Var1-Var9;&lt;BR /&gt;
SET NObs;&lt;BR /&gt;
Predicted = Var1 + Var2*VarA + Var9*VarX ;&lt;BR /&gt;
RUN;</description>
    <pubDate>Tue, 18 Mar 2008 02:46:52 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2008-03-18T02:46:52Z</dc:date>
    <item>
      <title>Assigning constant values from observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-constant-values-from-observations/m-p/7550#M96</link>
      <description>Hi,&lt;BR /&gt;
I have a data set containing coefficients for a regression equation (single observation with variables representing each coefficient). I would like to use the coefficients to generate predicted values in another data set of N observations. Would I be able to assign the coefficients as "constant" variables for use in the N observation data set?&lt;BR /&gt;
 &lt;BR /&gt;
Coefficients Data Set: Var1 ... Var9&lt;BR /&gt;
N Observations Data Set: VarA ... VarX&lt;BR /&gt;
                                         VarA ... VarX&lt;BR /&gt;
                                         VarA ... VarX&lt;BR /&gt;
Predicted = Var1 + Var2*VarA + Var9*VarX</description>
      <pubDate>Tue, 18 Mar 2008 01:13:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-constant-values-from-observations/m-p/7550#M96</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-03-18T01:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning constant values from observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-constant-values-from-observations/m-p/7551#M97</link>
      <description>Think about this.  As the SET statement is executable, you could read the coefficients, retain them for th DATA step, and then drop the variables from the output dataset; this is done once.  You could have a second SET statement to read in the nObs dataset.&lt;BR /&gt;
&lt;BR /&gt;
* untested code;&lt;BR /&gt;
DATA scored;&lt;BR /&gt;
IF _N_=1 then SET Coefficients;&lt;BR /&gt;
RETAIN  Var1-Var9;&lt;BR /&gt;
DROP Var1-Var9;&lt;BR /&gt;
SET NObs;&lt;BR /&gt;
Predicted = Var1 + Var2*VarA + Var9*VarX ;&lt;BR /&gt;
RUN;</description>
      <pubDate>Tue, 18 Mar 2008 02:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-constant-values-from-observations/m-p/7551#M97</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2008-03-18T02:46:52Z</dc:date>
    </item>
  </channel>
</rss>

