[R] GAM question
Simon Wood
simon at stats.gla.ac.uk
Fri Jun 4 10:47:45 CEST 2004
> Warning in eval(expr, envir, enclos) : non-integer #successes in a
> binomial glm!
- one way of specifying a logistic regression model is to supply the
observed proportion of sucesses as the response variable (e.g. y) and the
binomial n as the weights. The warning is complaining that y/n is
non-integer. Depending on exactly why you are weighting, you might want to
use the quasibinomial family in place of binomial,
> Error: cannot allocate vector of size 60865 Kb
The gam fit may get a bit memory intensive given the number of data you
have. ?gam gives various approaches for dealing with large datasets, but
you might want to change the smoothing basis to one that is
computationally cheaper than the default.
eg. replace s(x) terms by s(x,bs="cr").
Simon
On Thu, 3 Jun 2004, HILLARY ROBISON wrote:
> I am trying to use R to do a weighted GAM with PA (presence/random) as the
> response variable (Y, which is a 0 or a 1) and ASPECT (values go from
> 0-3340), DEM (from 1500-3300), HLI (from 0-5566), PLAN (from -3 to 3),
> PROF (from -3 to 3), SLOPE (from 100-500) and TRI (from 0-51) as
> predictor variables (Xs). I need to weight each observation by its WO
> value (from 0.18 to 0.98). I have specified the following models in R
> (see below), but I can't figure out what the R reported errors plainly
> mean. One of the errors seems to tell me my dataset is too big (it's
> 109,729 rows by 16 columns) - is this possible? Given what I am trying to
> accomplish (a weighted, logistic GAM with 7 variables), am I specifying my
> model correctly? I would like to attach my dataset (it's 2,064 KB
> as a WinZip file), but I don't know if it'll go through to the list given
> the HTML & attachment contraints of the list... I even tried a weighted,
> logistic GLM with the seven variables to see if that would work and if so,
> perhaps it was a GAM problem. I also tried a logistic, weighted GAM with
> one variable to see if that would work. My next step while I wait to
> hear back from the list is to try a dummy dataset that is small to see if
> a weighted, logistic GAM with seven variables will work at all or if I am
> speciying the model correctly. Would anyone be willing to have my dataset
> sent so they can check it out if that would help solve the issue? Thank you!
> Hillary (hrobison at unr.nevada.edu)
>
> > # trial, all, weighted
> > topo8 <- gam(PA ~ s(SLOPE10) + s(ASPECT10) + s(GYADEMPLUS) + s(TRI) +
> s(HLI) + s(PLAN10) + s(PROF10), family=binomial, data=topox, weights = w0)
> Warning in eval(expr, envir, enclos) : non-integer #successes in a
> binomial glm!
> Error: cannot allocate vector of size 60865 Kb
>
> > topo9 <- glm(PA ~ SLOPE10 + ASPECT10 + GYADEMPLUS + TRI + HLI + PLAN10 +
> PROF10, family=binomial, data=topox, weights = w0)
> Warning in eval(expr, envir, enclos) : non-integer #successes in a
> binomial glm!
>
> > # trial, weighted, slope only
> > topo10 <- gam(PA ~ s(SLOPE10), family=binomial, data=topox, weights =
> w0)
> Warning in eval(expr, envir, enclos) : non-integer #successes in a
> binomial glm!
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
More information about the R-help
mailing list