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
- /
- Proc FREQ : How to get the sign of stratum-adjuste...

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

05-28-2015 12:21 PM

Hello,

The CMH statistic calculated on RIDIT scores (proc FREQ) takes the value (*n*-1)**Rs***2 where *Rs* is the Spearman rank correlation. This is of interest with multi-level tables, because it is the only way in SAS to get a stratum-adjusted Spearman correlation. How can I get the sign of *Rs*?

PG

PG

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

05-28-2015 02:54 PM

You can get Spearmen coefficients from PROC CORR with the SPEARMAN option. For example, the Spearman coefficient for the following data is 0.36332 and n=21. The CMH statistic is (21-1)*(0.36332)**2 = 2.6400

data test;

call streaminit(1);

do i = 1 to 21;

x = rand("table", 0.5, 0.3, 0.2);

y = rand("table", 0.5-x/10, 0.3, 0.2+x/10);

output;

end;

run;

proc corr data=test spearman noprob;

var x y;

run;

proc freq data=test;

tables x*y / scores=ridit cmh norow nopercent nocol;

run;

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

05-28-2015 04:29 PM

Thanks. But my question is about stratum-adjusted correlations. As with TABLES A*x*y / ...

PG

PG

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

05-28-2015 04:57 PM

Proc corr;

by A;

I would think would do it.

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

05-28-2015 05:19 PM

In proc freq, strata play a distinct role from BY analysis. A stratum-adjusted correlation is not the same as correlations by stratum. The former is a single coefficient of within strata relationship, the later are multiple coefficients, one for each stratum. - PG

PG

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

05-29-2015 07:26 PM

What about dummy coding the strata variable, then using proc corr and putting all the dummy variables in the partial statement? (I haven't checked the validity of this approach.)

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

06-01-2015 09:25 AM

Hmm, that sounds logical to me--partialling out the strata effect ought to at least get the sign correct.

Steve Denham

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

06-04-2015 05:51 PM

Back at this, at last. The partial correlation sounded indeed like an intuitively appealing idea, thanks . So I ran a simulation. Correlated random pairs were generated with proc simnormal. Data was divided into 5 groups with means 1, 2, 3, 5, 7 and Std devs 1, 2, 3, 5, 7, each group represented by 100 pairs. The exercise was repeated for correlations of 0.5 and -0.1. Partial and stratum-adjusted correlation estimates were compared for 1000 sets of 500 observations. Stratum-adjusted estimates were given the sign of the corresponding partial correlation as suggested by . Here are the results:

It is obvious to me that the two estimates are somewhat related and sligntly biassed toward zero, but certainly not equivalent. In the small negative correlation simulation, about 1% of the stratum-adjusted correlations were given the *wrong* sign.

PG

PG