Hi Simon, I'm trying to fit a negative binomial gam with no covariates, that therefore looks at the detection/non-detection data and nothing else. I thought having 1~1 as formula would allow the model to just estimate occurrence without looking at relationship between variables.
On 25 Aug 2012, at 15:18, Simon Wood-4 [via R] wrote: > 'gam' doesn't know what to do with the model formula '1 ~ 1' (i.e. "one > tilde one"). What is it supposed to mean? 'glm' also does nothing > meaningful in this case... > > ## code to load you data file into 'dat' omitted > > model<-glm(1~1, data=dat) > > model > > Call: glm(formula = 1 ~ 1, data = dat) > > Coefficients: > (Intercept) > 1 > > Degrees of Freedom: 0 Total (i.e. Null); 0 Residual > Null Deviance: 0 > Residual Deviance: 0 AIC: -Inf > > What model are you trying to fit? > > best, > Simon > > > On 08/24/2012 10:36 PM, grace wrote: > > > Hi there, > > > > I'm using presence-absence data in a gam (i.e. 0 or 1 as values) > > I am trying to run a gam with 'dummy covariates' i.e. 1~1 > > unfortunately my model: > > * > > model<-gam(1~1, data=bats, family=negbin)* > > > > keeps putting out: > > > > * > > Error in gam(1 ~ 1, data = bats, family = negbin) : > > Not enough (non-NA) data to do anything meaningful* > > > > Is there a specific reason it would do this? I have tried using various > > actions on NAs, na.pass etc, as well as asking it to turn all NAs to 0 but > > to no avail. > > > > I would post the data here but its rather long, basically 28x104 matrix of > > 0/1 with headers 'v1:v28' .The summary for the data comes up fine, it's > > just > > the model that isn't working. > > However if I run using: > > > > *model<-gam(v1~v2, data=bats, family=negbin) > > * > > > > it tends to work. > > > > Any help is seriously appreciated as I have a deadline and have been trying > > this for days, > > > > Thanks! > > > > > > > > -- > > View this message in context: > > http://r.789695.n4.nabble.com/mgcv-package-problems-with-NAs-in-gam-tp4641253.html > > Sent from the R help mailing list archive at Nabble.com. > > > > ______________________________________________ > > [hidden email] mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > If you reply to this email, your message will be added to the discussion > below: > http://r.789695.n4.nabble.com/mgcv-package-problems-with-NAs-in-gam-tp4641253p4641298.html > To unsubscribe from mgcv package, problems with NAs in gam, click here. > NAML -- View this message in context: http://r.789695.n4.nabble.com/mgcv-package-problems-with-NAs-in-gam-tp4641253p4641299.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.