turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Power Divergence Test Statistic

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-18-2015 04:13 PM

Specifically one that shows how to do the math described by N. Cressie, T.R.C. Read, in their paper entitled

"Multinomial goodness-of-fit tests," J. Roy. Statist. Soc. B 46 (1984) 440–464.

I do have code now for 4 of the 5 test statistics I need.

- proc freq gives the Pearson's Chi Square,
- Proc Univarite produces the Komogorov Smirnov test statistic,
- Proc Probit produces the Log Likelihood Ratio as does Proc GenMod,
- Proc Multtest calculates the Freeman-Tukey test statistic,

**but I have not been able to find the Power divergence test** show in the image attached here. I found some R code so maybe I can run it inside SAS enterprise guide? 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. Please advise.

Accepted Solutions

Solution

12-28-2015
03:31 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-18-2015 10:19 PM

It can be computed with a SQL query from proc freq output. For example

```
proc freq data=sashelp.heart;
where weight_status is not missing;
table sex*weight_status / out=cellcounts outexpect;
run;
%let lambda=(2/3);
proc sql;
select
&lambda as lambda,
2/(&lambda*(1+&lambda))*sum(COUNT*((COUNT/EXPECTED)**&lambda-1)) as powerDivergence
from cellCounts;
quit;
```

PG

All Replies

Solution

12-28-2015
03:31 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-18-2015 10:19 PM

It can be computed with a SQL query from proc freq output. For example

```
proc freq data=sashelp.heart;
where weight_status is not missing;
table sex*weight_status / out=cellcounts outexpect;
run;
%let lambda=(2/3);
proc sql;
select
&lambda as lambda,
2/(&lambda*(1+&lambda))*sum(COUNT*((COUNT/EXPECTED)**&lambda-1)) as powerDivergence
from cellCounts;
quit;
```

PG