<?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: score  new data-logistic regression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957092#M373648</link>
    <description>&lt;P&gt;Okay now I think I understand&lt;/P&gt;
&lt;P&gt;ods output parameterestimates=Coef_tbl;&lt;/P&gt;
&lt;P&gt;is just to&amp;nbsp; save the coefficients in a real data set and be able to see them.&lt;/P&gt;
&lt;P&gt;This code is working 100%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*****WAY2--Work good****/&lt;BR /&gt;ods output parameterestimates=Coef_tbl;
proc genmod data=raw_tbl namelen=60 descending ;
class  sex;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
store MyRonModel;
output out=row_data_with_predict  p=P_subscibe xbeta=logit;
ODS SELECT ModelANOVA;
run;
/**Create data set row_data_with_predict that have row data with predict colmn called :P_subscibe***/


/***Show the coefficients in print screen----to verify that store statement stored the coef***/
proc plm source=MyRonModel;
show parameters;
run;


/**score new data set****/
proc plm restore=MyRonModel;
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>Fri, 24 Jan 2025 11:52:37 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2025-01-24T11:52:37Z</dc:date>
    <item>
      <title>score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957005#M373623</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Lets say I want to develop a logistic regression model and then apply it to score a new data set.&lt;/P&gt;
&lt;P&gt;raw_tbl data set is the data set on which I build the regression model&lt;/P&gt;
&lt;P&gt;test_tbl data set is the data set that I want to score using the logistic model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to ask about WAY2- what is the way to score the new data using WAY2??&lt;/P&gt;
&lt;P&gt;When I use statement&amp;nbsp;ods output parameterestimates=ttt;&lt;/P&gt;
&lt;P&gt;then what happen?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I score the new data using Way2?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* people are asked whether or not they would subscribe to a new newspaper*/
/*For each person variables sex (Female, Male), age, and subs (1=yes, 0=no) are recorded.*/
data raw_tbl;
input sex $ age subs @@;
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 = 'accept' 
0 = 'reject';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*********WAY1***/
/*********WAY1***/
/*********WAY1***/
proc probit data=raw_tbl;
class sex;
model subs(event="accept")=sex age / d=logistic itprint;
format subs Dependent_Fmt.;
store out=LogitModel;
run;

/* use the SCORE statement in the PLM procedure to score new observations based on  fitted model saved by the STORE statement*/
proc plm restore=LogitModel;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;


/*********WAY2***/
/*********WAY2***/
/*********WAY2***/
ods output parameterestimates=ttt;

/*ods html file="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/ppppp.html"  style=minimal ;*/
proc genmod data=raw_tbl namelen=60 descending ;
class  sex age;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=xxx 
p=P_subscibe xbeta=logit;
ODS SELECT ModelANOVA;
run;

ODS OUTPUT CLOSE; 
/**Question---How can I score new data set??****/&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 18:12:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957005#M373623</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-23T18:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957006#M373624</link>
      <description>&lt;P&gt;Same as you did in PROC PROBIT.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 18:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957006#M373624</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-01-23T18:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957007#M373625</link>
      <description>&lt;P&gt;Your model is an equation used to predict the response. This equation is calculated here inside the probit step. You can see the resulting parameters of the equation in table ttt, but you do not really have to see them to score new data. The computer will score new data by applying this equation to new data to predict the new response. That, like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;said, it done using PROC plm.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 19:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957007#M373625</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2025-01-23T19:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957037#M373635</link>
      <description>&lt;P&gt;In WAY1-&lt;/P&gt;
&lt;P&gt;I used in proc probit : store out=LogitModel&lt;/P&gt;
&lt;P&gt;and then in PROC PLM used&amp;nbsp; &lt;FONT color="#FF0000"&gt;restore=LogitModel&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;Question&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;: Can I write any name in store out? For example: store out=MyModel1 ??&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In WAY2-&lt;/P&gt;
&lt;P&gt;I used in proc genmod-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ODS output parameters=ttt&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;and then as you said I need to use in proc PLM by&amp;nbsp; using -----&lt;FONT color="#FF0000"&gt;restore=ttt&amp;nbsp;&lt;/FONT&gt; ???&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Question- If I want to see the coefficients&amp;nbsp; value that were created in ttt? How can I see it?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 05:29:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957037#M373635</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-24T05:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957039#M373637</link>
      <description>&lt;P&gt;I have tried but get error&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: The file WORK.MYLOGITMODEL1 does not exist or it is not a valid item store.&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 subs @@;
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;

ods output parameterestimates=MyLogitModel1;
proc genmod data=raw_tbl namelen=60 descending ;
class  sex age;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=xxx 
p=P_subscibe xbeta=logit;
ODS SELECT ModelANOVA;
run;
ODS OUTPUT CLOSE; 

/**score new data set??****/
proc plm restore=MyLogitModel1;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jan 2025 05:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957039#M373637</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-24T05:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957070#M373640</link>
      <description>&lt;P&gt;You can not have AGE in CLASS variable, since it is continuous variable ,not category variable.&lt;/P&gt;
&lt;P&gt;And you want to score AGE which value is not in RAW_TBL dataset.&lt;/P&gt;
&lt;PRE&gt;data raw_tbl;
input sex $ age subs @@;
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;

&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;data have;
 set raw_tbl test_tbl(in=inb);
 pred=inb;
run;&lt;/FONT&gt;&lt;/STRONG&gt;

proc genmod data=have namelen=60 descending ;
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;class  sex ;&lt;/STRONG&gt;&lt;/FONT&gt;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=xxx p=P_subscibe xbeta=logit;
run;
proc print data=xxx noobs;
where pred=1;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1737701136015.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103955i966EA2B2B6367B8E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1737701136015.png" alt="Ksharp_0-1737701136015.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 06:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957070#M373640</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-24T06:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957076#M373643</link>
      <description>&lt;P&gt;I&amp;nbsp; wan to score&amp;nbsp; subs (not age)&lt;/P&gt;
&lt;P&gt;The dependent var is sub (not age)&lt;/P&gt;
&lt;P&gt;The model is&amp;nbsp;model subs=sex age&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;As I understand in class we put only categorical&amp;nbsp; predictor variables?(independent variables)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;The method&amp;nbsp;you showed id perfect (I added it as Way3)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;As I see in your method&amp;nbsp;must create a new data set that contain the observations of developing the model plus new observations&amp;nbsp; that want to score?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;So as I see always need to add the observations that created the model?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;This method is not so easy because lets say that 10 years later I want to score new data so then I need to add again the observations from developing the model?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT&gt;IT is not so&amp;nbsp;&lt;/FONT&gt;practical&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;It is better to work on the regression formula&amp;nbsp;and not need each time to work on observations&amp;nbsp;from developing model&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Can you show please how to fix way2?? I removed age var from class since it is not categorical&amp;nbsp;but still error.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR: The file WORK.RONLOGITMODEL2 does not exist or it is not a valid item store.&lt;BR /&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;
/* people are asked whether or not they would subscribe to a new newspaper*/
/*For each person variables sex (Female, Male), age, and subs (1=yes, 0=no) are recorded*/
/**Dependent binary var:subs**/
/**Predictor1-sex (categorical)**/
/**Predictor2-age (Discrete)**/
data raw_tbl;
input sex $ age subs @@;
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 = 'accept' 
0 = 'reject';
run;

/*****WAY1--Work good****/
/*****WAY1--Work good****/
/*****WAY1--Work good****/
proc probit data=raw_tbl;
class sex;
model subs(event="accept")=sex age / d=logistic itprint;
format subs Dependent_Fmt.;
store out=RonLogitModel1;
run;

/* use SCORE statement in PLM procedure to score new observations based on  fitted model saved by the STORE statement*/
proc plm restore=RonLogitModel1;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;


/*****WAY2--problem****/
/*****WAY2--problem****/
/*****WAY2--problem****/
ods output parameterestimates=RonLogitModel2;
proc genmod data=raw_tbl namelen=60 descending ;
class  sex;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=xxx 
p=P_subscibe xbeta=logit;
ODS SELECT ModelANOVA;
run;
ODS OUTPUT CLOSE; 

/**score new data set??****/
proc plm restore=RonLogitModel2;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;


