Re: [R] Factor variables with GAM models

2010-04-14 Thread Gavin Simpson
On Fri, 2010-03-19 at 20:37 -0700, Steven McKinney wrote: > Hi Noah > > GAM models were developed to assess the functional form > of the relationship of continuous predictor variables to the > response, so weren't really meant to handle factor variables > as predictor variables. GAMs are of the f

Re: [R] Factor variables with GAM models

2010-03-22 Thread Simon Wood
It doesn't usually make much sense to *smooth* over a factor variable (in the cases where it does you should treat the factor as a random effect), but there is no problem in including factor variables in a GAM. `gam' lets you mix factor and continuous variables in a bunch of ways. Suppose that `

Re: [R] Factor variables with GAM models

2010-03-20 Thread Corrado
You can some time manually substitute a categorical variable with a set of continuous variables. For example, you have the variables like "landcover.class" with 3 values "class A, class B, class C". You cna transform it into 3 continuous variables landcover.class.A, landcover.class.B, landcove

Re: [R] Factor variables with GAM models

2010-03-19 Thread Noah Silverman
Steve, I get that. What you wrote make sense. My challenge is the data I'm attempting to model. Some of the variables are continuous, some are factors. both linear and poisson models work. (Poisson doing a much more accurate job.) However, some of the numerical variables are clearly non-l

Re: [R] Factor variables with GAM models

2010-03-19 Thread Steven McKinney
Hi Noah GAM models were developed to assess the functional form of the relationship of continuous predictor variables to the response, so weren't really meant to handle factor variables as predictor variables. GAMs are of the form E(Y | X1, X2, ...) = So + S(X1) + S(X2) + ... where S(X) is a smoo