<?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: Cressie and Read (1984) Power Divergence Test Statistic in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Cressie-and-Read-1984-Power-Divergence-Test-Statistic/m-p/240136#M2522</link>
    <description>&lt;P&gt;Looks like &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;already gave you an answer in the Statistics Comunity: &lt;A href="https://communities.sas.com/t5/SAS-Statistical-Procedures/Power-Divergence-Test-Statistic/m-p/240111" target="_blank"&gt;https://communities.sas.com/t5/SAS-Statistical-Procedures/Power-Divergence-Test-Statistic/m-p/240111&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These computations (all five of them!)&amp;nbsp;can be done with SQL or IML.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.heart;
where weight_status is not missing;
table sex*weight_status / out=cellcounts outexpect;
run;

proc iml;
use cellCounts;
read all var {count expected};
close cellCounts;
lambda = 2/3;
powerDivergence = 2/(lambda*(1+lambda))*sum(COUNT#(COUNT/EXPECTED)##lambda-1);
print lambda powerDivergence;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 19 Dec 2015 11:35:57 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2015-12-19T11:35:57Z</dc:date>
    <item>
      <title>Cressie and Read (1984) Power Divergence Test Statistic</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Cressie-and-Read-1984-Power-Divergence-Test-Statistic/m-p/240109#M2521</link>
      <description>&lt;P&gt;I am looking for SAS syntax or SAS macro with Code that will perform Goodness of Fits on discrete categorical data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Specifically one that shows how to do the math described by N. Cressie, T.R.C. Read, in their paper entitled&amp;nbsp; Multinomial goodness-of-fit tests, J. Roy. Statist. Soc. B 46 (1984) 440–464.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do have code now for 4 of the 5 test statistics I need.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;proc freq gives the Pearson's Chi Square,&lt;/LI&gt;
&lt;LI&gt;Proc Univarite produces the Komogorov Smirnov test statistic,&lt;/LI&gt;
&lt;LI&gt;Proc Probit produces the Log Likelihood Ratio as does Proc GenMod,&lt;/LI&gt;
&lt;LI&gt;Proc Multtest&amp;nbsp; calculates the Freeman-Tukey test statistic,&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;but I have not been able to find the Power divergence test show in the image attached here.&amp;nbsp;&amp;nbsp; I found some R code so maybe I can run it inside SAS enterprise guide?&amp;nbsp; But I do NOT have a SAS/IML or SAS Enterprise Miner license so I can not run the R code inside a node that way.&amp;nbsp; Please advise.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12151iE7CCB1725B6FF268/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="five statistical tests.JPG" title="five statistical tests.JPG" /&gt;</description>
      <pubDate>Fri, 18 Dec 2015 21:05:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Cressie-and-Read-1984-Power-Divergence-Test-Statistic/m-p/240109#M2521</guid>
      <dc:creator>marygc</dc:creator>
      <dc:date>2015-12-18T21:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Cressie and Read (1984) Power Divergence Test Statistic</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Cressie-and-Read-1984-Power-Divergence-Test-Statistic/m-p/240136#M2522</link>
      <description>&lt;P&gt;Looks like &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;already gave you an answer in the Statistics Comunity: &lt;A href="https://communities.sas.com/t5/SAS-Statistical-Procedures/Power-Divergence-Test-Statistic/m-p/240111" target="_blank"&gt;https://communities.sas.com/t5/SAS-Statistical-Procedures/Power-Divergence-Test-Statistic/m-p/240111&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These computations (all five of them!)&amp;nbsp;can be done with SQL or IML.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.heart;
where weight_status is not missing;
table sex*weight_status / out=cellcounts outexpect;
run;

proc iml;
use cellCounts;
read all var {count expected};
close cellCounts;
lambda = 2/3;
powerDivergence = 2/(lambda*(1+lambda))*sum(COUNT#(COUNT/EXPECTED)##lambda-1);
print lambda powerDivergence;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 19 Dec 2015 11:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Cressie-and-Read-1984-Power-Divergence-Test-Statistic/m-p/240136#M2522</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-12-19T11:35:57Z</dc:date>
    </item>
  </channel>
</rss>

