R and WinBUGS code for diagnosing threats on the basis of wildlife census records