<?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: proc genmod graphics for count data model fit assessment in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353309#M12268</link>
    <description>&lt;P&gt;You are not using the CDF function correctly. &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#n0n7cce4a3gfqkn1vr0p1x0of99s.htm" target="_self"&gt;Here is a link to the doc.&lt;/A&gt;&amp;nbsp;A random variable X follows the NB distribution if it returns the number of failures before N success in a sequence of independent trials in which the probability of success is p.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The value 1.04 is not an appropriate value for any of these parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of using the CDF function to plot the NB CDF for indep trials in which p=0.3 and we want the number of failures until the first success:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data NB;
do x = 0 to 20;                      /* X=0,1,...,20 = "num failures" */
   NBCDF = cdf("NegBin", x, 0.3, 1); /* p=0.3; draw until 1 success */
   output;
end;
proc sgplot data=NB;
   step x=X y=NBCDF;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Apr 2017 17:17:11 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2017-04-25T17:17:11Z</dc:date>
    <item>
      <title>proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353052#M12249</link>
      <description>&lt;P&gt;I'd like to include before and after model fit (proc genmod using negbin or poisson) visuals in my poster using clean data (unique patients) vs duplicate data (patients recounted). The idea is to show the impact of deduplication, if any. Global stat shows negbin fits my data better but I'd like to present it by visuals. (I'm using 9.4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ideal plot would be one shown in SUGI reference attached here. Below is just a screenshot of Figure 4 in the reference which is a nice cum probability graph comparing negbin, poisson and observed. But paper didn't cover how to. Anybody knows the way to reproduce this kinda plot?&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8523i953AFB3C31BD94B0/image-size/original?v=1.0&amp;amp;px=-1" alt="want image.png" title="want image.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;- I read about ods graphs options for proc genmod and tried "assess var" option as shown below. It was resulted in no ouputs. Any idea why?&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;ods graphics on;
proc genmod data=mydata;
   class exposure(ref="0")/param=ref;
   model outcome=exposure/ dist=negbin link=log offset=ln;
   assess var=(outcome)/resample=10000
                        seed=603708000
                        crpanel;
   ods trace on;
   run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A title="assess var" href="https://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_genmod_sect068.htm" target="_self"&gt;https://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_genmod_sect068.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the first 10 obs of my data where outcome is counts (number of cancers) , zone is exposure (taking value of 1,2 and 0), grand_total is the ZIP population/denominator.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8529iD9766F6D0063928E/image-size/original?v=1.0&amp;amp;px=-1" alt="mydata.png" title="mydata.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your precious time!!!! thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 12:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353052#M12249</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T12:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353053#M12250</link>
      <description>&lt;P&gt;Are you asking how to get the data for the graph or how to graph the data or both?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If graphing, you can use SGPLOT with STEP and SERIES statement to get the graph shown, but you do need the data first &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 01:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353053#M12250</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-25T01:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353064#M12251</link>
      <description>I have my data ready. Both of them. One clean and the other has duplicates. Could you please show me a syntax example?</description>
      <pubDate>Tue, 25 Apr 2017 01:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353064#M12251</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T01:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353066#M12252</link>
      <description>I think I just got what you're asking. Are you saying that I have to prep the data first for sgplot? If so, No. No data prepped for sgplot yet. Do you know how?</description>
      <pubDate>Tue, 25 Apr 2017 02:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353066#M12252</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T02:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353073#M12253</link>
      <description>&lt;P&gt;No, I don't know how to get the estimates. That should be your first question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 02:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353073#M12253</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-25T02:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353077#M12254</link>
      <description>I have my estimates calculated both for negbin and poisson. I'm looking out for hints as to how my estimates form a data to feed proc sgplot. Please don't hesitate to share any links of resources with me.</description>
      <pubDate>Tue, 25 Apr 2017 02:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353077#M12254</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T02:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353079#M12255</link>
      <description>&lt;P&gt;It's pretty straightforward...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should have estimates with the count and probability, ie the data you want on the charts.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use SGPLOT, if you can post we can run/reporduce your results then I can help you there but otherwise you'll have to wait for someone else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out robslink.com for examples though be careful to find SG procedures. You can review the SG documentation for examples.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 03:01:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353079#M12255</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-25T03:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353081#M12256</link>
      <description>"if you can post?" what are you referring to? my estimates? I can post them for help. I am baffled where "cum probability" on graph is based on?</description>
      <pubDate>Tue, 25 Apr 2017 03:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353081#M12256</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T03:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353087#M12257</link>
      <description>&lt;P&gt;Sorry, that should be if you can post the data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't know what the graph is why are you creating it?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 03:39:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353087#M12257</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-25T03:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353093#M12258</link>
      <description>I can post the data. Please see the attachment. Why I want to create it? I was looking for the most appropriate SAS visual outputs to illustrate model fit using proc genmod with negbin/ poisson distribution. And I stumbled across the reference attached here. I understand the concept of the graph but asking for help from you guys as to how cumulative probability on the shown plot was pulled out.</description>
      <pubDate>Tue, 25 Apr 2017 04:23:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353093#M12258</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T04:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353094#M12259</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; , see attached data. I will check in after few hours. I am eastern timezone.</description>
      <pubDate>Tue, 25 Apr 2017 04:29:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353094#M12259</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T04:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353153#M12260</link>
      <description>&lt;P&gt;You can use PROC UNIVARIATE to obtain the empirical cumulative probabilities, as shown in&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2016/09/06/graph-step-function-sas.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2016/09/06/graph-step-function-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can then use the STEP or SERIES statement in PROC SGPLOT to graph it, as in this example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data MyData;
input x @@;
datalines;
   7 7 13 9 8 8 9 9 5 6 6 9 5 10 4 5 3 8 4
;

/* http://blogs.sas.com/content/iml/2016/09/06/graph-step-function-sas.html */
ods select cdfplot;
proc univariate data=MyData;
cdfplot x / vscale=proportion 
         odstitle="Empirical CDF" odstitle2="PROC UNIVARIATE";
ods output cdfplot=outCDF;   /* data set contains ECDF values */
run;
 
title "Empirical CDF";
proc sgplot data=outCDF noautolegend;
   step x=ECDFX y=ECDFY;          /* variable names created by PROC UNIVARIATE */
   xaxis grid label="x" offsetmin=0.05 offsetmax=0.05;
   yaxis grid min=0 label="Cumulative Proportion";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To overlay additional curves, take the parameter estimates from PROC GENMOD and use the CDF function in a DATA step to compute the predicted CDFs for the Poisson (and NB) distribution. You can either evaluate the CDF at the data, or you can evaluate the CDF on a grid of points, as shown in&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2012/04/04/fitting-a-poisson-distribution-to-data-in-sas.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2012/04/04/fitting-a-poisson-distribution-to-data-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;(If uniform grid, you need to merge the data and the CDF.)&lt;/P&gt;
&lt;P&gt;Here is an example where GENMOD gave Lambda=7.1 for the Poisson fit&amp;nbsp;and the Poisson CDF is evaluated at the data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Lambda = 7.1;  /* param estimate from GENMOD fit */
data All;
set outCDF;
PoisCDF = cdf("Poisson", ECDFX, &amp;amp;Lambda);
run;
proc sgplot data=All;
   step x=ECDFX y=ECDFY / legendlabel="ECDF";
   step x=ECDFX y=PoisCDF / legendlabel="Model Fit";
   xaxis grid label="x" offsetmin=0.05 offsetmax=0.05;
   yaxis grid min=0 label="Cumulative Proportion";
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;</description>
      <pubDate>Tue, 25 Apr 2017 12:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353153#M12260</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-04-25T12:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353174#M12262</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;thanks.&lt;/P&gt;&lt;P&gt;I have updated your code to my data. Bummer is, cdfplot is red and I get a error log below?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select cdfplot;
proc univariate data=post.zipcrude5;
cdfplot rate / vscale=proportion odstitle="Empirical CDF" odstitle2="PROC UNIVARIATE";
ods output cdfplot=post.outCDF; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, ALL, ALPHA, ANNOTATE, CIBASIC,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CIPCTLDF, CIPCTLNORMAL, CIQUANTDF, CIQUANTNORMAL, DATA, DEBUG, EXCLNPWGT, FREQ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GOUT, LOCCOUNT, MODE, MODES, MU0, NEXTROBS, NEXTRVAL, NOBYPLOT, NOPRINT, NORMAL,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOTABCONTENTS, NOVARCONTENTS, OUTTABLE, PCTLDEF, PLOT, PLOTSIZE, ROBUSTSCALE,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROUND, SUMMARYCONTENTS, TRIMMED, VARDEF, WINSORIZED.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;4989&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; odstitle="Empirical CDF" odstitle2="PROC UNIVARIATE";&lt;BR /&gt;4990&amp;nbsp; ods output cdfplot=post.outCDF;&lt;BR /&gt;4991&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE UNIVARIATE used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;BR /&gt;&lt;BR /&gt;WARNING: Output 'cdfplot' was not created.&amp;nbsp; Make sure that the output object name, label, or path&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is spelled correctly.&amp;nbsp; Also, verify that the appropriate procedure options are used to&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; produce the requested output object.&amp;nbsp; For example, verify that the NOPRINT option is not&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; used.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 13:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353174#M12262</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T13:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353184#M12263</link>
      <description>&lt;P&gt;Don't worry about the red color. It just means that the syntax highlighter doesn't know that statement. It has been in PROC UNIVARIATE since forever.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ERROR is on the PROC UNIVARIATE statement, so I suspect you had a copy-paste error that you corrected in the code you pasted. Try it again. &amp;nbsp;If you still get an error, try it on data we all have access to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select cdfplot;
proc univariate data=sashelp.cars;
cdfplot mpg_city / vscale=proportion odstitle="Empirical CDF" odstitle2="PROC UNIVARIATE";
ods output cdfplot=outCDF; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Apr 2017 13:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353184#M12263</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-04-25T13:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353285#M12266</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for previous comments. All worked out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I tried following but NegBCDF column is all missing in the outCDFcar.&lt;/P&gt;&lt;P&gt;Lambda1 is the exp(estimate) from &lt;EM&gt;"ods output parameterestimates=data;"&amp;nbsp;&lt;/EM&gt;&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;ods select cdfplot;
proc univariate data=sashelp.cars;
cdfplot mpg_city / vscale=proportion odstitle="Empirical CDF" odstitle2="PROC UNIVARIATE";
ods output cdfplot=outCDFcar; 
run;
%let Lambda1=1.04;
data alldup; set outCDFcar;
NegBCDF=cdf('NEGB',1, ECDFX, &amp;amp;Lambda1);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. Below is the desired image. I have two separate cdf data with N=1122 for clean and N=1133 for uncleaned data from proc univariate. Any idea how I can overlay them on the same plot as shown below?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8536iAADB00C3A1D2024E/image-size/original?v=1.0&amp;amp;px=-1" alt="decired plot.png" title="decired plot.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 16:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353285#M12266</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T16:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353309#M12268</link>
      <description>&lt;P&gt;You are not using the CDF function correctly. &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#n0n7cce4a3gfqkn1vr0p1x0of99s.htm" target="_self"&gt;Here is a link to the doc.&lt;/A&gt;&amp;nbsp;A random variable X follows the NB distribution if it returns the number of failures before N success in a sequence of independent trials in which the probability of success is p.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The value 1.04 is not an appropriate value for any of these parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of using the CDF function to plot the NB CDF for indep trials in which p=0.3 and we want the number of failures until the first success:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data NB;
do x = 0 to 20;                      /* X=0,1,...,20 = "num failures" */
   NBCDF = cdf("NegBin", x, 0.3, 1); /* p=0.3; draw until 1 success */
   output;
end;
proc sgplot data=NB;
   step x=X y=NBCDF;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Apr 2017 17:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353309#M12268</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-04-25T17:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353398#M12274</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Getting running out of time and steep learning curve, tempted to stick to poisson dist. defintely shall put more efforts in to understanding negbin later as it offers slightly a better fit to my data.&lt;/P&gt;&lt;P&gt;Looking at below cdf plots, my data cleaning seemed not to cause an appreciable difference. I don't know If I could even tell the plot on the right (model fit after deduplication)&amp;nbsp; shows a better fit. What do you think? Please let me know if there're better diagnostic visuals that would show the impact of data cleaning on model fitting with more contrast than this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8546iAA1E630EBFDFCF66/image-size/original?v=1.0&amp;amp;px=-1" alt="result plot.png" title="result plot.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 19:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353398#M12274</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T19:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353420#M12277</link>
      <description>&lt;P&gt;Why not plot the difference to make it absolutely clear, especially since that's your interest.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 19:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353420#M12277</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-25T19:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353424#M12278</link>
      <description>you mean, take empirical cdf off of the plot for more constrast?</description>
      <pubDate>Tue, 25 Apr 2017 19:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353424#M12278</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-04-25T19:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc genmod graphics for count data model fit assessment</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353427#M12279</link>
      <description>&lt;P&gt;No, if the difference is of interest, subtract the two distribution values across the entire series and plot the actual difference.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 19:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-genmod-graphics-for-count-data-model-fit-assessment/m-p/353427#M12279</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-25T19:48:48Z</dc:date>
    </item>
  </channel>
</rss>

