[R-sig-eco] angular statistics

Donald McKenzie dmck at u.washington.edu
Tue Oct 15 23:53:21 CEST 2013


Make sure you use consistent units. PI/2 in radians, 90 in degrees. cos(90-90) = 1, cos(270 - 90) = -1. So west (270) has the lowest value, east the highest.

On Tue, 15 Oct 2013, Peter Nelson wrote:

> Thanks Don. I tried the transformation you suggested, but the results don't
> appear promising (0 deg doesn't = 360 deg, intervals vary):
> 0
> 6.12574E-17
> 10
> -0.544021111
> 20
> 0.912945251
> 30
> -0.988031624
> 40
> 0.74511316
> 50
> -0.262374854
> 60
> -0.304810621
> 70
> 0.773890682
> 80
> -0.993888654
> 90
> 0.893996664
> 
> I tried 
> 
> east.exposure=cos(exposure*PI/180) 
> 
> This seems better (e.g., 0 degrees = 360 degrees) see below), but the
> absolute values of the intervals aren't consistent. No surprise, I suppose,
> but what to do?  
> 
> Thanks, Peter
> 
> 0
> 1
> 10
> 0.984807753
> 20
> 0.939692621
> 30
> 0.866025404
> 40
> 0.766044443
> 50
> 0.64278761
> 60
> 0.5
> 70
> 0.342020143
> 80
> 0.173648178
> 90
> 6.12574E-17
> 100
> -0.173648178
> 110
> -0.342020143
> 120
> -0.5
> 130
> -0.64278761
> 140
> -0.766044443
> 150
> -0.866025404
> 160
> -0.939692621
> 170
> -0.984807753
> 180
> -1
> 190
> -0.984807753
> 200
> -0.939692621
> 210
> -0.866025404
> 220
> -0.766044443
> 230
> -0.64278761
> 240
> -0.5
> 250
> -0.342020143
> 260
> -0.173648178
> 270
> -1.83772E-16
> 280
> 0.173648178
> 290
> 0.342020143
> 300
> 0.5
> 310
> 0.64278761
> 320
> 0.766044443
> 330
> 0.866025404
> 340
> 0.939692621
> 350
> 0.984807753
> 360
> 1 On Oct 15, 2013, at 11:45 AM, Don McKenzie <dmck at u.washington.edu> wrote:
> 
>       There is precedent in the ecological literature for using a
>       cosine transformation IF you have reason to believe that your
>       predictor varies continuously and symmetrically in its effects
>       around a circle.  For example, if due east were the "most"
>       exposure, and due west the least, with due north and south
>       being roughly equal, you could create a new predictor
>       called "east.exposure" with (most basically)
> east.exposure = cos(exposure - PI/2)
> 
> Many more complicated extensions of this idea are possible,
> associated with nonlinear or asymmetrical gradients, but I will leave
> that to you or others on the list.
> 
> On Oct 15, 2013, at 9:59 AM, Peter Nelson wrote:
> 
>       I want to include the exposure (measured in degrees, for
>       example, East-facing is 90) of various coastal sites in
>       GLM and CCA analyses. Is there an appropriate
>       transformation that I can apply to these measurements
>       that will allow me to do this? I've found plenty of
>       information on comparing headings, calculating means,
>       etc, but nothing on how exposure might be used as a
>       continuous independent variable.
> 
>       Treating exposure as a categorical variable (East,
>       Southwest, etc) seems like a fallback option, but then
>       there is just as much of a 'difference' between SE and E
>       sites as there is between SE and NW sites!
> 
>       Thanks, Pete
>       _______________________________________________
>       R-sig-ecology mailing list
>       R-sig-ecology at r-project.org
>       https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> 
> 
> 
> 
> 
> Don McKenzie
> 
> Affiliate Professor
> School of Environmental and Forest Sciences
> University of Washington
> 
> dmck at uw.edu
> 
> 
> 
> 
> 
> 
>


More information about the R-sig-ecology mailing list