<?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 to know previous model work. in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474329#M5835</link>
    <description>&lt;P&gt;hi, I have a logistic model which is get from my colleague, but I want to know how this model work, the sas code using&amp;nbsp;INMODEL option doesn't allow me to use&amp;nbsp;CODE statement. I need to get the formula from this model to generate into SQL code.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jun 2018 02:20:09 GMT</pubDate>
    <dc:creator>haziqfarhan94</dc:creator>
    <dc:date>2018-06-29T02:20:09Z</dc:date>
    <item>
      <title>How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474329#M5835</link>
      <description>&lt;P&gt;hi, I have a logistic model which is get from my colleague, but I want to know how this model work, the sas code using&amp;nbsp;INMODEL option doesn't allow me to use&amp;nbsp;CODE statement. I need to get the formula from this model to generate into SQL code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 02:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474329#M5835</guid>
      <dc:creator>haziqfarhan94</dc:creator>
      <dc:date>2018-06-29T02:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474336#M5836</link>
      <description>&lt;P&gt;I think you should use the INEST= option in the proc logistic statement with the NOFIT option in the model statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 03:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474336#M5836</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-06-29T03:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474338#M5837</link>
      <description>&lt;P&gt;Thank you for your reply, I used the existing model to score the data, so Im not use any model statement. Here is my code :&lt;BR /&gt;&lt;BR /&gt;proc logistic inmodel=&amp;amp;INMODEL_LAPSE. NOPRINT;&lt;BR /&gt;SCORE DATA = TAB_COMBINE_XP OUT = TAB_COMBINE_XP_1(rename=(p_1=p_1_lp) /*drop=p_0 F_Target_New I_Target_New I_FLAG_XSELL_ADDON I_FLAG_XSELL_PA*/ )fitstat;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I want to know how sas work from the&amp;nbsp;&lt;SPAN&gt;&amp;amp;INMODEL_LAPSE. model to score the data.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 03:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474338#M5837</guid>
      <dc:creator>haziqfarhan94</dc:creator>
      <dc:date>2018-06-29T03:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474426#M5839</link>
      <description>&lt;P&gt;Does you have category variables ? if it was ,then you need get design matrix firstly. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;wrote a blog about it before.&lt;/P&gt;
&lt;P&gt;If your variables are numeric type.&lt;/P&gt;
&lt;P&gt;Then the following code could get you parameter estimator .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=sashelp.class outest=est;
model sex= weight height;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then y=1*1.1193482105+weight*-0.066360275+height*0.0859144918;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 13:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474426#M5839</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-06-29T13:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474806#M5846</link>
      <description>&lt;P&gt;Yes my data have category variables. I am not trying to create a new model, I just want to use existing model to score the data&amp;nbsp;using INMODEL option, but I can't figure out how SAS do it for the calculation at the back end because I want to code the SAS script into SQL to score the data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 02:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474806#M5846</guid>
      <dc:creator>haziqfarhan94</dc:creator>
      <dc:date>2018-07-02T02:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474867#M5847</link>
      <description>&lt;P&gt;Check CODE statement of PROC LOGISTIC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc logistic.........&lt;/P&gt;
