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
- /
- Compare two distribution of correlation coefficien...

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

03-21-2011 08:53 AM

Hi,

I would compare two distributions of correlation coefficient A and B (two sample of correlation coefficients). I want to know if B came from the same population as A. A and B are not independent. (so KS test not applicable)

How can I do this?

best regards,

I would compare two distributions of correlation coefficient A and B (two sample of correlation coefficients). I want to know if B came from the same population as A. A and B are not independent. (so KS test not applicable)

How can I do this?

best regards,

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

Posted in reply to nadra

03-21-2011 11:21 PM

It looks like you are perform t-test by useing correlation coefficient statistic estimator ?

If it is, you do not need to calculate the correlation coefficient separately.

proc ttest has do it for you automatically.

Ksharp

If it is, you do not need to calculate the correlation coefficient separately.

proc ttest has do it for you automatically.

Ksharp

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

Posted in reply to Ksharp

03-22-2011 05:18 AM

> It looks like you are perform t-test by useing

> correlation coefficient statistic estimator ?

> If it is, you do not need to calculate the

> correlation coefficient separately.

> proc ttest has do it for you automatically.

>

>

> Ksharp

Hi Ksharp, thanks for answering!

A ttest will be based only on mean comparison, so it is not my objective. I want to compare a distribution of correlation coefficient to another one distribution of coorelation coefficient .

Say if A is a distribution of (1000) correlation coefficient obtained from corrlation between average scores on a population N and B another distribution of (1000) correlation coefficient obtained from correlation between average scores on a population n (nЄN).

a ttest reject the equality of A and B even if mean A =0.98 and mean B= 0.97?!!

nadra

> correlation coefficient statistic estimator ?

> If it is, you do not need to calculate the

> correlation coefficient separately.

> proc ttest has do it for you automatically.

>

>

> Ksharp

Hi Ksharp, thanks for answering!

A ttest will be based only on mean comparison, so it is not my objective. I want to compare a distribution of correlation coefficient to another one distribution of coorelation coefficient .

Say if A is a distribution of (1000) correlation coefficient obtained from corrlation between average scores on a population N and B another distribution of (1000) correlation coefficient obtained from correlation between average scores on a population n (nЄN).

a ttest reject the equality of A and B even if mean A =0.98 and mean B= 0.97?!!

nadra

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

Posted in reply to nadra

03-22-2011 11:46 PM

Hi.

How about Wilcox Rank Sum test ? It is assuming A and B both from the same distribution. And it is non-parameter method , which is much robust.

Ksharp

How about Wilcox Rank Sum test ? It is assuming A and B both from the same distribution. And it is non-parameter method , which is much robust.

Ksharp

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

Posted in reply to Ksharp

03-23-2011 10:53 AM

> Hi.

> How about Wilcox Rank Sum test ? It is assuming A and

> B both from the same distribution. And it is

> non-parameter method , which is much robust.

>

>

> Ksharp

Hi,

I used the test also but what I see is that these tests are very sensitive. As I mentionned above even if the two distribution have the same shapes, same means, the test tend to reject the hypothesis of the equality if the two distribution.

Does a quantile test exists? something that compares paired quantiles ?

Thanks,

> How about Wilcox Rank Sum test ? It is assuming A and

> B both from the same distribution. And it is

> non-parameter method , which is much robust.

>

>

> Ksharp

Hi,

I used the test also but what I see is that these tests are very sensitive. As I mentionned above even if the two distribution have the same shapes, same means, the test tend to reject the hypothesis of the equality if the two distribution.

Does a quantile test exists? something that compares paired quantiles ?

Thanks,

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

Posted in reply to nadra

03-24-2011 12:19 AM

Hi.

If you want to compare paired quantiles.

You can make another 'difference' variable ( dif = A -B ),then test whether its mean equal zero.

But I am not quit sure this method's power, since you want some exact distribution test.

Ksharp

If you want to compare paired quantiles.

You can make another 'difference' variable ( dif = A -B ),then test whether its mean equal zero.

But I am not quit sure this method's power, since you want some exact distribution test.

Ksharp

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

Posted in reply to nadra

03-22-2011 09:38 AM

Hello Nadra,

I still do not understand why you can not use KS. A null hypothesis for KS is that both samples are drawn from the same distribution. Is not it your purpose?

Sincerely,

SPR

