Estimating protection through residuals from the gravity model