Stargazer package to create regression tables

Hi there,

I am facing a problem with the stargazer package. I am using this package very recently. I am trying to create regression tables using this package. The regression codes are working just fine. But when it comes to stargazer, I keep getting the error message that object type is unrecognised. Can anyone please help. The code is mentioned below:

install.packages("stargazer")
library(stargazer)
form1 <- edu2_resp ~ dist.7 + fatalities.7
summary(glm(form1, data = nigeria6_results[nigeria6_results$edu2_resp != 99 , ], family = binomial(link = "logit")))
form2 <- edu2_resp ~ dist.5 + fatalities.5
summary(glm(form2, data = nigeria6_results[nigeria6_results$edu2_resp != 99 , ], family = binomial(link = "logit")))
form3 <- edu2_resp ~ dist.3 + fatalities.3
summary(glm(form3, data = nigeria6_results[nigeria6_results$edu2_resp != 99 , ], family = binomial(link = "logit")))
form4 <- edu2_resp ~ dist.10 + fatalities.10
summary(glm(form4, data = nigeria6_results[nigeria6_results$edu2_resp != 99 , ], family = binomial(link="logit")))
stargazer(form1, form2, form3, form4, title="Model 1A Conflict only", align=TRUE, no.space=TRUE)

I do not think stargazer can do anything with just a formula. I believe you need to give it the glm results. My experience with stargazer is very limited as it does not support tslm models.

library(stargazer)
form1 <- edu2_resp ~ dist.7 + fatalities.7
logit.1 <- glm(form1, data = nigeria6_results[nigeria6_results$edu2_resp != 99 , ], family = binomial(link = "logit")))
stargazer(logit.1)

Thank you so much for your reply.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.