Unexpectedly diverse forest dung beetle communities in degraded rain forest landscapes in Madagascar

Tropical forests, which harbor high levels of biodiversity, are being lost at an alarming speed. Madagascar, a biodiversity hotspot, has lost more than half of its original forest cover. Most of the remaining forests are small fragments of primary and secondary forest with differing degrees of human impact. These forests, as well as coffee and fruit plantations, may be important in supporting the forest‐dependent biodiversity in Madagascar but this has been little studied. In Madagascar, dung beetles, which offer important ecosystem services, are largely restricted to forests. We examined the ability of fragmented and degraded forests to support dung beetle diversity, compared to the large areas of primary forest in eastern Madagascar. We found a general trend of a reduction of species with a loss of forest connectivity. In contrast, a higher level of forest disturbance was associated with higher species diversity. In several sites of low‐quality forest as many or more species were found as in less disturbed and primary forests. The average size of dung beetles was smaller in the lower quality localities than in the primary forests. These findings suggest that many forest dung beetles in Madagascar are better adapted to forest disturbance than earlier expected, although they require some level of connectivity to surrounding forest.

1998), geographic areas (Phillips, Newbold, & Purvis, 2017), type of modification (Chaudhary, Burivalova, Koh, & Hellweg, 2016), and spatial scale (Dumbrell et al., 2008). Instability of human-modified tropical landscapes, time lags in species responses, functional consequences of species loss, and cascading effects through losses of species interactions further complicate generalizations (Gardner, Barlow, Sodhi, & Peres, 2010). However, one commonly recognized pattern is a decrease in species diversity along a gradient from pristine forest through different levels of disturbed natural forests and cultivated forests to shrubbery and open habitat (Basset et al., 2008;Harvey et al., 2006;Schulze et al., 2004). Many studies acknowledge the irreplaceability of native forests for biodiversity conservation but also recognize the importance of the supplementary effect of human-modified forests for conservation (Anand, Krishnaswamy, Kumar, & Bali, 2010;Barlow et al., 2007;Gibson et al., 2011).
In Madagascar, which is one of the world's tropical biodiversity hotspots (Myers, Mittermeier, Mittermeier, Fonseca, & Kent, 2000), 90% of species are dependent on forests (Dufils, 2003). Yet, less than half of the original forest cover is left, of which more than half is fragmented or located near forest edges (Allnutt et al., 2008;Harper, Steininger, Tucker, Juhn, & Hawkins, 2007). Only 6% of the land area is protected (UNEP-WCMC, 2019), and deforestation and forest degradation continue at varying and often underestimated rates (Allnutt, Asner, Golden, & Powell, 2013). However, secondary forests and forest fragments may offer suitable habitats to forest species. For example, an extensive study in the Brazilian Amazon found that on average secondary forests were able to support 59% and tree plantations 47% of primary forest species belonging to 15 different species groups (Barlow et al., 2007).
Habitat modification tends to generate species poor and homogeneous communities, as many species with strict habitat requirements are replaced by more generalist species (McKinney & Lockwood, 1999). Similarly in Madagascar, the loss of diversity, as well as species turnover from endemic specialists to introduced generalists, results in changes in species composition from good quality forests to poorer and less connected forests (Irwin et al., 2010). This has been studied mainly with lemurs, the highly diverse group of primates endemic to Madagascar (e.g., Dehgan, 2003;Ganzhorn et al., 2000). Other species groups remain little studied, but it seems that the pattern in species responses to forest disturbance is not as clear for other groups as for lemurs.
Dung beetles provide important ecosystem services. They use and bury dung and carrion; moving and burying them into the soil as resources for their offspring or using the dung pile itself as a nest; and making tunnels into it. Through these, they aid in nutrient cycling, soil aeration and seed dispersal and reduce the spread of diseases (Nichols et al., 2008). Dung beetles are sensitive to changes in temperature and humidity (Roslin & Viljanen, 2011), which change as the physical patterns of a forest change, and especially from forested to open habitats. Thus, dung beetle communities in forested and open habitats typically consist of different species (Hanski & Cambefort, 1991).
Majority of the species are restricted to forests (Hanski, Wirta, Nyman, & Rahagalala, 2008), where they speciated in parallel with lemurs, the native primates including the largest land mammals of the island, and later possibly with other mammals (Wirta et al., , 2010. Lemur dung is presumed to be the most important resource especially for Helictopleurina, which include several dung specializing species (Viljanen, Wirta, et al., 2010b), although dung beetle feeding on dung of other mammals native to Madagascar, including mainly rodents and insectivores, has not been studied. Compared to other tropical regions, many Malagasy dung beetles are more flexible in their resource use and feed on both dung and carrion (Viljanen, Wirta, et al., 2010b), although very few species accept cow dung (Rahagalala, Viljanen, Hottola, & Hanski, 2009). This flexibility might help them to survive in degraded forests and fragments where large mammals are scarce. Yet, little is known of dung beetle communities in the small and degraded forest patches, and the ability of these forests to support the species diversity. It is probable that numerous species of Malagasy dung beetles have already gone extinct due to forest loss, especially within the area of previous eastern low-elevation forests, as they have been nearly completely cleared (Hanski, Koivulehto, Cameron, & Rahagalala, 2007).
The aim of this study is to address the following two questions. First, what is the level of dung beetle species richness within fragmented and degraded humid forests in Madagascar? Second, are there systematic differences in the dung beetle species and community composition between degraded forest landscape and primary forest areas?

| Study area
Our study area consisted of a well-studied region of continuous forest, Ranomafana National Park, another little disturbed and relatively large forest area, Vatovavy, east from Ranomafana National Park, and the badly degraded area between these two, consisting mostly of agricultural land with forest fragments of different size and quality. Between Ranomafana and Vatovavy, there is a high elevational species turnover in dung beetles (I. Hanski, unpublished data 2011). The two continuous forest sites act as control sites in comparison with the degraded forest sites ( Figure S1). There are no systematic differences in the soil type within the study area.
The Ranomafana National Park is part of one of the largest remaining areas of primary rain forest in Madagascar. It is located in southeastern Madagascar ( Figure S1; 47°18′-47°37′E, 21°02′-21°25′S) and covers 43,500 ha of mid-elevation rain forest at elevations ranging from 400 to 1,400 m a. s. l. The average annual rainfall in Ranomafana area is 2,300-4,000 mm, the heaviest rains taking place in December-March. Average monthly temperatures vary between 15 and 24°C (Lehtonen, Mustonen, Ramiarinjanahary, Niemelä, & Rita, 2001). Ranomafana National Park harbors a rich community of mammals, including 13 species of lemurs (Wright et al., 2012). Our sampling in Ranomafana took place in the Talatakely area near the entrance of the park.
The Vatovavy mountain (47°56′E, 21°24′S) lies about 50 km southeast from Ranomafana ( Figure S1) and comprises 1,600 ha of unprotected lowland rain forest at elevations from 150 to 500 m a.s.l., which has remained relatively undisturbed owing to its sacred status in local culture. The average annual rainfall is 1,800 mm and average monthly temperatures vary between 16 and 31°C (Manjaribe, Frasier, Rakouth, & Louis, 2013). At least nine species of lemurs are known to occur in the area (Holmes et al., 2015;Louis, Ranaivoarisoa, McGuire, & Johnson, 2013).
Between Ranomafana and Vatovavy, the landscape consists mostly of agricultural land, small forest fragments, and secondary vegetation (Puhakka, 2012). More than half of the forest cover in Madagascar was already lost by the 1950s, but most of the deforestation in our study area has happened after that (Allnutt et al., 2008;Harper et al., 2007). During the time period of 1990-2005, the deforestation rate in the study area was around 1.3%-1.5% per year (Puhakka, 2012), and in a nearby forest corridor between the Ranomafana and Andringitra National Parks in 2000-2012, the annual deforestation rate was estimated as 0.88 and 1.5% in degraded and primary forest, respectively (Ramiadantsoa, Ovaskainen, Rybicki, & Hanski, 2015). Certain species of lemurs are known to be able to survive in fragments and degraded habitats between Ranomafana and Vatovavy, although in reduced numbers (Dehgan, 2003;Holmes et al., 2015). In addition to lemurs, selectively logged forests support diverse communities of native rodents whereas introduced Rattus rattus is spreading in open and anthropogenic landscapes (Lehtonen et al., 2001).
The study area forms an elevational gradient from high elevations in Ranomafana to low elevations at the base of the Vatovavy Mountain. The gradient is not strictly linear but the elevation rises slightly in the middle of the study area to then descend sharply to its lowest point at around 100 m a. s. l. and to then rise again to the slopes of the Vatovavy Mountain. Remaining forest cover is not spread evenly between Ranomafana and Vatovavy, but forms clusters of fragments, located on different elevations and distances from the large forested areas. The locations for the study sites in the degraded area were chosen as randomly as possible, taking into account the reachability of the sites, to cover the remaining vegetation outside agricultural areas between Ranomafana and Vatovavy. However, the distribution of the study sites had to be adjusted to the structure of the landscape and the variation in the attitudes of the locals toward the sampling. Due to this unavoidable spatial structure in our sampling sites, we have divided them into seven sampling zones ( Figure S1, Table S1). These zones have been used as a random variable in the statistical analyses to remove the impact of the spatial autocorrelation from the results.

| Sampling
We sampled dung beetles in 6 sites in Ranomafana, five in Vatovavy, and 44 in the degraded area ( Figure S1). The smallest distance between two individual study sites was 224 meters. In each site, we set up one transect of 15-60 pitfall traps, the number depending on the amount of bait material available each time. The traps were plastic cups (1.5 dl), set up in a line with a five-meter interval in as uniform vegetation as possible, and avoiding proximity to forest edges. About a fifth of the volume of each cup was filled with water and a drop of detergent to reduce surface tension, and a big leaf was placed as a cover to prevent the cup from filling up with rain water. The traps were baited with a piece of 4 cm 3 of either fish (Tilapia) or chicken intestine, which have been observed to attract at least 80% of forest-dwelling Malagasy dung beetles (Viljanen, Wirta, et al., 2010b). Chicken intestine was only used in zone VI, where no fish was available. Thus, the possible differences in the attractiveness of the bait types are accounted for by including sampling zone as a random variable in the analyses.
The sampling was conducted in 2011-2012 from mid-November until mid-January, which is the most active season of Malagasy dung beetles (Viljanen, Wirta, et al., 2010b). Weather during the study was typical for the season. In November, rainfall was low and maximum daily temperatures varied between 24 and 34°C. Rains increased toward the end of the sampling period, and maximum daily temperatures declined to 22-28°C in January. The duration of trapping was two days at most localities, with a few exceptions of one or three days. Samples were preserved in 95% ethanol.

| Environmental variables and connectedness of the study sites
The quality of the vegetation at each study site was visually assessed using four classes. The classes were determined based on qualitative estimations of vegetation structure and signs of human impact, using canopy heights, measured by a hypsometer, as supportive information. The detailed descriptions of the vegetation classes are presented in Table 1. In addition, altitude was measured (Garmin Ltd, GPSmap 62s) in the midpoint of each transect.
Connectivity values were calculated to describe the spatial structure of the forest around each study site and its suitability for dung beetle dispersal. This was done by using the formula (Hanski, 1999) where connectivity (S) describes the probability of dung beetle immigration to the study site (i) from the surrounding habitat. In the present case, the formula was applied by defining A j as the proportion of forest of the area of ten 100-m-wide annular buffers until 1,000 m radius from the study sites (i). In this case, d ij is the distance between the study site and the midpoint of the buffer. The area of forest in the buffers was calculated in ArcGIS (version 9.0) with help of the satellite image-based land cover classification of the Ranomafana area produced by Puhakka (2012). Two categories of this classification, namely primary and secondary forest, were summed to get the total forest area within each buffer. The constant α describes dung beetle dispersal capacity 1/α being the average dispersal distance in meters (Hanski, 1999). For the value of α, we chose 100, based on the mark and recapture experiment on Nanos viettei by Viljanen (2009), which thus represents the best estimate of a realistic dispersal distance for Malagasy forest dung beetles. The satellite images used for the land cover classification were taken in 2008.

| Data analysis
Individual-based rarefaction curves were created to estimate the adequacy of the sample size in each sampling zone (Figure 1). A reference sample from an intensive trapping in Talatakely area in the Ranomafana National Park 2003-2006 2010b) was used for comparison. As our sample only includes individuals attracted by carrion baits, two curves were created from the reference sample: one including all individuals and one including generalists and carrion specialists.
The effects of vegetation quality (Table 1), connectivity and altitude on dung beetle species richness, and average body size were analyzed using general linear mixed models with sampling zone ( Figure   S1) as a random factor. Vegetation quality was treated as an ordered categorical variable, with the four classes described above, whereas connectivity and altitude were included as continuous variables. The differences between the vegetation classes were further compared with a post hoc test (Tukey's honest significant difference). The effect of altitude was tested to illustrate the species turnover along the elevational gradient and to rule out its impact on the other results. As the sampling effort varied between study sites, species richness was indicated by the residuals of the regression of species number of the sample against the natural logarithm of the sample size. Average body size per trapping site was ln-transformed to achieve linearity. Species body sizes, given as length from the rear end of the abdomen to the head in millimeters, were acquired from the reference study by Viljanen, Wirta, et al. (2010b) and species descriptions (Montreuil, 2003(Montreuil, , 2004(Montreuil, , 2005(Montreuil, , 2007(Montreuil, , 2008Paulian, 1976). In cases where body size was given as a range, we used the mean size assuming normal distribution in body sizes. The individuals that could not be identified were measured.
The impacts of vegetation quality, connectivity, altitude, and zone on dung beetle community composition were tested in a permutational multivariate analysis of variance (PERMANOVA; Anderson, 2001) with 9,999 permutations using Bray-Curtis dissimilarity index.
Each variable was tested together with the other variables in order to see if they had independent impact on communities. Non-metric multidimensional scaling ordination (NMDS; Minchin, 1987), with square-root-transformation and Wisconsin double standardization, was used to illustrate the patterns in community structure explained by variation in spatial constraints and environmental variables between sites. Zone V was left out of the NMDS, due to the low sample size in that zone, which caused the ordination to fail to converge.

| Species richness
The sample included 4,199 individuals representing 24 species (Table 2, Table S2). Our sampling did not reach the levels of species diversity found in the reference sample from the continuous forest area of Ranomafana, where also dung baited traps were used ( Figure 1). However, the species richness in many of our sampling zones is close to the reference when dung specialists are excluded.
In all our samples, with the exception of zone V where very few individuals were collected, the rarefaction curves, representing increases in species numbers in relation to sample size, started to approach an asymptote.
Species richness varied among the study sites. Both the poorest (0 species) and the richest (11 species) study sites were in the degraded area between Ranomafana National Park and Vatovavy, not in the continuous forests. Dung beetle diversity and abundance were both lowest in zone V with several empty study sites and only three species found in total. The highest average species diversity per site was found in zone IV (5.67 species) followed by zones I (Ranomafana), III, and VII (Vatovavy) with 5.33, 5.22, and 5.20 species, respectively. The three individual study sites with highest species diversity were located in zones III (11 species), IV (10 species), and VII (Vatovavy, 9 species; Table 2, Table S2).
There were fewer species in the less connected study sites than in better connected study sites (Table 3; F 1,45.1 = 10.6, p = .002), although the largest species numbers in single study sites were collected in the degraded area, rather than in the primary forests in Ranomafana or Vatovavy. Species richness varied significantly with vegetation quality (Table 3; F 3,31.7 = 3.25, p = .035). However, according to the post hoc test, the only significant difference was between classes 1 and 4 (t 22.2 = 3.07, p = .027), with more species in shrubbery (class 1) than primary forest (class 4). Altitude did not have an effect on species richness (Table 3).
Average dung beetle body size varied with vegetation quality (Table 4; F 3,29.8 = 4.69; p = .008) and altitude (Table 4; (Table 4). Connectivity did not have an impact on the average body size (Table 4). Lack of the large species Epilissus prasinus, E. emmae obscuripennis, and Nanos bimaculatus in zones I-V is due to the regional turnover in species composition ( Figure 2) and also explains the negative effect of altitude on average body size (Table 4).

TA B L E 1 Descriptions of the vegetation classes
F I G U R E 1 Rarefaction curves for the sampling zones ( Figure S1, Table S1) and the reference sample with and without dung specialists from Viljanen, Escobar, et al. (2010a)  Epilissus emmae (Montreuil 2006) 12.25 Epilissus prasinus (Klug 1832)

| Degraded forests harbor species-rich dung beetle communities
Contrary to our expectations, the degraded forests between the

Ranomafana National Park and the Vatovavy Mountain in south-
eastern Madagascar harbored species-rich dung beetle communities. However, variation in species numbers between the study sites was high. More species were collected from the study sites which were better connected. In contrast, shrubbery harbored more species than primary forest; that is, higher level of degradation was associated with higher species richness. This fits poorly with previous studies elsewhere in the tropics, which have demonstrated that, alongside with reduction in forest area and loss of large mammals, increasing disturbance in vegetation structure is an important factor reducing the number of forest-dwelling dung beetle species (Bogoni et al., 2016;Gardner et al., 2008;Navarrete & Halffter, 2008;Nichols et al., 2013).

It is also interesting that our sampling in Ranomafana National
Park resulted in a much lower number of species compared to the reference sample from 2003-2006 (9 species in comparison with 17) even though it was conducted in the same area (Talatakely). Part of this could be explained by our smaller sampling effort, but the rarefaction curve of our sample also has a much lower angle than the reference indicating a real difference in species richness. We assume this is mostly due to our sampling covering only one season and a smaller area within Talatakely and thus a smaller number of habitats and microhabitats (e.g., elevations). For example, two species of Epilissus that were not collected by us, E. mantasoae and E. genieri, were only recorded above 1,000 m a. s. l. in the reference study (Viljanen, Wirta, et al., 2010b). In addition, severe population declines of at least two species of lemurs (Propithecus edwardsi and Prolemur simus) have been detected in Talatakely alongside with an increasing number or tourists in the area in 1993-2011 (Wright et al., 2014). Even though one lemur species (Hapalemur aureus) was also shown to have increased (Wright et al., 2014), the total reduction in resource providing mammals could have affected the local dung beetle community. No logging has been conducted in the area between the samplings (Herrera, Wright, Lauterbur, Ratovonjanahary, & Taylor, 2011). Thus, the lower number of species detected cannot be due to forest cover loss, yet the structure of the understory vegetation may have been affected by the higher number of tourists.
In addition to species diversity, we found differences in community composition between the degraded areas and primary forests.
Some of the differences are results of the species turnover along the elevational gradient between Ranomafana and Vatovavy, whereas others, like the smaller average body size in the degraded area, seem to be associated with forest loss. Below, we discuss these results and their possible consequences.

| Generalism may account for the diverse communities in the degraded forests
As described above, tropical forest-dwelling dung beetles are generally considered to tolerate only minor microclimatic variation which makes them sensitive to forest loss (Hanski & Cambefort, 1991).
Malagasy dung beetles have been thought to follow the same pattern as their communities in wet forests consist of different species compared to open and semi-open habitats (Rahagalala et al., 2009;Viljanen, Wirta, et al., 2010b), suggesting that these species have different thresholds in the level of how much microclimatic variation they can tolerate. Different levels of thermal tolerance explain also the turnover in species composition along elevational gradients for many ecologically similar species pairs in Malagasy dung beetles TA B L E 3 Results of the general linear mixed model on species richness in the study sites. The species richness is indicated by the residuals of the regression of species number of the sample against the natural logarithm of sample size. Sampling zone ( Figure S1, Table S1) was included in the analysis as a random factor. Kenward-Roger approximation was used for estimating the degrees of freedom

TA B L E 4
Results of the general linear mixed model on average size of dung beetle individuals in the study sites. Sampling zone ( Figure S1, Table S1) was included in the analysis as a random factor. Kenward-Roger approximation was used for estimating the degrees of freedom F I G U R E 2 Non-metric multidimensional scaling (NMDS) ordination of dung beetle species and abundance data (k = 2, stress = 0.17). Different symbols indicate study locations in different sampling zones. Arrows display the fitted environmental variables. Zone V is not included due to low species numbers and abundances  (Välitalo, 2012;Viljanen, Wirta, et al., 2010b). We found diverse communities of dung beetles in highly degraded vegetation, but only when the level of connectivity was high enough, in other words when there was some relatively closed canopy forest nearby. This suggests that, although dependent on forest proximity, some Malagasy dung beetles tolerate more microclimatic variation than previously thought. On the other hand, certain level of forest disturbance may also increase the types of microhabitat available which, in case there are different species with different temperature optima, could explain some of the increase in dung beetle diversity in disturbed vegetation (Mehrabi et al., 2014;Perry, Wallin, Wenzel, & Herms, 2018).
The proportion of Malagasy dung beetles that are generalists in terms of feeding on both dung and carrion of lemurs and other small mammals has been estimated to be as high as 80% (Viljanen, Wirta, et al., 2010b), while about one third of the forest-dwelling species elsewhere in the tropics are considered generalists on using both dung and carrion (Feer & Pincebourde, 2005;Hanski, 1983). Further, many of the Malagasy dung beetle species that are considered specialized on lemur dung may use also carrion although showing strong preference for dung (Viljanen, Wirta, et al., 2010b). One example is Helictopleurus viridiflavus which was previously considered as a dung specialist (Viljanen, Wirta, et al., 2010b) but was attracted to carrion baits in the present study. The higher level of generalism and flexibility in resource use may help Malagasy dung beetles to switch to less preferred food sources in degraded forests, where the number of lemur species is reduced, but other small mammals or vertebrates may persist (Irwin et al., 2010).
In addition to higher level of generalism among Malagasy dung beetles, new introduced resources in degraded forests may facilitate their persistence. One such resource could be the dung of the introduced Rattus rattus which has been reported to increase in anthropogenic landscapes (Lehtonen et al., 2001). It is improbable that rat dung would support very large-bodied dung beetles, but it might be suitable for smaller species, and rat as carrion would be suitable also for larger species. Another introduced resource that may be present in degraded forests is human dung, as most of the study sites in the degraded area were in proximity of human settlements.
Most Malagasy dung beetles are known to be attracted to human dung which is considered to be similar to large lemur dung (Viljanen, Wirta, et al., 2010b). As the last large species of lemurs were driven to extinction approximately 500 years ago (Burney et al., 2004) and the current lemur species have a limited capacity to survive in degraded forests, it is thought that the increase in human population may compensate for the loss of native primates in terms of offering resources for dung beetles (Viljanen, Wirta, et al., 2010b).
High species diversity in recently degraded habitats may also result from a time lag in species response to habitat degradation, that is, extinction debt (Tilman, May, Lehman, & Nowak, 1994). The time lag is especially long for long-lived slowly reproducing species (Hanski, 2005), but it can be long for short-lived species too, if it is due to a close symbiosis with another species that is responding slowly to disturbance (Bommarco, Lindborg, Marini, & Öckinger, 2014;Hanski & Ovaskainen, 2002). As discussed earlier, Malagasy dung beetle species are not known to depend on any certain resource-producing species, but should rather respond to changes in the mammal community as a whole. Unless new resource providing mammals have been settled to the degraded forests as discussed above, the diversity loss of lemurs (Irwin et al., 2010) would have been expected to reduce dung beetle diversity too. Dung beetles are regarded as relatively long-lived and slowly reproducing insects (Viljanen, 2009), but it is probable that they would respond to habitat loss in a matter of years rather than of decades. As deforestation continues in the area (Puhakka, 2012), some of the forest loss near our study sites has probably been recent. However, most of the forest in eastern Madagascar was lost decades ago (Harper et al., 2007).
Thus, we doubt that extinction debt could largely explain the high diversity of dung beetles in our degraded study sites, although it may have an impact at a local level.

| Altitudinal gradient and forest disturbance induce changes in species composition
As expected, we found differences in the species composition between the study areas. Consistent with previous studies (Barragán et al., 2011;Edwards et al., 2014;Gardner et al., 2008;Shahabuddin et al., 2010), the average size of dung beetles was smaller in lowquality vegetation than in the continuous, undisturbed forest. In addition to the larger average size in continuous forest, the average size was larger at lower elevations, which is due to the regional and elevational variation in the species composition (Viljanen, Wirta, et al., 2010b). Certain species dominating in low elevations, like Epilissus prasinus and Nanos bimaculatus, are much larger than the corresponding species on higher elevations. Some species were collected from either primary or degraded forest only. There were more species only collected from the degraded forests than species that were only collected from primary forests. This is partly explained by the elevational turnover in species composition, as the study sites in the degraded area were located on a wider elevational gradient than the sites in primary forest. Many of the species that we only collected from the degraded area are known to occur in Ranomafana National Park, but at lower elevations than our reference location. However, it is interesting that previously unknown species were found so close to the intensively sampled Ranomafana National Park. This suggests that many more new species could be found from the forest refugia at middle and low elevations.

| A potential change in the ecosystem services provided by dung beetles
Due to the ways dung beetles process their resources, they perform several ecological functions such as nutrient cycling, soil perturbation, and seed translocation (Nichols et al., 2008). Lower species diversity due to reduced forest connectivity and the reduction in the average dung beetle body size by forest degradation may change the efficiency and the form of the ecosystem services the dung beetles provide (Andresen, 2003;Barragán et al., 2011;Slade et al., 2011). Loss in species richness and abundance has been observed to reduce the functional efficiency of dung beetles for example in terms of dung burial rates (Larsen et al., 2005;Slade, Mann, Villanueva, & Lewis, 2007). Large body size is often associated with faster burial rates (Larsen et al., 2005;Slade et al., 2007), whereas smaller body size has been observed as beneficial in burial of seeds in suitable depth for germination (Andresen & Levey, 2004). However, due to the complexity and context dependency in assessing dung beetle functional efficiency (Andresen & Levey, 2004), empirical tests on the functions as well as extending the sampling to the strict dung specialists are necessary before making further conclusions.

| Future directions for dung beetle research in Madagascar
The intensive research on Malagasy dung beetles during the past two of decades (Miraldo et al., 2011) has given us a good basic understanding of their ecology and phylogeny, but many unanswered questions related to their community and functional ecology still remain. While we know what these dung beetles are attracted to (Viljanen, Escobar, et al., 2010a), we still do not know what precisely they feed on. One way to explore this would be by identifying the food remains in the guts of different dung beetle species by molecular methods. This would inform us about the taxa these species use either as carrion or dung (Gillett, Johnson, Barr, & Hulcr, 2016;Gómez & Kolokotronis, 2017). In addition to unveiling the direct trophic interactions, identifying gut contents would enable describing how wide generalists or narrow specialists different species are, which remains largely unknown for dung beetles worldwide (Raine & Slade, 2019). Identification of species used by dung beetles would also allow using dung beetles as bioindicators to infer what other species occur in their environment (Carignan & Villard, 2002;Raine & Slade, 2019). Identifying the food resources in different environments, from primary forests to heavily degraded ones, would not only show how well different species are able to adapt to different resources but also what is available in the different forests.
It would also be highly important to study the functionality of Malagasy dung beetles in nutrient cycling, soil perturbation, and seed translocation (Slade et al., 2011(Slade et al., , 2007. With such knowledge for different dung beetle species, one could infer changes that will happen when the dung beetle fauna changes. Our current study shows that the dung beetle species composition changes with forest degradation, but future research is needed to establish how the complete communities will be affected. The high level of endemism of Malagasy dung beetles and the diversity within the endemic lineages (Miraldo et al., 2011) also makes them ideal for studying factors affecting speciation. The evolutionary history of these groups has been established on a large scale, but the precise factors causing speciation need to be further studied (Miraldo & Duplouy, 2019;Wirta et al., 2008Wirta et al., , 2010. These factors include feeding patterns which play a strong role in dung beetle evolution (Davis, Scholtz, & Sole, 2016;Raine & Slade, 2019).
Many research activities on Madagascar are challenging due to the poor infrastructure especially concerning roads and bad security situation in parts of the country. As native forests are diminishing, forests are often only left at higher altitudes and in the regions that are hardest to reach. As Malagasy dung beetles are mainly forest inhabitants, these impediments heavily hinder Malagasy dung beetle research. For these reasons, establishing stronger research infrastructure and collaboration among researches as well as long-term dung beetle monitoring in places with reasonable reachability or good existing infrastructure (such as Ranomafana National Park) are significant to allow efficient research in the future.

| CON CLUS IONS
Sufficient connectivity to surrounding forests seems to allow degraded forests to harbor a diverse community of dung beetles.
Although the continuous forests of Madagascar continue to decline at an alarming rate, our results suggest that, when connected to larger forest areas, degraded forests may help in the preservation of many Malagasy dung beetle species. However, the reduction in the average dung beetle body size in the degraded forests may change the dung beetle-driven nutrient cycling and seed dispersal and thus impact the regeneration of vegetation.

ACK N OWLED G M ENTS
We warmly thank Daniela Adrianiaina, Holiarimino Vololonoro, and Nérée Beson for their help in the fieldwork. We also thank all the  TA B L E 5 Results of the permutational multivariate analysis of variance (PERMANOVA) on the impact of sampling zone ( Figure S1, Table S1), altitude, connectivity, and vegetation quality (Table  1)

DATA AVA I L A B I L I T Y S TAT E M E N T
The data that support the findings of this study are openly available in Dryad Digital Repository at http://doi.org/10.5061/dryad.v9s4m w6r9 (Torppa, Wirta, & Hanski, 2020).