Measuring the risk of HIV transmission