TITLE: Survival analyses protocol: Killing wolves to prevent predation on livestock may protect one farm but harm
neighbors
AUTHORS: Francisco  Santiago-Ávila, Adrian Treves, Ari Cornman

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block"> Large carnivores, such as wolves Canis lupus, are difficult to protect in mixed-use landscapes because some people perceive them as dangerous and because they sometimes threaten human property and safety. Governments may respond by killing carnivores in an effort to prevent repeated conflicts or threats, although the functional effectiveness of lethal methods has long been questioned. We evaluated two methods of government intervention following independent events of verified wolf predation on domestic animals (depredation) in the Upper Peninsula of Michigan, USA between 1998-2014, at three spatial scales. We evaluated two intervention methods using log- rank tests and conditional Cox recurrent event, gap time models based on retrospective analyses of the following quasi-experimental treatments: (1) selective killing of wolves by trapping near sites of verified depredation, and (2) advice to owners and haphazard use of non-lethal methods without wolf-killing. The government did not randomly assign treatments with a pseudo-control (no removal of wolves was not a true control), but the federal permission to intervene lethally was granted and rescinded independent of events on the ground. Hazard ratios suggest lethal intervention was associated with a statistically insignificant 27% lower risk of recurrence of events at trapping sites, but offset by a similar 22% statistically insignificant increase in risk of recurrence at sites up to 5.42 km distant in the same year, compared to the non-lethal pseudo-control. Our results do not support the hypothesis that Michigan's use of lethal intervention after wolf depredations was effective for reducing the future risk of recurrence in the vicinities of trapping sites. Examining only the sites of intervention seems incomplete because neighbors of trapping sites may suffer the recurrence of depredations. We propose two new hypotheses for perceived effectiveness: (a) killing predators may be perceived as effective because of the benefits to a small minority of farmers, and (b) if neighbors experience displaced depredations, they may perceive the problem growing and then demand more lethal intervention rather than detecting the apparent displacement of wolves and problems from the first trapping site. Ethical wildlife management guided by the 'best available scientific and commercial data available' would suggest suspending the standard method of trapping wolves in favor of non-lethal methods (livestock guarding dogs or fladry) that have been proven effective in preventing livestock losses in Michigan.
  
 Here, we make available our protocol for our statistical survival analysis, in the form of sample STATA Code, for easier replication of the statistical analyses of our study.
 </div></div>

[STEPS]
?. Variables and Sample STATA 14 .Do file used for survival analyses at each spatial scale
?. Here, we make available basic sample code for the statistical survival analyses employed in our manuscript. This code should allow for replication of analyses at all spatial scales for all datasets involved.*
?. 1. VARIABLES USED (and description):
?. ID_TRS_yr --> identifier for each area-year combination (please see study for more information)
?. Interv_dich --> intervention type (lethal, non-lethal)
?. wolves_killed --> number of wolves killed
?. Interv_dummy --> dummy variable for intervention type (0 if ‘non-lethal’, 1 if ‘lethal’)
?. Delay_in_yrstop_time --> time to recurrent event (in days) or censoring
?. status_event --> failure binary variable (1 if recurrent event; 0 if censored)
?. start_time --> start time variable (all obs ‘0’)
?. yr_stratum --> order of recurrent events within a particular area-yr†
?. year --> year variable (1998-2014)
?. 2. SAMPLE .DO FILE (Section scale)‡:
?. clear all
?. cd “/Location/Of/File”
?. log using "Name.smcl", replace
?. set mem 1g
?. use "Data.dta", replace
?. set more off, permanently
?. ************************************************
?. ****Replacing intervention type if wolves_killed = 0§
?. ************************************************
?. replace Interv_dich="non-lethal" if wolves_killed==0
?. replace Interv_dummy=0 if Interv_dich=="non-lethal"
?. ************************************************
?. ***Set data as survival time for PWP-GT model
?. ************************************************
?. stset Delay_in_yrstop_time, failure(status_event) exit(time .) enter(start_time)
?. list ID_TRS_yr _t0 _t _d _st**
?. stdescribe
?. stsum
?. ************************************************
?. ***Limiting analysis to # of Strata††
?. ************************************************
?. use “Data_Strata#.dta”
?. stset Delay_in_yrstop_time, failure(status_event) exit(time .) enter(start_time)
?. stdescribe
?. stsum
?. *Comparing survival functions by group
?. sts list, by(Interv_dich)
?. sts list, by(Interv_dich) compare
?. *Graphing survival functions by group
?. sts graph, by(Interv_dich)
?. sts graph, fail by(Interv_dich)
?. *Graphing smoothed hazard estimates (hazard ratio) by group
?. sts graph, hazard by(Interv_dich)
?. sts graph, cumhaz by(Interv_dich)
?. *Testing equality of survival functions by group (Log-rank test)
?. sts test Interv_dich
?. sts test Interv_dich, strata(yr_stratum)
?. ***COX MODELS (stcox)***
?. **STRATIFIED**
?. stcox Interv_dummy year, strata(yr_stratum) vce(cluster ID_TRS_yr)
?. stcox Interv_dummy year, nohr strata(yr_stratum) vce(cluster ID_TRS_yr)
?. *Checking Proportional Hazard assumptions
?. estat phtest, log detail
?. estat phtest, plot(Interv_dummy)
?. stphplot, by(Interv_dummy)
?. estat phtest, plot(year)
?. stphplot, by(year)
?. *Adding time-varying covariate to account for proportional hazard assumption violation
?. stcox Interv_dummy year, tvc(Interv_dummy) texp(_t) strata(yr_stratum) vce(cluster ID_TRS_yr)
?. *FRAILTY (MIXED-EFFECTS) MODEL**
?. strmcure Interv_dummy year, shared(ID_TRS_yr) strata(yr_stratum)
?. ************************************************
?. ***Correlation between delay between incidents and wolves killed (for ‘Lethal’ only)
?. ************************************************
?. spearman Delay_in_yrstop_time wolves_killed if Interv_dich=="Lethal"
?. log close
?. * This sample code does not include code lines for dropping or adding observations, which we did for the alternate datasets used. However, this should only involve basic coding, and descriptions of observations included or dropped for each dataset can be found in the study.
?. † ‘Area’ refers to the section, neighborhood or neighborhood of township area scales.
?. ‡ A similar procedure was used for the township and neighborhood of township scales, using their respective spatial unit identifiers.
?. § This section was used for our main dataset. We removed this section of code for our alternate ‘traps-placed’ dataset, to include as ‘lethal’ those cases were attempts were made to trap wolves (please see study).
?. ** May need to break ties in Delay_in_yrstop_time variable to retain observations (please see stset help in Stata)
?. †† A separate dataset was created including only those area-year records with strata (yr_stratum) values with enough observations to be properly modelled (please see study).
?. ---------------
?. ----------------------------------------
?. ---------------
?. ----------------------------------------
?. Santiago-Ávila, Cornman & Treves, 2017