There is a source DF:
FIRM x1 x2 1 4 4 1 2 34 1 3 4 1 4 4 2 4 4 2 4 4 2 4 4 2 2 4 3 3 3 3 2 3 3 2 2
It is necessary to take each of the FIRMs, take the correlation between x1 and x2, and output to the new DF.
That is, at the output you need to get something like this:
FIRM CORR 1 ….. 2 ….. 3 ….