Hello,
I calculated a GAM with Poisson distribution for tree frogs (mgcv and
MASS).The original matrix on which the GAM is based contains 13 predictor
variables (rows) and 49 sampling units (lines) and is called 'Hyla_Model'.
Four of these predictor variables were significant and two out of these 4
entered the model as smoothed terms s(x) .The original matrix on which the
GAM is based contains 13 predictor variables (rows) and 49 sampling units
(lines) and is called 'Hyla_Model'. Four of these predictor variables were
significant and two out of these 4 entered the model as smoothed terms
s(x):
model8<- gam(Hyla_Model$AES_Peak_modified ~ s(Hyla_Model$var1 +
s(Hyla_Model$var2)+ Hyla_Model$var3 + Hyla_Model$var4, data=Hyla_Model,
family = poisson)
Now I want to make a prediction for unsettled habitats. Therefore I got a
second matrix (looks exactly the same as said above with all 13 predictor
variables, BUT only containing 19 sampling units(lines)).
Unfortunatly I keep getting errors.....
here my commands:
east_Wittenberge<-read.table("C:\\Dokumente und
Einstellungen\\Oestlich_Wittenberge_Matrix_komplett.txt",sep="",header=
TRUE)
predict.gam(model8, newdata=east_Wittenberge,type="link",se=T)
here the error message:
Error in model.frame.default(ff, data = newdata, na.action = na.act) :
invalid type (list) for variable 'Hyla_Model'
In addition: Warning message:
In predict.gam(model8, newdata = east_Wittenberge, type = "link", :
not all required variables have been supplied in newdata!
It seems like R uses the original martix 'Hyla_Model? somehow....???
The GAM contains 4 significant predictor variables, two are smoothed
terms.
In the new matrix east_Wittenberge none of these 4 predictors is
"smoothed"
--> could this be a problem?
Can anybody help me?
Best wishes,
Felisa
[[alternative HTML version deleted]]