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
- /
- How to do exact analysis of s by r table with nomi...

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
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-11-2016 05:23 PM

I use SAS9.4.

I would like to do a exact analysis of s by r table where

the covariate is nominal and the response is ordinal.

Also this is an analysis of categorical data, so we observe the frequency of each covariate*response level.

So the data should look something like

data example;

input covariate $ response $ count @@;

datalines;

cov1 bad 3 cov1 moderate 4 cov1 good 0

cov2 bad 4 cov2 moderate 1 cov2 good 2

cov3 bad 5 cov3 moderate 2 cov3 good 1

;

The sample size is quite small, so I would like to use exact analysis.

I suppose I can do something like

froc freq order=data;

weight count;

tables covariatename*outcomename / exact

run;

But, this should give just a general association, not a "mean score differ" type of result.

What kind of option can I use to do this exact analysis?

Thank you for your help in advance.

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

Posted in reply to IsaacNakamura

04-11-2016 05:54 PM

To do anything with "difference" I think you need your responses to be numeric. I think you might investigate Proc Npar1way.

```
proc format library=work;
invalue response
'bad' = 1
'moderate'=2
'good' =3;
run;
data example;
informat response response.;
input covariate $ response count @@;
datalines;
cov1 bad 3 cov1 moderate 4 cov1 good 0
cov2 bad 4 cov2 moderate 1 cov2 good 2
cov3 bad 5 cov3 moderate 2 cov3 good 1
;
run;
proc npar1Way data=example;
class covariate;
freq count;
var response;
exact Wilcoxon;
run;
```

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

Posted in reply to ballardw

04-11-2016 09:44 PM

Thank you! I will try.

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

Posted in reply to IsaacNakamura

04-11-2016 09:31 PM

Friedman’s Chi-Square Test can get "mean score differ" , Check example in Documentation.

proc freq data=Hypnosis;

tables Emotion * SkinResponse /cmh2 scores=rank noprint;

exact ..... ;

run;

OR You could try PROC CATMOD ,which is the best tool to build a Log-Linear Model for Contingency Table.

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

Posted in reply to Ksharp

04-11-2016 09:44 PM

Thank you. I will try!

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

Posted in reply to IsaacNakamura

04-12-2016 07:56 AM

For an overview of the various exact tests in PROC FREQ, see "Exact tests in PROC FREQ: What, when, and how."

The PROC FREQ doc says "The Jonckheere-Terpstra test is appropriate for a two-way table in which an ordinal column variable represents the response."

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

Posted in reply to Rick_SAS

04-14-2016 02:54 PM

Thank you! I will try.