From: peter on
Hello people, I am new to this forum and i have a question regarding
how to calculate correlation in SAS.

In my sample, I have 4 variables, PERMNO, DATE, VOLUME, RETURN. PERMNO
is a firm identifier.
I have 100 firms with their time series return and volumes data. My
question is the following. On each day and for any given firm, i want
to have a variable that shows the average correlation between this
firm and all other firms using previous 1 year's return data to
estimate the correlation. So for example for firm A, this variable
equals to [CORR(A,B)+CORR(A,C)+.......+CORR(A,Z)]/25, so B-Z are 25
different firms.

Any help would be greatly appreciated. Thanks in advance.