Dear Statalist,

I am trying to calculate a variable called "Mdistance" that was introduced in Baier et al. "Economic Determinants of FTAs Revisited" (2014)".

This is the equation of the variable.

MDistij = ln (1/N)× (ΣNk=1 Dtik + ΣNk=1 Dtjk)

Dt is a bilateral distance between country i and j.


The question is that I am very beginner and I don't know how to calculate this variable.

Could you kindly suggest what I should do?