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...

  • $\begingroup$ 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. $\endgroup$
    – Glen_b
    Commented Aug 9, 2017 at 2:22

1 Answer 1


So you could try a naturally bounded regression model e.g. Beta regression, which is in the betareg package in R or is betareg in STATA (explained nicely here: http://www.stata.com/manuals/rbetareg.pdf).

This assumes that bounds on data are the same for each observed unit e.g. due to data collection or a capped variable.

This will have the advantage that you can transform the coefficients back to a standard difference in means, and as it is a GLM it will be easier to understand and implement than other approaches.

Whether any of your listed approaches is better than OLS though mainly depends on whether within the specified range the effect is linear. If so, while you could not extrapolate and you'd have to ignore the intercept, the parameter estimates and CIs might be approximately fine.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.