/*****WAY3--Work good****/
/*****WAY3--Work good****/
/*****WAY3--Work good****/
/*****WAY3--Work good****/
data have;
set raw_tbl test_tbl(in=inb);
pred=inb;/**Binary indicator that mark obs that we want to score**/
run;
proc genmod data=have namelen=60 descending ;
class  sex ;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=WANT p=P_subscibe xbeta=logit;
/**Predict Var is called P_subscibe**/
/**Output data set with row data and predict var is called WANT**/
run;
proc print data=WANT noobs;
where pred=1;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 08:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957076#M373643</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-24T08:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957078#M373644</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data raw_tbl;
input sex $ age subs @@;
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 genmod data=raw_tbl namelen=60 descending ;
class  sex ;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=xxx p=P_subscibe xbeta=logit;
store out=RonLogitModel2;
run;

proc plm restore=RonLogitModel2;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1737709637839.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103959i73DA5AF4938E9E86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1737709637839.png" alt="Ksharp_0-1737709637839.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 09:07:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957078#M373644</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-24T09:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957080#M373645</link>
      <description>&lt;P&gt;That's great and thank you.&lt;/P&gt;
&lt;P&gt;Regarding the statement :&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ods output parameterestimates=RonLogitModel2;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Can you please show how to use it in order&amp;nbsp;to calculate score for new data?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;(Please see WAY2 that is not working)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 09:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957080#M373645</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-24T09:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957092#M373648</link>
      <description>&lt;P&gt;Okay now I think I understand&lt;/P&gt;
&lt;P&gt;ods output parameterestimates=Coef_tbl;&lt;/P&gt;
&lt;P&gt;is just to&amp;nbsp; save the coefficients in a real data set and be able to see them.&lt;/P&gt;
&lt;P&gt;This code is working 100%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*****WAY2--Work good****/&lt;BR /&gt;ods output parameterestimates=Coef_tbl;
proc genmod data=raw_tbl namelen=60 descending ;
class  sex;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
store MyRonModel;
output out=row_data_with_predict  p=P_subscibe xbeta=logit;
ODS SELECT ModelANOVA;
run;
/**Create data set row_data_with_predict that have row data with predict colmn called :P_subscibe***/


/***Show the coefficients in print screen----to verify that store statement stored the coef***/
proc plm source=MyRonModel;
show parameters;
run;


/**score new data set****/
proc plm restore=MyRonModel;
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>Fri, 24 Jan 2025 11:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957092#M373648</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-24T11:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957093#M373649</link>
      <description>&lt;P&gt;ere is the summary of 4 ways to score new data based on model formula&lt;/P&gt;
&lt;P&gt;&amp;nbsp;(Logistic regression)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/* people are asked whether or not they would subscribe to a new newspaper*/
/*For each person variables sex (Female, Male), age, and subs (1=yes, 0=no) are recorded*/
/**Dependent binary var:subs**/
/**Predictor1-sex (categorical)**/
/**Predictor2-age (Discrete)**/
data raw_tbl;
input sex $ age subs @@;
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 = 'accept' 
0 = 'reject';
run;

/*****WAY1--Work good****/
/*****WAY1--Work good****/
/*****WAY1--Work good****/
proc probit data=raw_tbl;
class sex;
model subs(event="accept")=sex age / d=logistic itprint;
format subs Dependent_Fmt.;
store out=RonLogitModel1;
run;

/* use SCORE statement in PLM procedure to score new observations based on  fitted model saved by the STORE statement*/
proc plm restore=RonLogitModel1;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;


/*****WAY2--Work good****/
/*****WAY2--Work good****/
/*****WAY2--Work good****/&lt;BR /&gt;ods output parameterestimates=Coef_tbl;
proc genmod data=raw_tbl namelen=60 descending ;
class  sex;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
store MyRonModel;
output out=row_data_with_predict  p=P_subscibe xbeta=logit;
ODS SELECT ModelANOVA;
run;
/**Create data set row_data_with_predict that have row data with predict colmn called :P_subscibe***/


/***Show the coefficents in a data set***/
proc plm source=MyRonModel;
show parameters;
run;


/**score new data set****/
proc plm restore=MyRonModel;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;


/*****WAY3--Work good****/
/*****WAY3--Work good****/
/*****WAY3--Work good****/
proc genmod data=raw_tbl namelen=60 descending ;
class  sex ;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=xxx p=P_subscibe xbeta=logit;
store out=RonLogitModel2;
run;
proc plm restore=RonLogitModel2;
score data=test_tbl out=test_out_tbl   predicted / ilink;
run;
/**Predict Var is called predicted**/
/**Output data set with row data and predict var is called test_out_tbl**/