I still do not understand why you can not use KS. A null hypothesis for KS is that both samples are drawn from the same distribution. Is not it your purpose?

Sincerely,

SPR

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

03-23-2011 10:24 AM

> Hello Nadra,

>

> I still do not understand why you can not use KS. A

> null hypothesis for KS is that both samples are drawn

> from the same distribution. Is not it your purpose?

>

> Sincerely,

> SPR

Hi,

Indeed, my purpose is is that both samples are drawn from the same distribution but KS assumption suppose that A and B are independent which is not the case here

Thanks

>

> I still do not understand why you can not use KS. A

> null hypothesis for KS is that both samples are drawn

> from the same distribution. Is not it your purpose?

>

> Sincerely,

> SPR

Hi,

Indeed, my purpose is is that both samples are drawn from the same distribution but KS assumption suppose that A and B are independent which is not the case here

Thanks

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

Posted in reply to nadra

03-24-2011 04:09 PM

You can use the GLIMMIX procedure to test hypotheses about correlations in dependent data. Below is code to generate variables Y1, Y2, and Y3 with a specified correlation structure. After generating the data, PROC CORR is run to show that the specified correlation structure was actually generated. The data are then written in a form suitable for the GLIMMIX procedure and then the GLIMMIX procedure is invoked with a COVTEST statement to test equality of two of the correlations.

/***********************************/

/* Construct variables Y1, Y2, Y3 */

/* which have covariance structure */

/* */

/* 1 rho12 rho13 */

/* rho12 1 rho23 */

/* rho13 rho23 1 */

/***********************************/

data test;

rho12 = 0.6;

rho13 = 0.6;

rho23 = 0.3;

a11 = 1;

a21 = rho12;

a31 = rho13;

a22 = sqrt(1 - a21**2);

a32 = (rho23 - a31*a21)/a22;

a33 = sqrt(1 - a31**2 - a32**2);

do subject=1 to 10000;

x1 = rannor(1234579);

x2 = rannor(1234579);

x3 = rannor(1234579);

y1 = a11*x1;

y2 = a21*x1 + a22*x2;

y3 = a31*x1 + a32*x2 + a33*x3;

output;

end;

drop rho: a: x:;

run;

/* Compute correlations between Ys */

proc corr data=test;

var y:;

run;

/* Write the data in long form */

/* for use in GLIMMIX procedure */

data test_long;

set test;

y = y1; response=1; output;

y = y2; response=2; output;

y = y3; response=3; output;

run;

/* Obtain correlations using the GLIMMIX procedure */

/* and test whether the rho12=rho13. */

proc glimmix data=test_long;

class subject response;

model y =;

random response / subject=subject residual type=unr;

covtest general 0 0 0 -1 1 0;

run;

Feel free to modify the code to change the correlations. You might also want to change the sample size. I used a very large sample size to demonstrate that the assumed correlations were actually generated.

/***********************************/

/* Construct variables Y1, Y2, Y3 */

/* which have covariance structure */

/* */

/* 1 rho12 rho13 */

/* rho12 1 rho23 */

/* rho13 rho23 1 */

/***********************************/

data test;

rho12 = 0.6;

rho13 = 0.6;

rho23 = 0.3;

a11 = 1;

a21 = rho12;

a31 = rho13;

a22 = sqrt(1 - a21**2);

a32 = (rho23 - a31*a21)/a22;

a33 = sqrt(1 - a31**2 - a32**2);

do subject=1 to 10000;

x1 = rannor(1234579);

x2 = rannor(1234579);

x3 = rannor(1234579);

y1 = a11*x1;

y2 = a21*x1 + a22*x2;

y3 = a31*x1 + a32*x2 + a33*x3;

output;

end;

drop rho: a: x:;

run;

/* Compute correlations between Ys */

proc corr data=test;

var y:;

run;

/* Write the data in long form */

/* for use in GLIMMIX procedure */

data test_long;

set test;

y = y1; response=1; output;

y = y2; response=2; output;

y = y3; response=3; output;

run;

/* Obtain correlations using the GLIMMIX procedure */

/* and test whether the rho12=rho13. */

proc glimmix data=test_long;

class subject response;

model y =;

random response / subject=subject residual type=unr;

covtest general 0 0 0 -1 1 0;

run;

Feel free to modify the code to change the correlations. You might also want to change the sample size. I used a very large sample size to demonstrate that the assumed correlations were actually generated.