2

I am struggling with working out how to control the line style settings in stargazer. Below is my current working example. I like the double line at the top of the table, but I would like to replace the double line at the bottom of the table with a single line, and I would also like to replace the single solid line that separates the slope and intercept information from the summary information with a dashed/dotted line. For all steps up to this point I have been able to follow the stargazer documentation, but have become stuck at this point.

Any and all suggestions would be much appreciated.

lobster.data<- data.frame(
  distance= c(0, 2, 3, 4, 4, 5, 6, 7, 9, 12, 18, 20, 20, 23, 24, 26, 27, 28, 30),
  size= c(116.89, 96.90, 120.97, 116.40, 89.86, 96.83, 116.18, 117.02, 79.03, 
          69.86, 105.60, 68.12, 78.12, 69.86, 66.64, 62.11, 59.11, 59.94, 44.43))

lm.lobster <- lm(size~distance, data = lobster.data) # create our model

stargazer(lm.lobster, type = 'latex', single.row = TRUE, omit.stat=c("ser","f", "adj.rsq"), 
          no.space=TRUE, title ="Lobster linear regression",
          dep.var.caption="", digits =2, dep.var.labels ="Lobster size",covariate.labels=c("Distance", "Intercept") )
cuttlefish44
  • 6,586
  • 2
  • 17
  • 34

1 Answers1

4
stargazer(lm.lobster, type = 'latex', single.row = TRUE, 
          omit.stat=c("ser","f", "adj.rsq"), 
          no.space=TRUE, 
          title ="Lobster linear regression",
          dep.var.caption="", 
          digits =2,
          table.layout ="-d-t-s=n",
          dep.var.labels ="Lobster size",
          covariate.labels=c("Distance", "Intercept") )

I added the line table.layout ="-d-t-s=n", with this you can control the layout, what elements the table should contain and which style of lines you like. With the - you make single lines with the = you make double lines.

here is the list of all options:

"-"  single horizontal line
"="  double horizontal line
"-!"     mandatory single horizontal line
"=!"     mandatory double horizontal line
"l"  dependent variable caption
"d"  dependent variable labels
"m"  model label
"c"  column labels
"#"  model numbers
"b"  object names
"t"  coefficient table
"o"  omitted coefficient indicators
"a"  additional lines
"n"  notes
"s"  model statistics
and-bri
  • 1,563
  • 2
  • 19
  • 34