When I use the following R code,
model_glm=glm(V1~. , data=xx,family="binomial");
save(file="modelfile",model_glm);
The size of modelfile will be as much as the data, which will be 1gig in my case. How can I remove the data part in the result of model_glm, so I can only save a small file.
Setting
model = FALSEin your call toglmshould prevent themodel.framefrom being returned. Also settingy = FALSEwill prevent the response vector from being returned.x = FALSEis the default setting and prevents themodel.matrixfrom being returned.This combination should shrink the size of your glm object.
Of course, you can also extract the coefficients with
coef(model_glm)or, with standard errors,