R analysis code for TB migrant dataset