How to save glm result without data or only with coeffients for prediction?

后端 未结 4 417
后悔当初
后悔当初 2021-02-05 23:12

When I use the following R code,

model_glm=glm(V1~. , data=xx,family=\"binomial\");
save(file=\"modelfile\",model_glm);

The size of modelfile w

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-05 23:41

    You can NULL the data in the model object before saving it. I did a quick test and still generated predictions.

    model_glm$data <- NULL
    

提交回复
热议问题