# Modeling potentially unimodal data

My data: I surveyed for animal densities across an elevation gradient. Let's say I surveyed from 0 to 1000 meters elevation.

My models (one for each species of interest): density ~ elevation + other covariates

My question: If I only find a species between 500 and 1000 meters, it doesn't make a lot of sense to treat the relationship between elevation (from 0 to 1000 m) and density as linear. I see a couple possible work-arounds, and I'm wondering if there's any sort of best-practice or words of advice for this.

Options that come to mind:

1. Truncate data: Exclude all sampling locations beyond the most extreme elevations observed for a given species.
2. Redefine elevation: Calculate elevation as the difference in elevation between each observation and the most extreme elevation observed for the species (if only one elevational limit appears in the data) or to the closest elevational limit if the species appears to have lower and upper elevational boundaries. All sampling locations with elevations beyond the most extreme elevations observed would be given elevations of 0. One issue I see with this is that the definition of elevation would change depending on the number (1 or 2) and type (upper, lower) of elevational boundaries observed in the data.
3. Create an additional, binary covariate for each species to say whether or not each sampling location is within or outside of the elevational limits of the given species, and then include an interaction term between the new covariate and elevation. The model would thus be:
density ~ elevation * within boundaries + other covariates
4. Include a quadratic term for elevation. This would account for a unimodal relationship, but still doesn't handle cutoffs. The model would be:
density ~ elevation + elevation^2 + other covariates
5. Use something other than a linear model (e.g. generalized additive model, LOWESS, etc.).

What are the benefits and complications of using these different methods? Are there other options that might be better (if so, under what circumstances)? Advice welcome...

• I see no reason to treat it as linear in any case. Nor would I necessarily treat it as quadratic (though if there was very little data it might do in a pinch). ON those considerations, I'd be looking at (possibly generalized) additive models. The response (density) sounds like it would be a ratio -- a count divided by an area, in which case I'd be inclined to look at a Poisson regression with log-area as an offset, with elevation as an smooth additive effect. Commented Aug 9, 2017 at 2:22