[R-sig-Geo] predict function of regressors in the raster package

2013-04-04 Thread Bouwmeester, Hein
Hi, I would like to make a raster, based on the regression coefficients with 5 other rasters (Predictors). In theory this should be easy using the predict function of the raster package (http://cran.r-project.org/web/packages/raster/raster.pdf). But I fail to get it to work. First I fit a

Re: [R-sig-Geo] predict function of regressors in the raster package

2013-04-04 Thread Jesse Berman
Hi Hein, I'm not sure if this will help, but one thing to check is that your prediction grid has covariate data for each of the 40,000 cells. If a large number of cells have 'NA' as data values, then sometimes the prediction will not work. Offhandedly, it strikes me that ycoord may be limited

Re: [R-sig-Geo] predict function of regressors in the raster package

2013-04-04 Thread Robert J. Hijmans
Hein, I think this problem goes away if you use a clean formula, like this: model - glm(t0~ycoord+prec+tempmean+tempmax+tempmin, family=binomial(link=logit), data=c3p) Robert On Thu, Apr 4, 2013 at 7:42 AM, Jesse Berman berman.je...@gmail.com wrote: Hi Hein, I'm not sure if this will