此答案基于texreg
版本 1.37.5。
观察对象属于类lm_robust
:
> class(mod1)
## [1] "lm_robust"
您可以显示相应extract
方法的帮助页面,如下所示:
?extract.lm_robust
## [..]
##
## extract.lm_robust(
## model,
## include.ci = TRUE,
## include.rsquared = TRUE,
## include.adjrs = TRUE,
## include.nobs = TRUE,
## include.fstatistic = FALSE,
## include.rmse = TRUE,
## include.nclusts = TRUE,
## ...
## )
##
## [...]
在您的示例中,您可以删除所有 GOF 行,如下所示:
screenreg(list(mod1, mod2),
include.rsquared = FALSE,
include.adjrs = FALSE,
include.nobs = FALSE,
include.rmse = FALSE)
## =========================================
## Model 1 Model 2
## -----------------------------------------
## (Intercept) -0.01 -0.00
## [-0.10; 0.08] [-0.07; 0.06]
## x1 0.49 * 0.48 *
## [ 0.40; 0.58] [ 0.41; 0.54]
## x2 0.98 *
## [ 0.92; 1.05]
## =========================================
## * Null hypothesis value outside the confidence interval.
从 更改screenreg
为texreg
以获得 LaTeX 输出。省略最后两个参数以仅删除 R 平方和调整后的 R 平方。默认情况下不报告 F 统计量。(也许您使用的是旧版本的texreg
?)
要在不使用这些参数的情况下删除统计信息,您还可以将texreg
对象保存到中间对象中并在将它们交给相应的表布局函数之前对其进行操作,如下例所示:
tr1 <- extract(mod1)
tr1@gof.names <- tr1@gof.names[-(1:2)]
tr1@gof.decimal <- tr1@gof.decimal[-(1:2)]
tr1@gof <- tr1@gof[-(1:2)]
screenreg(list(tr1, mod2))
## =========================================
## Model 1 Model 2
## -----------------------------------------
## (Intercept) -0.01 -0.00
## [-0.10; 0.08] [-0.07; 0.06]
## x1 0.49 * 0.48 *
## [ 0.40; 0.58] [ 0.41; 0.54]
## x2 0.98 *
## [ 0.92; 1.05]
## -----------------------------------------
## Num. obs. 1000 1000
## RMSE 1.41 1.03
## R^2 0.53
## Adj. R^2 0.53
## =========================================
## * Null hypothesis value outside the confidence interval.
这需要更多的努力,但可以让您完全控制,并且如果您只想更改某些模型也适用。