I have computed several models, using both glm()
and rxGlm()
(the second one is from Microsoft R
). Unfortunately, rxGlm()
does not store all information required by stargazer
. So when trying to create the summary table (even after adjusting the RxGlm
data via as.glm()
), I get the following error message:
Error in qr.lm(object) : lm object does not have a proper 'qr' component.
Rank zero or should not have used lm(.., qr=FALSE).
I am already reading out separetly the t-statistics and p-values and feed them back to stargazer
separately. However, stargazer still requires the model output objects to be stored in the workspace and otherwise sends an error message.
This is how I extract the statistics from the model output:
obj1.t <- summary(obj1)$coef[ , "z value"]
obj1.p <- summary(obj1)$coef[ , "Pr(>|z|)"]
This is a simplified form of my stargazer
command, where se =
and p =
are used to feed back the previously extracted statistics.
stargazer(list(obj1, obj2),
type = "html", table.layout = "cd=!t-s-!a=!n", star.cutoffs=c(0.05,0.01,0.001), no.space = TRUE,
omit = c(1989:2015), font.size = "normalsize",
out = "Test.html",
df= FALSE,
column.labels = c("(1)", "(2)"),
add.lines = list(c("fixed effects", "No", "Yes")),
dep.var.labels = c("Dummy"),
title = "GLM PROBIT MODEL",
se= list(obj1.t, obj2.t),
p = list(obj1.p, obj2.p),
notes = "t statistics shown in parentheses")
Now my question: is there a way to create regression output tables with stargazer without having to provide the model output objects? So basically store all the required data in separate vectors and then feed them back to stargazer? RxGlm
summaries provide all the information that is necessary to fill the regression results table manually. However, I am looking for a way to do it automatically.