Dear all, I'm writing a package where the main function fn(), say, returns a glm-like object, with three additional components.> obj<-glm(....) > out<-fn(obj,....)out is substantially an updated version of obj, with the same response and some (two or three) additional variables in the linear predictor. My problem is that out is much bigger than obj, and the three additional components don't seem responsible, as they are quite small.> class(obj)[1] "glm" "lm"> class(out)[1] "myclass" "glm" "lm"> object.size(obj)[1] 1685228> object.size(out)[1] 2701292 Why is out so larger than obj? the additional components are rather small and the remaining ones seem approximatevely the same. Many thanks, vito #the size of the additional components:> object.size(out$psi)[1] 348> object.size(out$it)[1] 36> object.size(out$epsilon)[1] 36 #the size of some remaining component:> all.equal(out$y,obj$y)[1] TRUE> object.size(obj$R)[1] 9284> object.size(out$R)[1] 10356> object.size(obj$coef)[1] 1024> object.size(out$coef)[1] 1064> object.size(obj$call)[1] 1456> object.size(out$call)[1] 764 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> some (two or three) additional variables in the linear predictor.That changes the sizes of the components of the glm fit, and some vary with the square of the number of columns in the model matrix. You are not comparing like with like. On Tue, 26 Nov 2002, vito muggeo wrote:> I'm writing a package where the main function fn(), say, returns a glm-like > object, with three additional components. > > obj<-glm(....) > > out<-fn(obj,....) > out is substantially an updated version of obj, with the same response and > some (two or three) additional variables in the linear predictor. > My problem is that out is much bigger than obj, and the three additional > components don't seem responsible, as they are quite small.Why is this a problem? [...] -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._