<?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 Does proc plm not work to score models built with proc genmod? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Does-proc-plm-not-work-to-score-models-built-with-proc-genmod/m-p/793041#M38868</link>
    <description>&lt;P&gt;For a work project I'm building a zero-inflated negative binomial regression model with proc genmod and then attempting to score the model on a test dataset using proc plm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, using the Trajan dataset provided&amp;nbsp;&lt;A href="https://support.sas.com/rnd/app/stat/examples/GENMODZIP/sas.html" target="_self"&gt;here&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=Trajan;
   class bap photoperiod;
   model roots = bap photoperiod / dist=zinb;
   zeromodel;
   output out=zinb predicted=pred pzero=pzero;
   ods output ParameterEstimates=zinbparms;
   ods output Modelfit=fit;
   store out=zinb_model;
run;

data test;
input roots bap photoperiod;
cards;
1 10 20
2 30 40
;
run;

proc plm source=zinb_model;
	score data=test out=preds_zinb pred=pred;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The code runs fine, no errors in the log, but the output dataset preds_zinb contains missing values (".") in the pred column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is proc plm not compatible with proc genmod? It should work -&amp;nbsp;there's a data scoring example on the SAS website here: &lt;A href="https://support.sas.com/kb/33/307.html" target="_blank" rel="noopener"&gt;https://support.sas.com/kb/33/307.html&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jan 2022 00:57:53 GMT</pubDate>
    <dc:creator>RobertWF1</dc:creator>
    <dc:date>2022-01-28T00:57:53Z</dc:date>
    <item>
      <title>Does proc plm not work to score models built with proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Does-proc-plm-not-work-to-score-models-built-with-proc-genmod/m-p/793041#M38868</link>
      <description>&lt;P&gt;For a work project I'm building a zero-inflated negative binomial regression model with proc genmod and then attempting to score the model on a test dataset using proc plm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, using the Trajan dataset provided&amp;nbsp;&lt;A href="https://support.sas.com/rnd/app/stat/examples/GENMODZIP/sas.html" target="_self"&gt;here&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=Trajan;
   class bap photoperiod;
   model roots = bap photoperiod / dist=zinb;
   zeromodel;
   output out=zinb predicted=pred pzero=pzero;
   ods output ParameterEstimates=zinbparms;
   ods output Modelfit=fit;
   store out=zinb_model;
run;

data test;
input roots bap photoperiod;
cards;
1 10 20
2 30 40
;
run;

proc plm source=zinb_model;
	score data=test out=preds_zinb pred=pred;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The code runs fine, no errors in the log, but the output dataset preds_zinb contains missing values (".") in the pred column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is proc plm not compatible with proc genmod? It should work -&amp;nbsp;there's a data scoring example on the SAS website here: &lt;A href="https://support.sas.com/kb/33/307.html" target="_blank" rel="noopener"&gt;https://support.sas.com/kb/33/307.html&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 00:57:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Does-proc-plm-not-work-to-score-models-built-with-proc-genmod/m-p/793041#M38868</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-01-28T00:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Does proc plm not work to score models built with proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Does-proc-plm-not-work-to-score-models-built-with-proc-genmod/m-p/793048#M38869</link>
      <description>&lt;P&gt;PROC PLM can score new data for this model as discussed and illustrated in &lt;A href="http://support.sas.com/kb/44354" target="_self"&gt;this note&lt;/A&gt;. The reason that it doesn't work for your TEST data set is that your model has only CLASS predictors and with a CLASS predictor, the model contains only a parameter for each of the &lt;STRONG&gt;observed&lt;/STRONG&gt; values in the data used to fit the model. The values in your TEST data set are not values in the observed data. If the variables were not in the CLASS statement, and therefore treated as continuous rather than categorical, then you would get predicted values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="http://support.sas.com/kb/32304" target="_self"&gt;this note&lt;/A&gt; (particularly point 3) on why missing values occur when scoring new data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 01:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Does-proc-plm-not-work-to-score-models-built-with-proc-genmod/m-p/793048#M38869</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-01-28T01:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Does proc plm not work to score models built with proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Does-proc-plm-not-work-to-score-models-built-with-proc-genmod/m-p/793123#M38872</link>
      <description>Beautiful! Thank you - I missed that detail about class variables.</description>
      <pubDate>Fri, 28 Jan 2022 13:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Does-proc-plm-not-work-to-score-models-built-with-proc-genmod/m-p/793123#M38872</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-01-28T13:50:59Z</dc:date>
    </item>
  </channel>
</rss>

