<?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: Simple regression-score a new data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Simple-regression-score-a-new-data/m-p/957003#M373621</link>
    <description>&lt;P&gt;What "binary" file are you talking about?&lt;/P&gt;
&lt;P&gt;You first step is storing the estimated coefficients into the dataset&amp;nbsp;&amp;nbsp;model_tbl. Which your PROC SCORE step uses to calculate predicted values for the new data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the datasets stored in some library other than WORK then use a TWO LEVEL name, just like you used to reference the dataset SASHELP.CARS in the first step of your program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use a LIBNAME statement to make a new libref if you need one.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2025 17:53:49 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-01-23T17:53:49Z</dc:date>
    <item>
      <title>Simple regression-score a new data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-regression-score-a-new-data/m-p/957001#M373619</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Here are 3 ways how to score a new data&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;I want to ask please about way3-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;store work.MSRP_Model;&lt;/P&gt;
&lt;P&gt;As I understand a binary temporary file is created.&lt;/P&gt;
&lt;P&gt;Where can I see this file? in work library?&lt;/P&gt;
&lt;P&gt;How can I create it in a permanent library?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*****HOW TO SCORE NEW DATA*****/
/*****HOW TO SCORE NEW DATA*****/
/*****HOW TO SCORE NEW DATA*****/


/*****WAY1***/
/*****WAY1***/
/*****WAY1***/
proc reg data=sashelp.cars outest=model_tbl;
PredMSRP: model msrp = horsepower  mpg_city  weight;
run;
/*We created data set called model_tbl**/
 
proc surveyselect data=sashelp.cars out=to_score_tbl(drop=numberhits) n=10
m=urs seed=12345;
run;
/*We created data set called to_score_tbl**/

proc score data=to_score_tbl score=model_tbl type=parms predict out=new_pred;
var horsepower mpg_city weight;
run;
/*We created data set called new_pred**/


/*****WAY2***/
/*****WAY2***/
/*****WAY2***/
%let Path = /usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Example.sas;
proc reg data=sashelp.cars;
model msrp = horsepower mpg_city weight;
code file="&amp;amp;Path";
run;
/**We didnt create a dataset**/

proc surveyselect data=sashelp.cars out=to_score_tbl(drop=numberhits) n=10
m=urs seed=12345;
run;
/*We created data set called to_score_tbl**/

data new_pred;
set to_score_tbl;
%include "&amp;amp;Path";
run;
/*We created data set called new_pred**/


/*****WAY3***/
/*****WAY3***/
/*****WAY3***/
proc delete data=work._all_;Run;
proc reg data=sashelp.cars;
model msrp = horsepower mpg_city weight;
store work.MSRP_Model;
run;
/*binary file will be saved to a SAS library*/
/*It is better to save this to a permanent location, rather than a temporary location used in this example*/

proc surveyselect data=sashelp.cars out=to_score_tbl(drop=numberhits) n=10
m=urs seed=12345;
run;
/*We created data set called to_score_tbl**/

proc plm restore=work.MSRP_Model;
score data=to_score_tbl out=new_pred;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jan 2025 17:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-regression-score-a-new-data/m-p/957001#M373619</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-23T17:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Simple regression-score a new data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-regression-score-a-new-data/m-p/957003#M373621</link>
      <description>&lt;P&gt;What "binary" file are you talking about?&lt;/P&gt;
&lt;P&gt;You first step is storing the estimated coefficients into the dataset&amp;nbsp;&amp;nbsp;model_tbl. Which your PROC SCORE step uses to calculate predicted values for the new data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the datasets stored in some library other than WORK then use a TWO LEVEL name, just like you used to reference the dataset SASHELP.CARS in the first step of your program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use a LIBNAME statement to make a new libref if you need one.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 17:53:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-regression-score-a-new-data/m-p/957003#M373621</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-23T17:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simple regression-score a new data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-regression-score-a-new-data/m-p/957004#M373622</link>
      <description>&lt;P&gt;There's no reason to LOOK AT this item store named WORK.MSRP_MODEL. According to &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_introcom_sect068.htm" target="_self"&gt;the documentation&lt;/A&gt;, "&lt;SPAN&gt;An item store is a binary file format that cannot be modified by the user." Looking at a binary file is really pointless. If you really want to convince yourself that it exists after you run PROC REG, you can use the code below. That same link shows how to store it in a permanent library.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets library=work;
run; quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 17:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-regression-score-a-new-data/m-p/957004#M373622</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-01-23T17:57:31Z</dc:date>
    </item>
  </channel>
</rss>

