Skip to content
Prev 247666 / 398503 Next

Circular variables within a GLM, GLM-GEE or GAM

Is the variable to be used as a predictor? If so mgcv::gam has a couple of 
circular smoother built in... 

s(x,bs="cc") or s(x,bs="cp") 

(if the range of x is less than the full  [0, 360] then you can supply a 
`knots' argument to gam to force the x range to go from 0 to 360, otherwise  
s(min(x), bs="c*") will be identical to s(max(x),bs="c*"), which may not be 
matching in the right place).

Simon
On Tuesday 18 January 2011 12:07, Clare Embling wrote: