<?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: Adding and multiplying. in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356584#M2440</link>
    <description>&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input par $      EST    t;
cards;
Inter     123     7
HW      212    16
WW      78      5
;

data have2;
input FAMINC   HW   WW  ;
cards; 
122          143   897    
432          987   645
212          789   656
132          123   112
;

data have3;
set have2 ;
array t(3) (123 212 78);
i=1;
p=t(i)+hw*t(i+1)+ ww*t(i+2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 06 May 2017 02:49:49 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2017-05-06T02:49:49Z</dc:date>
    <item>
      <title>Adding and multiplying.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356576#M2439</link>
      <description>&lt;P&gt;Hello I have two data sets.&lt;/P&gt;&lt;P&gt;One data set is&lt;/P&gt;&lt;P&gt;par&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EST&amp;nbsp;&amp;nbsp;&amp;nbsp; t&lt;/P&gt;&lt;P&gt;Inter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;HW&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 212&amp;nbsp;&amp;nbsp;&amp;nbsp; 16&lt;/P&gt;&lt;P&gt;WW&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 78&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My second data set is&lt;/P&gt;&lt;P&gt;FAMINC &amp;nbsp; HW &amp;nbsp; WW&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;122&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 143&amp;nbsp;&amp;nbsp; 897&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;432&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 987&amp;nbsp;&amp;nbsp; 645&lt;/P&gt;&lt;P&gt;212&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 789&amp;nbsp;&amp;nbsp; 656&lt;/P&gt;&lt;P&gt;132&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 123&amp;nbsp;&amp;nbsp; 112&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In second data set i need a new variable p = value of inter from table1(which is 123) + value of HW from table1(which is 212) * value of column HW from table2 + value of WW from table1(which is 78) * value of column HW from table2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the output should be&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;P&gt;123 +&amp;nbsp; 212(143) +78(897) = 100305&lt;/P&gt;&lt;P&gt;123 +&amp;nbsp; 212(987) +78(645) =&lt;/P&gt;&lt;P&gt;123 +&amp;nbsp; 212(789) +78(656) =&lt;/P&gt;&lt;P&gt;123 +&amp;nbsp; 212(123) +78(112) =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please any help would be nice......&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 01:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356576#M2439</guid>
      <dc:creator>chintanpatel</dc:creator>
      <dc:date>2017-05-06T01:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adding and multiplying.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356584#M2440</link>
      <description>&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input par $      EST    t;
cards;
Inter     123     7
HW      212    16
WW      78      5
;

data have2;
input FAMINC   HW   WW  ;
cards; 
122          143   897    
432          987   645
212          789   656
132          123   112
;

data have3;
set have2 ;
array t(3) (123 212 78);
i=1;
p=t(i)+hw*t(i+1)+ ww*t(i+2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 May 2017 02:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356584#M2440</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-05-06T02:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding and multiplying.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356585#M2441</link>
      <description>&lt;P&gt;Alternatively with proc tranpose and merge step to be more robust&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input par $      EST    t;
cards;
Inter     123     7
HW      212    16
WW      78      5
;

data have2;
input FAMINC   HW   WW  ;
cards; 
122          143   897    
432          987   645
212          789   656
132          123   112
;

proc transpose data=have1 out=trans;
var est;
run;

data have3;
merge have2 trans;
retain col1_ col2_ col3_;
array t(3) col1 col2 col3;
array t2(3) col1_ col2_ col3_;
do i = 1 to 3;
if t(i) ne . then t2(i)=t(i);
end;
j=1;
p=t2(j)+hw*t2(j+1)+ ww*t2(j+2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 May 2017 02:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356585#M2441</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-05-06T02:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding and multiplying.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356590#M2442</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input par $      EST    t;
cards;
Inter     123     7
HW      212    16
WW      78      5
;

data have2;
input FAMINC   HW   WW  ;
cards; 
122          143   897    
432          987   645
212          789   656
132          123   112
;

proc transpose data=have1 out=trans;
var est;
id par;
run;
data want;
 set have2;
 if _n_=1 then set trans(rename=(hw=_hw ww=_ww));
 want=inter+_hw*hw+_ww*ww;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 May 2017 03:38:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356590#M2442</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-05-06T03:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Adding and multiplying.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356591#M2443</link>
      <description>&lt;P&gt;It looks like you're&amp;nbsp;scoring a model, can you use PROC SCORE?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks to be a linear model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or could you use the SCORE option/statement within the PROC you used? I suspect those solutions are easier than this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 03:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356591#M2443</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-06T03:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding and multiplying.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356613#M2445</link>
      <description>&lt;P&gt;I tried PROC SCORE but it's not working.&lt;/P&gt;&lt;P&gt;I think on my other post before a week you suggested me PRCO SCORE. On my other code PROC SCORE is working fine. But for this code PROC SCORE is not wokring.&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 10:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Adding-and-multiplying/m-p/356613#M2445</guid>
      <dc:creator>chintanpatel</dc:creator>
      <dc:date>2017-05-06T10:54:45Z</dc:date>
    </item>
  </channel>
</rss>

