<?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: Running the KS test for Poisson distributed data in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367353#M19270</link>
    <description>&lt;P&gt;KS Test is nonparameter test, which means it does not matter what kind of distribution your variable conform to , you always could use KS Test.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jun 2017 13:31:00 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-06-15T13:31:00Z</dc:date>
    <item>
      <title>Running the KS test for Poisson distributed data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367257#M19269</link>
      <description>&lt;P&gt;Hello SAS user,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to run the Kolmogorov-Smirnov test on a Poisson distributed data, by quantifying the distance between the empirical distribution function of the loss data set and the cumulative Poisson distribution function; in my case, the Poisson distribution function is the reference parametric distribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Browsing on the internet, till now I found only the KS test special case in which one compares the Normal distribution vs the empirical one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What about the case I need to compare the empirical distribution function against the Poisson distribution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks all in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 07:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367257#M19269</guid>
      <dc:creator>Quantopic</dc:creator>
      <dc:date>2017-06-15T07:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Running the KS test for Poisson distributed data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367353#M19270</link>
      <description>&lt;P&gt;KS Test is nonparameter test, which means it does not matter what kind of distribution your variable conform to , you always could use KS Test.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 13:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367353#M19270</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-06-15T13:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Running the KS test for Poisson distributed data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367638#M19284</link>
      <description>&lt;P&gt;Thanks for your answer &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you mean I could simply use the &lt;EM&gt;UNIVARIATE&lt;/EM&gt; procedure to implement the KS test?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Particularly, I may use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc npar1way
        edf
        data = dataset;
                    class x
                    var y;
        exact ks;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where&amp;nbsp;&lt;EM&gt; y &lt;/EM&gt;is the observed data and x is a vector of simulated data&amp;nbsp;&amp;nbsp;coming from a Poisson distribution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 09:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367638#M19284</guid>
      <dc:creator>Quantopic</dc:creator>
      <dc:date>2017-06-16T09:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Running the KS test for Poisson distributed data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367647#M19287</link>
      <description>&lt;P&gt;Can you explain WHY you have to run a KS test for Poisson data?&lt;/P&gt;
&lt;P&gt;PROC UNIVARIATE is not appropriate for discrete (count) data.&lt;/P&gt;
&lt;P&gt;If you are trying to fit Poisson data, &lt;A href="http://blogs.sas.com/content/iml/2012/04/04/fitting-a-poisson-distribution-to-data-in-sas.html" target="_self"&gt;you can use PROC GENMOD&lt;/A&gt;, which provides goodness-of-fit statistics.&lt;/P&gt;
&lt;P&gt;If you want a graphical representation of the fit (similar to a quantile-quantile plot) you can &lt;A href="http://blogs.sas.com/content/iml/2012/04/12/the-poissonness-plot-a-goodness-of-fit-diagnostic.html" target="_self"&gt;create a "Poissonness plot"&lt;/A&gt;, although for small data.it might not be very enlightening.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 09:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367647#M19287</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-06-16T09:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Running the KS test for Poisson distributed data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367654#M19289</link>
      <description>&lt;P&gt;HI &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;and thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to compute the KS stat and the relative p-value comparing the the theoretical Poisson distribution with the observed data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I agree with you about the fact it does not make sense, but it is a request for reporting the validation results of internal models; the aim is to quantify a distance between the empirical distribution function and the cdf of the Poisson distribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using the &lt;EM&gt;PROC GENMOD&lt;/EM&gt;, as you suggested above, I did not get the KS statistic and p-value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you suggest some way to run the KS test?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 10:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367654#M19289</guid>
      <dc:creator>Quantopic</dc:creator>
      <dc:date>2017-06-16T10:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Running the KS test for Poisson distributed data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367662#M19290</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Quantopic wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I agree with you about the fact it does not make sense, but it is a request for reporting the validation results of internal models; the aim is to quantify a distance between the empirical distribution function and the cdf of the Poisson distribution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When something does not make sense, you should point that out to your supervisor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am familiar with a recent paper that shows how to compute KS statistics for discrete distributions, but the computation&amp;nbsp;is much more difficult than for continuous data. If your company licenses SA/IML and you are an experienced SAS/IML programmer with knowledge of numerical&amp;nbsp;analysis,&amp;nbsp;you might be able to implement the procedure in a few days or weeks. If you are less experienced or don't&amp;nbsp;have SAS/IML, it will take longer. And to what purpose? The KS test is not more powerful than other GOF tests that are already provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Talk to your supervisor and explain that KS tests for discrete distributions are still at the research stage and have not made their way into SAS procedures. &amp;nbsp;To implement it yourself would require advanced IML programming.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 10:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367662#M19290</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-06-16T10:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Running the KS test for Poisson distributed data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367692#M19295</link>
      <description>&lt;P&gt;I totally agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;. and I do remember Rick has written a blog about this question.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Search Poisson at Rick's blog, you will find . or&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;could point you the URL .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Back to your question. Yes. You can do this but you need change data structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x &amp;nbsp;y&lt;/P&gt;
&lt;P&gt;7 2&lt;/P&gt;
&lt;P&gt;5 6&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;name value&lt;/P&gt;
&lt;P&gt;x 7&lt;/P&gt;
&lt;P&gt;x 5&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;y 2&lt;/P&gt;
&lt;P&gt;y 6&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;after that ,run KS test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc npar1way
        edf
        data = dataset;
                    class name
                    var value ;
        exact ks;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Jun 2017 12:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Running-the-KS-test-for-Poisson-distributed-data/m-p/367692#M19295</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-06-16T12:39:33Z</dc:date>
    </item>
  </channel>
</rss>

