0

I'm trying to run some regressions for my thesis. I have 4 countries with the exact same coding for all the databases and can run the stargazer's individually, but it won't let me do all 4 on one table: when I add "modelouruguayedad" to it it gives me that error. Here's the code for all the lm's (they're all the same just different databases because different countries).

I can run this:

modelouruguayedad <- lm(age ~ religiosity + ideology,
                   data = Uruguay1)

stargazer::stargazer( modelouruguayedad, 
                  type = 'text',
                  title = "" ,
                  no.space = T,
                  digits = 4, 
                  star.cutoffs = c(.05, .01, .001),
                  dep.var.labels = 'Apoyo al matrimonio igualitario',
                  model.numbers = T, 
                  model.names = F, 
                  object.names = F,
                  column.labels = '',
                  omit.stat = c("f", "ser"))

but can't run this:

stargazer::stargazer( modelocolombiaedad, modelouruguayedad, modelobrasiledad, modelocolombiaedad,
                  type = 'text', 
                  title = "" ,
                  no.space = T,
                  digits = 4, 
                  star.cutoffs = c(.05, .01, .001),
                  dep.var.labels = 'Edad',
                  model.numbers = T, 
                  model.names = F, 
                  object.names = F,
                  column.labels = c("Argentina", "Brasil",  "Colombia", "Uruguay"),
                  covariate.labels = c("Religiosidad", "Ideologia"),
                  omit.stat = c("f", "ser"))

cause it says:

Error in if (is.na(s)) { : the condition has length > 1"
Phil
  • 7,287
  • 3
  • 36
  • 66
  • this looks like a stargazer bug, please report to the code maintainer – MichaelChirico Jun 09 '23 at 01:42
  • [this](https://stackoverflow.com/a/75126356/2994949) has a similar issue, says not related to stargazer. i tried your code with a toy example, `m1 <- lm(mpg ~ vs + am, mtcars); stargazer(m1, ...); stargazer(m1, m1, m1, m1, ...)` and both worked. can you use m1 on your end with 1 and 4 models and see if it works – rawr Jun 09 '23 at 01:51
  • Make model names shorter. – Marco Jul 05 '23 at 13:01

0 Answers0