<?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: Logistic regression- restore in permanent library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957773#M373861</link>
    <description>&lt;P&gt;Perfect,&lt;BR /&gt;Only 2 questions please-&lt;BR /&gt;in your code libname x v9 'c:\temp\';&lt;BR /&gt;the name of permanent library is X&lt;BR /&gt;What is V9?? Why should you write V9?&lt;BR /&gt;Can I save in library X also normal data sets or it is only to save binary files?&lt;BR /&gt;What does it mean binary file? as i understand the binary file doesn't look like a normal data set?&lt;/P&gt;
&lt;P&gt;IS the binary file is a SAS data set file? Is it a sas file?&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jan 2025 08:38:44 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2025-01-31T08:38:44Z</dc:date>
    <item>
      <title>Logistic regression- restore in permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957711#M373839</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Let's say I am building today a logistic regression model (PD credit risk model).&lt;/P&gt;
&lt;P&gt;Then I want to score a new data in the future.&lt;/P&gt;
&lt;P&gt;This is the code how to do it.&lt;/P&gt;
&lt;P&gt;My question-&lt;/P&gt;
&lt;P&gt;Let's say that the new data will be available in the future.&lt;/P&gt;
&lt;P&gt;Then I don't want to run again the model, but I want to use the model that I build today.&lt;/P&gt;
&lt;P&gt;The code -&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT color="#FF0000"&gt;store MyModel&lt;/FONT&gt;;&amp;nbsp;&amp;nbsp;keep&amp;nbsp;the&amp;nbsp;model&amp;nbsp;in&amp;nbsp;WORK&amp;nbsp;library&amp;nbsp;&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;CODE class=" language-sas"&gt;How&amp;nbsp;can&amp;nbsp;I&amp;nbsp;keep&amp;nbsp;it&amp;nbsp;in&amp;nbsp;a&amp;nbsp;permanent&amp;nbsp;library&amp;nbsp;that&amp;nbsp;in&amp;nbsp;future&amp;nbsp;I&amp;nbsp;can&amp;nbsp;use&amp;nbsp;it?&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;CODE class=" language-sas"&gt;If&amp;nbsp;I&amp;nbsp;create&amp;nbsp;a&amp;nbsp;library&amp;nbsp;called&amp;nbsp;R_R&amp;nbsp;then&amp;nbsp;-&amp;nbsp;can&amp;nbsp;I&amp;nbsp;use&amp;nbsp;code-&amp;nbsp;&lt;FONT color="#FF0000"&gt;store R_R.MyModel&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;???&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data raw_tbl;
input sex $ age  flag@@;
cards;
Female     35    0   Male       44    0
Male       45    1   Female     47    1
Female     51    0   Female     47    0
Male       54    1   Male       47    1
Female     35    0   Female     34    0
Female     48    0   Female     56    1
Male       46    1   Female     59    1
Female     46    1   Male       59    1
Male       38    1   Female     39    0
Male       49    1   Male       42    1
Male       50    1   Female     45    0
Female     47    0   Female     30    1
Female     39    0   Female     51    0
Female     45    0   Female     43    1
Male       39    1   Male       31    0
Female     39    0   Male       34    0
Female     52    1   Female     46    0
Male       58    1   Female     50    1
Female     32    0   Female     52    1
Female     35    0   Female     51    0
;
Run;

data test_tbl;
input sex $ age;
cards;
Female     35
Male 19
Male 70
;
run;


proc format;
value Dependent_Fmt 
1 = 'Default' 
0 = 'Non_Default';
run;
 
proc genmod data=raw_tbl namelen=60 descending ;
class  sex;
model Flag=sex age/ dist=binomial link=logit  type3 wald ;
store MyModel;
output out=row_data_with_predict  p=P_subscibe xbeta=logit;
run;

/**Create data set row_data_with_predict that have row data with predict colmn called :P_subscibe***/


/***Show the coefficients in a data set***/
proc plm source=MyModel;
show parameters;
run;


/**score new data set****/
proc plm restore=MyModel;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 19:20:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957711#M373839</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-30T19:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression- restore in permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957732#M373851</link>
      <description>&lt;P&gt;Did&amp;nbsp; you try using a libname.&amp;lt;store&amp;gt; name structure with the Store statement?&lt;/P&gt;
