Page 1 of 1

Euclidean distance

Posted: Tue Jun 14, 2022 5:44 am
by papel
Hi to all,
I have a panel dataset with id and timeid and I would like to calculate the Euclidean distance in two variables.
Specifically, in each month I rank all firms on variable X and on variable Y, and I would like to find the minimum Euclidean distance in X and Y rank space, where the distance between firms i and j equals to (rankXi-rankXj)^2+(rankYi-rankYj)^2
Thank you in advance.