I'm trying to run the following regression:
m1=glm(y~x1+x2+x3+x4,data=df,family=binomial())
m2=glm(y~x1+x2+x3+x4+x5,data=df,family=binomial())
m3=glm(y~x1+x2+x3+x4+x5+x6,data=df,family=binomial())
m4=glm(y~x1+x2+x3+x4+x5+x6+x7,data=df,family=binomial())
and then to print them using the stargazer package:
stargazer(m1,m2,m3,m4 type="html", out="models.html")
Thing is, the data frame df is rather big (~600MB) and thus each glm object I create is at least ~1.5GB. This creates a memory issue which prevents me from creating all the regressions I need to print in stargazer.
I've tried 2 approches in order to decrease the size of the glm objects:
- Trim the glm object using this tutorial. This indeed trims the glm object to <1MB, though I get the following error from the stargazer function:
Error in Qr$qr[p1, p1, drop = FALSE] : incorrect number of dimensions
- Use the package speedglm. however, it's not supported by stargazer.
Any suggestions?