&lt;P&gt;Like&lt;/P&gt;
&lt;PRE&gt;store somelib.MyModel;&lt;/PRE&gt;
&lt;P&gt;to place the store into to Somelib library?&lt;/P&gt;
&lt;P&gt;Standard SAS naming rules apply to all the "special" output sets if not given a library in the statement creating them they get written to the Work library. Provide the library in the name when created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 21:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957732#M373851</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-01-30T21:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression- restore in permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957759#M373856</link>
      <description>&lt;P&gt;As ballardw said ,assign a new LIBNAME to store it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Store this binary file under path "c:\temp\":&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;
libname x v9 'c:\temp\';&lt;/STRONG&gt;&lt;/FONT&gt;
proc genmod data=raw_tbl namelen=60 descending ;
class  sex;
model Flag=sex age/ dist=binomial link=logit  type3 wald ;
store&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt; x.MyModel&lt;/STRONG&gt;&lt;/FONT&gt;;
output out=row_data_with_predict  p=P_subscibe xbeta=logit;
run;&lt;/PRE&gt;
&lt;P&gt;2) Score a new dataset:&lt;/P&gt;
&lt;PRE&gt;data test_tbl;
input sex $ age;
cards;
Female     35
Male 19
Male 70
;
run;

&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;libname x v9 'c:\temp\';&lt;/STRONG&gt;&lt;/FONT&gt;

/**score new data set****/
proc plm restore=&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;x.MyModel&lt;/STRONG&gt;&lt;/FONT&gt;;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2025 02:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957759#M373856</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-31T02:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression- restore in permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957773#M373861</link>
      <description>&lt;P&gt;Perfect,&lt;BR /&gt;Only 2 questions please-&lt;BR /&gt;in your code libname x v9 'c:\temp\';&lt;BR /&gt;the name of permanent library is X&lt;BR /&gt;What is V9?? Why should you write V9?&lt;BR /&gt;Can I save in library X also normal data sets or it is only to save binary files?&lt;BR /&gt;What does it mean binary file? as i understand the binary file doesn't look like a normal data set?&lt;/P&gt;
&lt;P&gt;IS the binary file is a SAS data set file? Is it a sas file?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 08:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957773#M373861</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-31T08:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression- restore in permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957774#M373862</link>
      <description>"What is V9?? Why should you write V9?“&lt;BR /&gt;V9 is default engine of libname statement, you can ignore it . like:&lt;BR /&gt;libname x  'c:\temp\';&lt;BR /&gt;&lt;BR /&gt;"Can I save in library X also normal data sets or it is only to save binary files?"&lt;BR /&gt;Yes. Could save both dataset and binary file.&lt;BR /&gt;&lt;BR /&gt;"What does it mean binary file? "&lt;BR /&gt;It is your model save file -- x.MyModel &lt;BR /&gt;&lt;BR /&gt;"IS the binary file is a SAS data set file? Is it a sas file?"&lt;BR /&gt;It is a specical sas file for saving model .&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Jan 2025 09:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957774#M373862</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-31T09:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression- restore in permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957792#M373870</link>
      <description>I wonder why is it called binary file? Binary is 1/0.</description>
      <pubDate>Fri, 31 Jan 2025 12:31:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957792#M373870</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-31T12:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression- restore in permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957828#M373876</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I wonder why is it called binary file? Binary is 1/0.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Binary files can also refer to those not intended to be "read" by people directly. Technically all computer files are "binary" in that they are codes that resolve to 1/0 at some level, look at things like ASCII binary values for example. Open any file ending in EXE or DLL&amp;nbsp; with a text editor as an example of what a "binary file" is going to look like in general.&lt;/P&gt;
&lt;P&gt;The files will contain things that won't make linguistic sense generally when displayed using any of the text display encodings such as ASCII, UTF, EBCDIC. You might find some strings that make sense but don't count on it.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 17:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957828#M373876</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-01-31T17:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression- restore in permanent library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957870#M373885</link>
      <description>&lt;P&gt;It is an uneditable file.&lt;BR /&gt;If you want more , reach out the sas Technology Support.&lt;BR /&gt;&lt;A href="https://support.sas.com/" target="_blank" rel="noopener"&gt;https://support.sas.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2025 06:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Logistic-regression-restore-in-permanent-library/m-p/957870#M373885</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-02-01T06:45:21Z</dc:date>
    </item>
  </channel>
</rss>

