简体   繁体   English

重命名占星师乳胶表中的变量名称

[英]Rename variable names in stargazer latex table

I have made this model selection table: 我已经制作了这个模型选择表:

lm_mtcars <- lm(mpg ~ drat + hp + wt, mtcars)

library(MuMIn)
mod_sel_lm_mtcars <- (mod.sel(lm_mtcars))

mod_sel_lm_mtcars

Model selection table 
          (Intrc)  drat       hp     wt df  logLik AICc delta weight
lm_mtcars   29.39 1.615 -0.03223 -3.228  5 -73.366  159     0      1

I can get stargazer to convert it to a latex table: 我可以让stargazer者将其转换为乳胶表:

library(stargazer)
stargazer(mod_sel_lm_mtcars)

How can I get stargazer to print variable names as in Coulombe Et Al 2011, p288, Table 2 . 我如何让stargazer者像Coulombe Et Al 2011,p288,Table 2中那样打印变量名。

Therefore: 因此:

  1. df should be renamed to k (in italics) df应该重命名为k(斜体)
  2. delta should be renamed to [latex symbol \\Delta] AICc Delta应该重命名为[latex symbol \\ Delta] AICc
  3. weight should be renamed to w[subscript i] 权重应重命名为w [下标i]

You can use the covariate.labels argument. 您可以使用covariate.labels参数。 for this (As you didn't make clear which rows you wanted to keep in the output, I assumed you wanted them all, but you can change that as well using the keep argument.) 为此(由于您不确定要在输出中保留哪些行,所以我假设您全部想要,但您也可以使用keep参数更改该行。)

stargazer(mod_sel_lm_mtcars, covariate.labels = c("(Intercept)", "drat", "hp", "$w_{i}$", "\\textit{k}", "logLik", "AICc", "\\Delta AICc")) stargazer(mod_sel_lm_mtcars,covariate.labels = c(“(Intercept)”,“ drat”,“ hp”,“ $ w_ {i} $”,“ \\ textit {k}”,“ logLik”,“ AICc”,“ \\ Delta AICc“))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM