Different roles of concurring climate and regional land-use changes in past 40 years’ insect trends
All statistical analyses were performed through R version 4.1.050. Besides the explicitly mentioned packages, the R packages cowplot51, data.table52, dplyr53, ggplot254, itsadug55, purrr56, raster57, sf58, sfheaders59, tibble60 and tidyr61 were key for data handling, data analysis, and plotting. Posterior distributions were summarised through means and credible intervals (CIs). CIs are the highest density intervals, calculated through the package bayestestR62. To summarise multiple posterior distributions, 5000 Monte Carlo simulations were used.Study regionThe study included data from the whole of Switzerland. As an observation unit for records, we chose 1 × 1 km squares (henceforth squares). Switzerland covers 41,285 km2, spanning a large gradient in elevation, climate and land use. It can be divided into five coarse biogeographic regions based on floristic and faunistic distributions and on institutional borders of municipalities63 (Fig. 1b). The Jura is a mountainous but agricultural landscape in the northwest (~4200 km2, 300–1600 m asl; annual mean temperature: ~9.4 °C, annual precipitation: ~1100 mm (gridded climate data here and in the following from MeteoSwiss (https://www.meteoswiss.admin.ch), average 1980–2020, at sites ~500 m asl.)). The Jura is separated from the Alps by the Plateau, which is the lowland region spanning from the southwest to the northeast (~11,300 km2, 250–1400 m asl, mostly below 1000 m asl; ~9.5 °C, ~1100 mm). It is the most densely populated region with most intensive agricultural use. For the Alps, three regions can be distinguished. The Northern Alps (~10,700 km2, 350–4000 m asl; ~9.2 °C, ~1400 mm), which entail the area from the lower Prealps, which are rather densely populated and largely used agriculturally, up to the northern alpine mountain range. The Central Alps (~11,300 km2, 450–4600 m asl; ~9.5 °C, ~800 mm) comprise of the highest mountain ranges in Switzerland and the inner alpine valleys characterised by more continental climate (i.e., lower precipitation). Intensive agricultural land use is concentrated in the lower elevations and agriculture in higher elevations is mostly restricted to grassland areas used for summer grazing. The Southern Alps (~3800 km2, 200–3800 m asl; ~10.4 °C, 1700 mm) range from the southern alpine mountain range down to the lowest elevations of Switzerland and are clearly distinguished from the other regions climatically, as they are influenced by Mediterranean climate, resulting in, e.g., milder winters. Besides differences between biogeographic regions, climate, land use and changes therein vary greatly between different elevations (Supplementary Fig. S9). To account for these differences, we split the regions in two elevation classes at the level of squares. All squares with a mean elevation of less than 1000 m asl were assigned to the low elevation, whereas squares above 1000 m asl were assigned to the high elevation (no squares in the Plateau fell in the high elevation). This resulted in nine bioclimatic zones (Fig. 1b), for which separate species trends were estimated in the subsequent analyses. The threshold of 1000 m asl enabled a meaningful distinction based on the studied drivers (climate and land-use change) and was also determined by the availability of records data (high coverage in all nine bioclimatic zones).Species detection dataWe extracted records of butterflies (refers here to Papilionoidea as well as Zygaenidae moths), grasshoppers (refers here to all Orthoptera) and dragonflies (refers here to all Odonata) from the database curated by info fauna (The Swiss Faunistic Records Centre; metadata available from the GBIF database at https://doi.org/10.15468/atyl1j, https://doi.org/10.15468/bcthst, https://doi.org/10.15468/fcxtjg). This database unites faunistic records made in Switzerland from various sources including both records by private persons and from projects such as research projects, Red-List inventories or checks of revitalisation measures. Only records with a sufficient precision, both temporally (day of recording) and spatially (place of recording known to the precision of 1 km2 or less), were used for analyses. Besides temporal and spatial information, information on the observer and the project (if any) was obtained for each record. All records made by a person/project on a day in a square were attributed to one visit, which was later used as replication unit to model the observation process (see below).We included records from the focal time range 1980–2020. Additionally, we included records from 1970–1979 for butterflies in occupancy-detection models to increase the robustness of mean occupancy estimates. We excluded the mean occupancy estimates for these additional years from further analyses to cover the same period for all groups. Prior to analyses, following the approach in ref. 26, we excluded observations of non-adult stages and observations from squares that only were visited in 1 year of the studied period, because these would not contain any information on change between years64. This resulted in 18,018 squares (15,248 for butterflies, 9870 for grasshoppers, 5188 for dragonflies) and 1,448,134 records (879,207 butterflies, 272,863 grasshoppers, 296,064 dragonflies) that we included in the analyses (Supplementary Fig. S2). The three datasets for the different groups were treated separately for occupancy-detection modelling, following the same procedures for all three groups. To determine detections and non-detections for each species and visit, which could then be used for occupancy-detection modelling, we only included visits that (a) did not originate from a project, which had a restricted taxonomic focus not including the focal species, (b) were not below the 5% quantile or above the 95% quantile of the day of the year at which the focal species has been recorded26 and (c) were from a bioclimatic zone, from which the focal species was recorded at least once.Occupancy-detection modelsWe used occupancy-detection models65,66 to estimate annual mean occupancy of squares for the whole of Switzerland and for the nine bioclimatic zones for each species (i.e., mean number of squares occupied by a species), mostly following the approach in ref. 26. We fitted a separate model for each species, based on different datasets for the three groups. We included only species that were recorded in any square in at least 25% of all analysed years. Occupancy-detection models are hierarchical models in which two interconnected processes are modelled jointly, one of which describes occurrence probability (ecological process; used to infer mean occupancy), whereas the other describes detection probability (observation process)65. The two processes are modelled through logistic regression models. The occupancy model estimates occurrence probability for all square and year combinations, whereas the observation model estimates the probability that a species has been detected by an observer during a visit. More formally, each square i in the year t has the latent occupancy status zi,t, which may be either 1 (present) or 0 (absent). zi,t depends on the occurrence probability ψi,t as follows$${z}_{i,t}sim {{{mbox{Bern}}}}left({psi }_{i,t}right)$$
(1)
The occupancy status is linked to the detection/non-detection data yi,t,j at square i in year t at visit j as$${y}_{i,t,, j}{{|}}{z}_{i,t}sim {mathrm {Bern}}({z}_{i,t}{p}_{i,t,j})$$
(2)
where pi,t,j is the detection probability.The regression model for occurrence probability (occupancy model) looked as follows$${{mbox{logit}}}({psi }_{i,t})={mu }_{o}+{beta }_{o1}{{{{{rm{elevatio}}}}}}{{{{{{rm{n}}}}}}}_{i}+{beta }_{o2}{{{{{rm{elevatio}}}}}}{{{{{{rm{n}}}}}}}_{i}^{2}+{alpha }_{o1,i}+{alpha }_{o2,i}+{gamma }_{r(i),t}$$
(3)
with μo being the global intercept, elevationi being the scaled elevation above sea level and αo1,i, αo2,i and γr(i),t being the random effects for fine biogeographic region (12 levels, Supplementary Fig. S10; these were again defined based on floristic and faunistic distributions and followed institutional borders63), square and year. The random effects for fine biogeographic region and square were modelled as follows:$${alpha }_{o1}sim {{{{{rm{Normal}}}}}}left(0,{sigma }_{o1}right)$$
(4)
and$${alpha }_{o2}sim {{{{{rm{Normal}}}}}}left(0,{sigma }_{o2}right)$$
(5)
The random effect of the year was implemented with separate random walks per zone following ref. 67, which allowed the effect to vary between the nine bioclimatic zones, while accounting for dependencies among consecutive years. Conceptually, in random walks, the effect of 1 year is dependent on the previous year’s effect, resulting in trajectories with less sudden changes between consecutive years. This was implemented as follows:$${gamma }_{r,t}sim left{begin{array}{c}{{{{{rm{Normal}}}}}}left(0,{1.5}^{2}right){{{{rm{for}}}}},t=1\ {{{{{rm{Normal}}}}}}left({gamma }_{r,t-1},{sigma }_{gamma r}^{2}right){{{{rm{for}}}}},t , > ,1end{array}right.$$
(6)
with$${sigma }_{gamma r}sim {{mbox{Cauchy}}}left(0,1right)$$
(7)
The regression model for detection probability (observation model) looked as follows$${{{{rm{logit}}}}}({p}_{i,t,j}) =, {mu }_{d}+{beta }_{d1}{{{{{rm{yda}}}}}}{{{{{{rm{y}}}}}}}_{j}+{beta }_{d2}{{{{{rm{yda}}}}}}{{{{{{rm{y}}}}}}}_{j}^{2}+{beta }_{d3}{{{{{rm{shortlis}}}}}}{{{{{{rm{t}}}}}}}_{j}+{beta }_{d4}{{{{{rm{longlis}}}}}}{{{{{{rm{t}}}}}}}_{j} \ quad+ {beta }_{d5}{{{{{rm{exper}}}}}}{{{{{{rm{t}}}}}}}_{j}+{beta }_{d6}{{{{{rm{projec}}}}}}{{{{{{rm{t}}}}}}}_{j}+{beta }_{d7}{{{{{rm{targeted}}}}}}_{{{{{rm{projec}}}}}}{{{{{{rm{t}}}}}}}_{j} \ quad+ {beta }_{d8}{{{{{rm{redlis}}}}}}{{{{{{rm{t}}}}}}}_{j}+{alpha }_{d1,t}$$
(8)
where μd is the global intercept, ydayj is the scaled day of the year of visit j, shortlistj and longlistj are dummies of a three-level factor denoting the number of species recorded during the visit (1; 2–3; >3), and expertj, projectj, targeted_projectj and redlistj are dummies of a five-level factor denoting the source of the data. The source might either be a common naturalist observation (reference level), an observation by an expert naturalist, an observation made during a not further specified project, an observation made in a project targeted at the focal species or an observation made during a Red-List inventory. An expert naturalist was defined as an observer that contributed a significant number of records, which was defined as the upper 2.5% quantile of all observers arranged by their total number of records, and that made at least one visit with an exceptionally long species list, which was defined as a visit in the upper 2.5% quantile of all visits arranged by the number of records. The proportions of records originating from these different sources changed across years, but change was not unidirectional and differed among the investigated groups (Supplementary Fig. S11), such that accounting for data source in the model should suffice to yield reliable estimates of occupancy trends. αd1,t is a random effect for year, which was modelled as$${alpha }_{d1}sim {{{{{rm{Normal}}}}}}left(0,{sigma }_{d1}right)$$
(9)
The occupancy and observation models were fitted jointly in Stan through the interface CmdStanR68. Four Markov chain Monte Carlo chains with 2000 iterations each, including 1000 warm-up iterations, were used. Priors of the model parameters are specified in Supplementary Table S5. For the prior distribution of global intercepts, a standard deviation of 1.5 was chosen to not overweight the extreme values on the probability scale. To ensure that chains mixed well, Rhat statistics for annual mean occupancy estimates were calculated through the package rstan69. For Switzerland-wide annual estimates (n = 18,140), 98.0% of values met the standard threshold of 1.1 (99.9% of values More