I have a dataset of various ecological variables on which I want to run linear regression. The variables are continuous, but also include aspect data (sun exposure), in grades. My problem is that the aspect values ranges from 0 to 400, with 0=400=north. How can I include "cyclic" values in the regression? Should I keep them as they are, or cos/sin-transform them?

Does anyone of you have experience with these problem? I have had difficulties to find any reference papers...

All ideas and references are welcome and appreciated! I hope I was not too unclear, if you need any further information, I'd be happy to provide, as far as I can.

  • 4
    $\begingroup$ This is the subject matter of circular statistics. How to include these values depends on whether the aspect is explanatory or a response variable; presumably it is explanatory. In this case consider re-expressing aspect into a value more directly related to sun exposure, for which you say it is a proxy. For instance, the pair (slope, aspect) can be converted into a rough numerical assessment of mean total daily insolation per unit area. $\endgroup$
    – whuber
    Jul 17, 2014 at 14:41

2 Answers 2


How you treat it - including whether you transform it in some way - depends on how you expect the aspect to relate to your response.

What is the response and how do you think aspect will tend to affect it?

You may find some value in the discussion here; it's not exactly the same kind of problem, but aspects of it have some potential relevance.

In particular, if there's a reason to have $\cos$, there may be a point in not just having $\cos$ of the aspect but also $\sin$, and also other harmonics (essentially, a set of orthogonal periodic components).

  • $\begingroup$ I am trying to predict wood production in a stand, with variables such as altitude, aspect, slope, over- and under-story density, composition and cover, trees diameters... Stands where monitored over a 10-years period, in a mountainous area. I have a range of conditions over the stands, and I suppose that the moist and fresh stands, i.e. the north-facing ones, are the most productive (I am working mostly on fir trees in the Alps), but that's just a guess that I have to verify. $\endgroup$
    – madeleine
    Jul 17, 2014 at 12:11
  • $\begingroup$ Okay, yeah, I'd think cos, maybe with sin and maybe a second harmonic for each. $\endgroup$
    – Glen_b
    Jul 17, 2014 at 12:23
  • $\begingroup$ I just ended reading the great answer you made for the temperatures on the Baltic Sea, makes things clearer. So if I get it, I will have two variables, one for the northness that will be cos(2*piaspect)+sin(4*piaspect) and one for the eastness that will be sin(2*piaspect)+cos(4*piaspect), in the case I use a second harmonic for each? I do not really understand the second harmonic part. $\endgroup$
    – madeleine
    Jul 17, 2014 at 12:35
  • 1
    $\begingroup$ Uh, no. You have that all muddled. For a start, I think your measurements are in gradians. North would be weighting on $\cos(x\pi/200)$, east would be weighting on $\sin(x\pi/200)$; northeast would weight them both equally. The second harmonics would be $\cos(x\pi/100)$ and $\sin(x\pi/100)$ and would represent a change in the shape of the response from a pure sin-curve shape. $\endgroup$
    – Glen_b
    Jul 17, 2014 at 12:45
  • 1
    $\begingroup$ (To clarify, the sign of the coefficients (weights) depends on whether you measured your angles clockwise or anticlockwise from north.) $\endgroup$
    – Glen_b
    Jul 17, 2014 at 22:57

you can write expression in raster calculator: (Aspect<25) * (Aspect+400)+(Aspect>=25) * (Aspect*1) it will add 400 grade to all value less than 25 grade but not effect on value equal and greater 25 grade. result will be North class in the end of legend but start point would be northeast.you will never get zero value i your map your north class range would be 375g to 425 g in the end of legend

legend would looks like this:

Norheast: 25g to 75g

East: 75g to 125g

southeast: 125g to 175g

south: 175g to 225g

southwest: 225g to 275g

west: 275g to 325g

Northwest: 325g to 375g

North: 375g to 425g

  • $\begingroup$ This is very hard to understand. Please edit it to clarify your meaning. $\endgroup$
    – mkt
    Aug 3, 2017 at 20:23

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.