&lt;P&gt;model ......&lt;/P&gt;
&lt;P&gt;code file=' c:\temp\x.sas ';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x.sas contains the logic you want to score new table.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 12:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/474867#M5847</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-02T12:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475084#M5854</link>
      <description>&lt;P&gt;I have try it before, but since I am just use the model that have been created (I really don't know how or who created that but the purpose of the model is just to score my current data) , I just use INMODEL= option to call the model and score my current data. INMODEL= option doesn't allowed me to use CODE statement. I'm stuck on this issue forever.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 02:11:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475084#M5854</guid>
      <dc:creator>haziqfarhan94</dc:creator>
      <dc:date>2018-07-03T02:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475149#M5857</link>
      <description>&lt;P&gt;You could produce some dummy data to deduce the estimator of each variables.&lt;/P&gt;
&lt;P&gt;Assuming there were only two numeric variabls: weight height , make data like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;weight&amp;nbsp; height&lt;/P&gt;
&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;lt;--&amp;nbsp; get Intercept&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;lt;-- get weight&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;lt;-- get height&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;score this data and you will get the parameter estimators .&lt;/P&gt;
&lt;P&gt;If you have category variable like SEX ,then you need to know the parameter design (REF , GLM ,EFFECT). or you could try the default value(EFFECT) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 12:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475149#M5857</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-03T12:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475159#M5858</link>
      <description>&lt;P&gt;Although the OUTMODEL= and INMODEL= options enable you to score your colleague's&amp;nbsp;model, you can't use that technique to automatically generate DATA step code for the model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The easy solution is to ask your colleague&amp;nbsp;to put a CODE statement in his code that fits the model to the data.&lt;/P&gt;
&lt;P&gt;You can then&amp;nbsp;look at the DATA step&amp;nbsp;code from the CODE statement, and also use the code to score the model. For an example, see &lt;A href="https://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html" target="_self"&gt;"Techniques for scoring a regression model in SAS"&lt;/A&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 12:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475159#M5858</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-03T12:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475164#M5859</link>
      <description>&lt;P&gt;Rick,&lt;/P&gt;
&lt;P&gt;OP don't contact that colleague. and can't run that model again, only INMODEL(binary file) left. OP want know how to score a new table in this binary file . Therefore I suggest some dummy data to deduce the parameter estimators . And you have some idea ?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 13:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475164#M5859</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-03T13:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475185#M5860</link>
      <description>&lt;P&gt;If you are looking for the parameter estimates, you can figure them from the OUTMODEL= data set. However,&amp;nbsp;you will have to write the DATA step evaluation code yourself because you can't use the CODE statement with the&amp;nbsp;INMODEL= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data ingots;&lt;BR /&gt; input Heat Soak r n @@;&lt;BR /&gt; datalines;&lt;BR /&gt;7 1.0 0 10 14 1.0 0 31 27 1.0 1 56 51 1.0 3 13&lt;BR /&gt;7 1.7 0 17 14 1.7 0 43 27 1.7 4 44 51 1.7 0 1&lt;BR /&gt;7 2.2 0 7 14 2.2 2 33 27 2.2 0 21 51 2.2 0 1&lt;BR /&gt;7 2.8 0 12 14 2.8 0 31 27 2.8 1 22 51 4.0 0 1&lt;BR /&gt;7 4.0 0 9 14 4.0 0 19 27 4.0 1 16&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;proc logistic data=ingots outmodel=LogiModel plots=none;&lt;BR /&gt; model r/n = Heat | Soak;&lt;BR /&gt; ods select ParameterEstimates;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=LogiModel(rename=(_MISC_=Estimate));&lt;BR /&gt;format Estimate bestd16.;&lt;BR /&gt;where _TYPE_='E' and _CATEGORY_='E';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc logistic inmodel=LogiModel;&lt;BR /&gt;score data=ingots out=score1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data Score2;&lt;BR /&gt;set Ingots;&lt;BR /&gt;mu = -5.99010836 +&lt;BR /&gt; 0.09633747 * Heat +&lt;BR /&gt; 0.29955054 * Soak +&lt;BR /&gt; -0.00883937 * Heat * Soak;&lt;BR /&gt;P_Event = logistic(mu);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc compare brief method=absolute criterion=1e-6&lt;BR /&gt; base=Score1(keep=Heat Soak P_Event)&lt;BR /&gt; compare=Score2(keep=Heat Soak P_Event);&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jul 2018 14:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475185#M5860</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-03T14:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475436#M5862</link>
      <description>&lt;P&gt;I don't know INMODEL= option will produce a SAS table NOT a binary file . That is to say open that table ,I could see the regression coefficient estimators ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 13:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475436#M5862</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-04T13:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475451#M5863</link>
      <description>&lt;P&gt;KSharp,&lt;/P&gt;
&lt;P&gt;I assume you are talking about the OUTMODEL= option. The OUTMODEL= option creates a SAS data set, as demonstrated in the program that I posted.&amp;nbsp;However,&amp;nbsp;you are correct&amp;nbsp;that it is intended for consumption by the INMODEL= option, hence it isn't intended to be&amp;nbsp; "human readable" and the format is not documented, as far as I know. However, as I have shown, you can "reverse engineer" some information&amp;nbsp;by studying the data set.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 14:12:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475451#M5863</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-04T14:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475510#M5866</link>
      <description>&lt;P&gt;So far I will follow this to track the model. Its maybe take a lot of time because its hard to read the LOGISMOD file (file created from OUTMODEL= option). Thank you for the suggestion.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 01:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475510#M5866</guid>
      <dc:creator>haziqfarhan94</dc:creator>
      <dc:date>2018-07-05T01:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475604#M5867</link>
      <description>&lt;P&gt;Rick,&lt;/P&gt;
&lt;P&gt;If model have some category variables, Shouldn't I know the design matrix firstly ?&lt;/P&gt;
&lt;P&gt;There are several parameterization method for CLASS variable, after that I can score the new data ,right ?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 12:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475604#M5867</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-05T12:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475620#M5868</link>
      <description>&lt;P&gt;KSharp,&lt;/P&gt;
&lt;P&gt;Yes. The OP must know all the information that would be in the CLASS and MODEL statements, including the parameters in the model, the order they were specified, the levels of the classification variables, and the parameterization for each class variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll say again: This is a complicated and error-prone way to solve this problem. For a complicated model with&amp;nbsp;interaction effects, I think it will require a lot of work. A better way is to&amp;nbsp;refit the original data and use a CODE statement. Even the PARAMEST= data set would be easier to use, if that is available.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 13:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475620#M5868</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-05T13:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to know previous model work.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475929#M5869</link>
      <description>&lt;P&gt;Yes, you are correct. The model too complicated and I don't have idea which variables interact with the others. After use the code as you provided,I have 86 estimate value included the intercept but the predictors or variables are just 26 only. Btw, Thank you for your advice. Really appreciate that.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 08:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-know-previous-model-work/m-p/475929#M5869</guid>
      <dc:creator>haziqfarhan94</dc:creator>
      <dc:date>2018-07-06T08:51:09Z</dc:date>
    </item>
  </channel>
</rss>