/*****WAY4-Work good****/
/*****WAY4-Work good****/
/*****WAY4-Work good****/
/*****WAY4-Work good****/
data have;
set raw_tbl test_tbl(in=inb);
pred=inb;/**Binary indicator that mark obs that we want to score**/
run;
proc genmod data=have namelen=60 descending ;
class  sex ;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=WANT p=P_subscibe xbeta=logit;
/**Predict Var is called P_subscibe**/
/**Output data set with row data and predict var is called WANT**/
run;
proc print data=WANT noobs;
where pred=1;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jan 2025 11:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957093#M373649</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-24T11:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957098#M373650</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;
&lt;P&gt;In WAY1-&lt;/P&gt;
&lt;P&gt;I used in proc probit : store out=LogitModel&lt;/P&gt;
&lt;P&gt;and then in PROC PLM used&amp;nbsp; &lt;FONT color="#FF0000"&gt;restore=LogitModel&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;Question&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;: Can I write any name in store out? For example: store out=MyModel1 ??&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why don't you try it and learn by yourself, instead of asking us? Trying it yourself also has a benefit that you will get a faster answer from SAS than you will get from the SAS community, and unlike asking us, SAS will always give the 100% correct answer, while we get it wrong from time to time.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 11:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957098#M373650</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-01-24T11:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957099#M373651</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;
&lt;P&gt;I have tried but get error&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: The file WORK.MYLOGITMODEL1 does not exist or it is not a valid item store.&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 subs @@;
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;

ods output parameterestimates=MyLogitModel1;
proc genmod data=raw_tbl namelen=60 descending ;
class  sex age;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=xxx 
p=P_subscibe xbeta=logit;
ODS SELECT ModelANOVA;
run;
ODS OUTPUT CLOSE; 

/**score new data set??****/
proc plm restore=MyLogitModel1;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I said: "Same as you did in PROC PROBIT." You didn't do the same thing in PROC GENMOD that you did in PROC PROBIT. Please look at your code for these two PROCs and find the difference.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 11:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957099#M373651</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-01-24T11:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957106#M373652</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=raw_tbl namelen=60 descending ;
class  sex;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=xxx 
p=P_subscibe xbeta=logit;
store out=ABC;
ODS SELECT ModelANOVA;
run;

proc plm restore=ABC;
score data=test_tbl out=test_out_tbl predicted / ilink;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jan 2025 13:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957106#M373652</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-01-24T13:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: score  new data-logistic regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957210#M373684</link>
      <description>&lt;P&gt;OK. But that is not so easy to score a new dataset with category variables.&lt;/P&gt;
&lt;PRE&gt;data raw_tbl;
input sex $ age subs @@;
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;


&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;options validvarname=v7;&lt;/STRONG&gt;&lt;/FONT&gt;

ods output parameterestimates=RonLogitModel2;
proc genmod data=raw_tbl namelen=60 descending ;
class  sex ;
model subs=sex age/ dist=binomial link=logit  type3 wald ;
output out=xxx p=P_subscibe xbeta=logit;
run;


/*create design matrix for scoring*/
data test;
 set test_tbl;
 subs=1;
run;
proc glmselect data=test outdesign=outdesign(drop=subs) noprint;
class sex;
model subs=sex age/selection=none; /*same model as PROC GENMOD*/
quit;
/*make a parameter dataset*/
data RonLogitModel2;
 set RonLogitModel2 end=last;
 vname=catx('_',Parameter,Level1);
 if last then delete; /*only keep variables which are used to score*/
run;
proc transpose data=RonLogitModel2 out=RonLogitModel22 ;
var Estimate ;
id vname;
run;
data RonLogitModel22;
 set RonLogitModel22;
 _type_='PARM';
run;

/*score dataset test_tbl*/
proc score data=outdesign out=want score=RonLogitModel22 type=parm;
run;
data want;
 set want(rename=(Estimate=xbeta));
predicted=logistic(xbeta);
run;
proc print;run;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1737774415233.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103995iFB5F0F4DE691FF83/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1737774415233.png" alt="Ksharp_0-1737774415233.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jan 2025 03:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/score-new-data-logistic-regression/m-p/957210#M373684</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-25T03:07:02Z</dc:date>
    </item>
  </channel>
</rss>

