Hi, I have a GAM quasipoisson that I'd like to run through MuMIn package - dredge - gettop.models - model.avg However, I'm having no luck with script from an example in MuMIn help file. In MuMIn help they advise "include only models with smooth OR linear term (but not both) for each variable". Their example is: # Example with gam models (based on "example(gam)") require(mgcv) dat <- gamSim(1, n = 500, dist="poisson", scale=0.1) gam1 <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3) + (x1+x2+x3)^2, family poisson, data = dat, method = "REML") cat(dQuote(getAllTerms(gam1)), "\n") # include only models with smooth OR linear term (but not both) for each variable: dd <- dredge(gam1, subset=(!`s(x1)` | !x1) & (!`s(x2)` | !x2) & (!`s(x3)` | !x3)) But I'm not sure at all how to apply these instructions to my data My formula is GAM<-gam(Species richness (count) ~ Categorical + Continous + Continous + * s*(Continous ) + Continous : Continous + Continous : Continous, family=quasipoisson, data =) Thanks for any advice on script Karen [[alternative HTML version deleted]]
On Fri, 2011-02-04 at 12:31 +0000, Karen Moore wrote:> Hi, ><snip />> My formula is > > GAM<-gam(Species richness (count) ~ Categorical + Continous + Continous + * > s*(Continous ) + Continous : Continous + Continous : Continous, > family=quasipoisson, data =)Ok, I'm reasonably certain that that is *not* your gam() call. Why not post the *actual* code you would enter for your GAM model? dd <- dredge(GAM) should evaluate all possible models from the global model you specified. The example you quote is for a global model with both smooth and linear terms for the same variables, hence in dredge() they need to select models that include only the smooth for a particular variable or the linear term for that variable, but not both. By the looks of it, you don't have this problem. G> > Thanks for any advice on script > > > Karen > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] ucl.ac.uk/~ucfagls UK. WC1E 6BT. [w] freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Reasonably Related Threads
- GAM quasipoisson in MuMIn - SOLVED
- difficulties with MuMIn model generation with coxph
- Error running MuMIn dredge function using glmer models
- Package MuMIn (dredge): Error in ret[, ] <- cbind(x, se, rep(if (is.null(df)) NA_real_ else df, : number of items to replace is not a multiple of replacement length.
- Error message in dredge function (MuMIn package) used with binary GLM