Code written for R to analyse the capture-mark-recapture data of wild greater spear-nosed bats (Phyllostomus hastatus). The code utilizes the ‘Bayesian Survival Trajectory Analysis’ (BaSTA) package, which allows for survival and mortality to be estimated within a Bayesian hierarchical framework while correcting for recapture probability. The code assesses differences in survival risk and mortality between sexes (male/female) and between males of different reproductive statuses (bachelor/harem male).