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
input covariate $ response $ count @@;
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;
tables covariatename*outcomename / exact
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.
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;
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 ..... ;
OR You could try PROC CATMOD ,which is the best tool to build a Log-Linear Model for Contingency Table.
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."