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)
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.
> 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.
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?!!
> 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.
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 ?
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.
> 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?
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
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.
/* Compute correlations between Ys */
proc corr data=test;
/* Write the data in long form */
/* for use in GLIMMIX procedure */
y = y1; response=1; output;
y = y2; response=2; output;
y = y3; response=3; output;
/* 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;
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.