[R] defining non linear predictors from nls in gam?
Francisco Mora Ardila
fmora at oikos.unam.mx
Fri Mar 30 20:45:35 CEST 2012
Hi all
I´m trying to analize the role of time since abandonement (continuous variable) and
biophysical environmental conditions on the recovery of the vegetation trough
succession.
First, I used non-linear least squares with nls function to model the effect of time on
vegetation attributes. I tried several self-starting sigmoidal functions as data seems
to conform to this type of models, and then chose the best model based on the minimum
RSE and AIC. An example of the formula used is:
model1<-nls(vegetattrib~SSlogis(time, a, b, c))
Then, I wanted to add to the model the effect of some biophysical attribute (ie, soil
type). But three problems arise: 1) I can´t include factors in the nls, 2) even if it
were a continuous predictor, nls model try to fit it as a nonlinear predictor and I don
´t have an apriori reason to think that kind of relation exist, 3) nls doesn’t give r2´s
(the statistical reason for this is described by Douglas Bates and can be found in
https://stat.ethz.ch/pipermail/r-help/2000-August/007778.html). But the point is that
for me is interesting to have an idea about how well the model describe the patter in
data, as the r2 does. Is correct to calculate the % of deviance instead? Or something
else?
So I decided to use a gam approach, were I can create an additive model with time and
soil type. But gam creates a smoothing function for the relationship between time and
vegetattr. The question is: Can I establish in gam the form of the relationship between
time and vegetattr as, for example, a logistic relationship with the parameters
estimated with the self starting nls function?
I´ve revised the book from S.Wood about GAM´s in R, but haven´t find something like
that.
Any suggestions about how to model (and test) the effect of time as a nonlinear
predictor plus other variables (preferably as linear predictors)?
Thanks in advance
Francisco
--
oikos.unam.mx
More information about the R-help
mailing list