<?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 How do I get predicted values given the regression coefficients and a new dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601764#M174105</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA data1;
INPUT obs age healthscore cost access$;
DATALINES;
1 37.1744 2.74061 918.92 2
2 56.8510 0.98697 7.29 1
3 62.6610 2.18619 1322.09 1
4 31.3702 3.80720 930613.57 4
5 60.0573 2.12735 972069.19 2
;
RUN;

PROC GLM DATA=data1;
CLASS access;
MODEL cost= healthscore access age/ SOLUTION;
RUN;

DATA data2;
INPUT obs age healthscore access$;
DATALINES;
1 62.6610 2.18619 1
2 60.0573 2.12735 2
3 61.6390 2.06955 1
4 33.8573 4.19116 3
5 47.2659 1.12857 2
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So I have all regression coefficients from data 1, but now I want to get the predicted values (ideally, the sum of predicted values) when I plug in data2 to the pre-existing regression model. I was wondering if there is any procedure to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate any help.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2019 19:01:35 GMT</pubDate>
    <dc:creator>inbalia</dc:creator>
    <dc:date>2019-11-05T19:01:35Z</dc:date>
    <item>
      <title>How do I get predicted values given the regression coefficients and a new dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601764#M174105</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA data1;
INPUT obs age healthscore cost access$;
DATALINES;
1 37.1744 2.74061 918.92 2
2 56.8510 0.98697 7.29 1
3 62.6610 2.18619 1322.09 1
4 31.3702 3.80720 930613.57 4
5 60.0573 2.12735 972069.19 2
;
RUN;

PROC GLM DATA=data1;
CLASS access;
MODEL cost= healthscore access age/ SOLUTION;
RUN;

DATA data2;
INPUT obs age healthscore access$;
DATALINES;
1 62.6610 2.18619 1
2 60.0573 2.12735 2
3 61.6390 2.06955 1
4 33.8573 4.19116 3
5 47.2659 1.12857 2
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So I have all regression coefficients from data 1, but now I want to get the predicted values (ideally, the sum of predicted values) when I plug in data2 to the pre-existing regression model. I was wondering if there is any procedure to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate any help.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 19:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601764#M174105</guid>
      <dc:creator>inbalia</dc:creator>
      <dc:date>2019-11-05T19:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get predicted values given the regression coefficients and a new dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601767#M174106</link>
      <description>&lt;P&gt;Either &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_score_examples02.htm&amp;amp;locale=en" target="_self"&gt;PROC SCORE&lt;/A&gt;; or create a new data set by appending data2 to data1, in such a way that COST is missing for the data2 records; then re-run PROC GLM on this new dataset.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 19:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601767#M174106</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-05T19:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get predicted values given the regression coefficients and a new dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601775#M174110</link>
      <description>&lt;P&gt;PROC PLM&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=15.1&amp;amp;docsetTarget=statug_plm_examples01.htm&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=15.1&amp;amp;docsetTarget=statug_plm_examples01.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SCORE&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_score_examples02.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_score_examples02.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CODE statement + data step&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glm_syntax05.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glm_syntax05.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&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/294844"&gt;@inbalia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA data1;
INPUT obs age healthscore cost access$;
DATALINES;
1 37.1744 2.74061 918.92 2
2 56.8510 0.98697 7.29 1
3 62.6610 2.18619 1322.09 1
4 31.3702 3.80720 930613.57 4
5 60.0573 2.12735 972069.19 2
;
RUN;

PROC GLM DATA=data1;
CLASS access;
MODEL cost= healthscore access age/ SOLUTION;
RUN;

DATA data2;
INPUT obs age healthscore access$;
DATALINES;
1 62.6610 2.18619 1
2 60.0573 2.12735 2
3 61.6390 2.06955 1
4 33.8573 4.19116 3
5 47.2659 1.12857 2
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So I have all regression coefficients from data 1, but now I want to get the predicted values (ideally, the sum of predicted values) when I plug in data2 to the pre-existing regression model. I was wondering if there is any procedure to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really appreciate any help.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 19:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601775#M174110</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-05T19:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get predicted values given the regression coefficients and a new dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601780#M174112</link>
      <description>&lt;P&gt;Add your data2 data with data1 and request predicted values. Doesn't work so well for your example data but should do better for your full data, if the model makes sense :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data3;
set data1 data2;
run;

PROC GLM DATA=data3;
CLASS access;
MODEL cost= healthscore access age/ SOLUTION;
output out=data4 predicted=predCost;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Look at data4 for predicted values.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 19:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601780#M174112</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-11-05T19:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get predicted values given the regression coefficients and a new dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601791#M174117</link>
      <description>Thank you very much! I am new to SAS and couldn't figure out PROC SCORE yet, but this worked wonderfully.</description>
      <pubDate>Tue, 05 Nov 2019 20:16:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-get-predicted-values-given-the-regression-coefficients/m-p/601791#M174117</guid>
      <dc:creator>inbalia</dc:creator>
      <dc:date>2019-11-05T20:16:30Z</dc:date>
    </item>
  </channel>
</rss>

