我正在努力研究如何控制stargazer中的线条样式设置。以下是我目前的工作示例。我喜欢桌子顶部的双线,但我想用一条线替换桌子底部的双线,我还想替换分隔斜率和拦截信息的单条实线来自摘要信息的虚线/虚线。对于到目前为止的所有步骤,我已经能够按照观星者的文档进行操作,但此时已经陷入困境。
非常感谢任何和所有建议。
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") )
答案 0 :(得分:1)
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") )
我添加了行table.layout ="-d-t-s=n",
,您可以控制布局,表格应包含哪些元素以及您喜欢哪种行样式。使用-
,您使用=
制作单行,即可生成双行。
这是所有选项的列表:
"-" 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