Re: [R] Circular variables within a GLM, GLM-GEE or GAM

2011-01-31 Thread Simon Wood
ctions as you > suggested. > > Best wishes & thanks, > Clare > > > From: Simon Wood [s.w...@bath.ac.uk] > Sent: 18 January 2011 17:58 > To: r-help@r-project.org > Cc: Clare Embling > Subject: Re: [R] Circular variables within a GLM, GLM-GEE or GAM > > Is the vari

Re: [R] Circular variables within a GLM, GLM-GEE or GAM

2011-01-21 Thread Clare Embling
thing functions as you suggested. Best wishes & thanks, Clare From: Simon Wood [s.w...@bath.ac.uk] Sent: 18 January 2011 17:58 To: r-help@r-project.org Cc: Clare Embling Subject: Re: [R] Circular variables within a GLM, GLM-GEE or GAM Is the varia

Re: [R] Circular variables within a GLM, GLM-GEE or GAM

2011-01-18 Thread Simon Wood
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)

[R] Circular variables within a GLM, GLM-GEE or GAM

2011-01-18 Thread Clare Embling
Hi, I have a variable (current speed direction) which is circular (0=360 degrees), and I'd like my GLM to include the variable as a circular variable. Can I do this? And what is the code? I'm actually doing a GLM-GEE using the 'geepack' package, so want to use it in that, but also interested