[R] predict on biglm class

Benilton Carvalho bcarvalh at jhsph.edu
Mon Feb 12 17:20:49 CET 2007


Hi Everyone,

I often use the 'safe prediction' feature available through glm().  
Now, I'm at a situation where I must use biglm:::bigglm.

## begin example

library(splines)
library(biglm)
ff <- log(Volume)~ns(log(Girth), df=5)
fit.glm <- glm(ff, data=trees)
fit.biglm <- bigglm(ff, data=trees)
predict(fit.glm, newdata=data.frame(Girth=2:5))

## -1.3161465 -0.2975659  0.4251285  0.9856938

predict(fit.biglm, newdata=data.frame(Girth=2:5))

## Error in predict(fit.biglm, newdata = data.frame(Girth = 2:5)) :
##        no applicable method for "predict"

## end example

So, it is my understanding that there is no 'predict' method for  
'bigglm' class. That suggests me that I need to create my own  
prediction method, right? What would be an efficient way of making  
these predictions that use ns() on a very large dataset?

My initial thought is that saving the Boundary.knots and knots, I  
could create the linear predictor by chunks (and therefore get the  
predictions). Is there a better way of doing this?

Thank you very much.

Benilton Carvalho
Department of Biostatistics
Bloomberg School of Public Health
Johns Hopkins University



More information about the R-help mailing list