如何最好地将stepAIC的输出隐藏在Rmarkdown中的输出中。我试过echo = FALSE,message = FALSE,但是它不起作用。有什么好消息吗?
---
title: "Multivariate Regression"
author: "Moses Otieno"
date: "11/05/2021"
output: word_document
---
```{r setup, include=FALSE}knitr::opts_chunk$set(echo = FALSE,message = FALSE,warning = FALSE)
库(gt汇总)#表的语法
```{r regression}mod1 <- glm(应答~ trt +年龄+年级,试验,家庭=二项分布)
step.model <-质量::逐步MASS(mod1,方向=“两者”)
t1 <- tbl_regression(step.model,指数=真)
t1
发布于 2021-05-11 20:23:53
设置trace=0?来自?MASS::stepAIC,
跟踪:如果为正,则在运行“步骤the”时打印信息。较大的值可以提供更多关于拟合过程的信息。
这是最好的方法,但如果您不能做到这一点,那么capture.output()也会工作:
junk <- capture.output(step.model <- MASS::stepAIC(mod1, direction = "both"))如果将stepAIC()调用放在单独的块中,我认为将results="hide"指定为块选项也是可行的。
https://stackoverflow.com/questions/67493841
复制相似问题