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

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

12-28-2013 06:01 PM

Welcome Rick Wicklin, FD

I am a master's student in mathematical statistics ..

I have a problem in the formation model to calculate the Spearman coefficient of permutations (manual means without the use of Spearman coefficient of built-in device)

I arrived for this model .. And stood in the programming Spearman coefficient ..

DM 'LOG; CLEAR; OUTPUT; CLEAR;';

% let n = 3;

data perm & n (drop = i);

array a {& n};

do i = 1 to &n; a * = i;*

end;

do i = 1 to fact (& n);

call allperm (i, of a

output;

end;

run;

proc print data = perm &n;

proc iml;

use perm &n;

read all var {a1 a2 a3} into b;

print b;

run;

quit;

I hope to help you ..

Thanks in advance for your cooperation ..

Every year, you are fine ..

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

Posted in reply to sultan_alhothli

12-31-2013 07:18 AM

The Spearman correlation is just the Pearson correlation of the ranks. For your permutation data, the ranks of the data equals the data themselves, right? So the Spearman correlation of the permutations is identical to regular Pearson computation.

To see this, run the following:

ods select PearsonCorr SpearmanCorr;

proc corr data = perm&n pearson spearman;

run;

Presumably you are familiar with how to compute the Pearson correlation manually. If not, see any textbook, or the doc for the CORR procedure.

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

Posted in reply to Rick_SAS

12-31-2013 08:26 AM

First: Happy new year to you ..

Secondly, thank you for your response objective ..

I my English a little bit weak .. I hope that is not affected in the delivery of my idea to you ..

1) I do not want to use the built-in Spearman coefficient within the SAS ..

I know the method of calculating the Spearman coefficient manually .. but when you have been applying method in Alsace in standing problem while Calculate the difference between the first row and the rest of the rows ..

2) What is the method to use ( do loop ) in ( proc iml ) ?

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

Posted in reply to sultan_alhothli

12-31-2013 03:49 PM

PROC IML has a CORR function that you can use for Pearson or Spearman correlations. See SAS/IML(R) 12.3 User's Guide

However, if you want to write a module that reproduces the built-in computations, use the 'MyCorr' function in the article Computing covariance and correlation matrices - The DO Loop